From 7b2c7b91c7c117772687380982e3931aafb7f6b3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 00:47:11 +0530 Subject: [PATCH] feat: add Automation API and Rollback API (#6767) chore: update platform logs docs: small documentation updates PiperOrigin-RevId: 578872129 Source-Link: https://github.com/googleapis/googleapis/commit/41d7a832828ef42fcf6d97d48f4802b55628126f Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb84145fc26cf1f77d65af9ad82a239dfddc16bd Copy-Tag: eyJwIjoiRGVwbG95Ly5Pd2xCb3QueWFtbCIsImgiOiJlYjg0MTQ1ZmMyNmNmMWY3N2Q2NWFmOWFkODJhMjM5ZGZkZGMxNmJkIn0= --- Deploy/metadata/V1/AutomationPayload.php | 34 + Deploy/metadata/V1/AutomationrunPayload.php | 36 + Deploy/metadata/V1/CloudDeploy.php | Bin 29348 -> 38789 bytes Deploy/metadata/V1/ReleaseRenderPayload.php | 8 +- Deploy/metadata/V1/RolloutUpdatePayload.php | Bin 0 -> 1351 bytes .../V1/CloudDeployClient/abandon_release.php | 3 +- .../V1/CloudDeployClient/advance_rollout.php | 3 +- .../V1/CloudDeployClient/approve_rollout.php | 3 +- .../cancel_automation_run.php | 80 ++ .../V1/CloudDeployClient/cancel_rollout.php | 3 +- .../CloudDeployClient/create_automation.php | 107 ++ .../create_delivery_pipeline.php | 3 +- .../V1/CloudDeployClient/create_release.php | 2 +- .../V1/CloudDeployClient/create_rollout.php | 2 +- .../V1/CloudDeployClient/create_target.php | 2 +- .../CloudDeployClient/delete_automation.php | 86 ++ .../delete_delivery_pipeline.php | 2 +- .../V1/CloudDeployClient/delete_target.php | 2 +- .../V1/CloudDeployClient/get_automation.php | 77 ++ .../CloudDeployClient/get_automation_run.php | 77 ++ .../get_delivery_pipeline.php | 2 +- .../V1/CloudDeployClient/get_job_run.php | 2 +- .../V1/CloudDeployClient/get_release.php | 2 +- .../V1/CloudDeployClient/get_rollout.php | 2 +- .../V1/CloudDeployClient/get_target.php | 2 +- .../V1/CloudDeployClient/ignore_job.php | 3 +- .../list_automation_runs.php | 82 ++ .../V1/CloudDeployClient/list_automations.php | 82 ++ .../list_delivery_pipelines.php | 2 +- .../V1/CloudDeployClient/list_targets.php | 2 +- .../V1/CloudDeployClient/retry_job.php | 3 +- .../V1/CloudDeployClient/rollback_target.php | 83 ++ .../CloudDeployClient/terminate_job_run.php | 3 +- .../CloudDeployClient/update_automation.php | 94 ++ Deploy/src/V1/AbandonReleaseRequest.php | 15 +- Deploy/src/V1/AdvanceChildRolloutJobRun.php | 20 +- Deploy/src/V1/AdvanceRolloutOperation.php | 179 +++ Deploy/src/V1/AdvanceRolloutRequest.php | 15 +- Deploy/src/V1/AdvanceRolloutRule.php | 210 ++++ Deploy/src/V1/ApproveRolloutRequest.php | 15 +- Deploy/src/V1/Automation.php | 596 ++++++++++ Deploy/src/V1/AutomationEvent.php | 174 +++ Deploy/src/V1/AutomationResourceSelector.php | 68 ++ Deploy/src/V1/AutomationRolloutMetadata.php | 148 +++ Deploy/src/V1/AutomationRule.php | 150 +++ Deploy/src/V1/AutomationRuleCondition.php | 78 ++ Deploy/src/V1/AutomationRun.php | 679 +++++++++++ Deploy/src/V1/AutomationRun/State.php | 83 ++ Deploy/src/V1/AutomationRunEvent.php | 276 +++++ Deploy/src/V1/BackoffMode.php | 61 + Deploy/src/V1/CanaryDeployment.php | 16 +- Deploy/src/V1/CancelAutomationRunRequest.php | 86 ++ Deploy/src/V1/CancelAutomationRunResponse.php | 33 + Deploy/src/V1/CancelRolloutRequest.php | 15 +- Deploy/src/V1/Client/CloudDeployClient.php | 323 +++++ Deploy/src/V1/CloudRunMetadata.php | 50 +- Deploy/src/V1/CloudRunRenderMetadata.php | 8 +- Deploy/src/V1/CreateAutomationRequest.php | 285 +++++ Deploy/src/V1/CreateChildRolloutJobRun.php | 20 +- .../src/V1/CreateDeliveryPipelineRequest.php | 15 +- Deploy/src/V1/CreateReleaseRequest.php | 10 +- Deploy/src/V1/CreateRolloutRequest.php | 10 +- Deploy/src/V1/CreateTargetRequest.php | 10 +- .../V1/CustomCanaryDeployment/PhaseConfig.php | 16 +- Deploy/src/V1/DeleteAutomationRequest.php | 282 +++++ .../src/V1/DeleteDeliveryPipelineRequest.php | 10 +- Deploy/src/V1/DeleteTargetRequest.php | 10 +- Deploy/src/V1/DeliveryPipeline.php | 16 +- Deploy/src/V1/DeployJobRun.php | 8 +- Deploy/src/V1/DeployJobRun/FailureCause.php | 2 +- Deploy/src/V1/DeploymentJobs.php | 24 +- .../src/V1/Gapic/CloudDeployGapicClient.php | 1012 +++++++++++++++- Deploy/src/V1/GetAutomationRequest.php | 86 ++ Deploy/src/V1/GetAutomationRunRequest.php | 86 ++ Deploy/src/V1/GetDeliveryPipelineRequest.php | 10 +- Deploy/src/V1/GetJobRunRequest.php | 10 +- Deploy/src/V1/GetReleaseRequest.php | 10 +- Deploy/src/V1/GetRolloutRequest.php | 10 +- Deploy/src/V1/GetTargetRequest.php | 10 +- Deploy/src/V1/GkeCluster.php | 8 +- Deploy/src/V1/IgnoreJobRequest.php | 15 +- Deploy/src/V1/JobRun.php | 16 +- Deploy/src/V1/ListAutomationRunsRequest.php | 255 ++++ Deploy/src/V1/ListAutomationRunsResponse.php | 139 +++ Deploy/src/V1/ListAutomationsRequest.php | 255 ++++ Deploy/src/V1/ListAutomationsResponse.php | 139 +++ .../src/V1/ListDeliveryPipelinesRequest.php | 10 +- Deploy/src/V1/ListTargetsRequest.php | 10 +- Deploy/src/V1/Metadata.php | 48 + Deploy/src/V1/Postdeploy.php | 8 +- Deploy/src/V1/PostdeployJobRun.php | 8 +- .../src/V1/PostdeployJobRun/FailureCause.php | 2 +- Deploy/src/V1/Predeploy.php | 8 +- Deploy/src/V1/PredeployJobRun.php | 8 +- .../src/V1/PredeployJobRun/FailureCause.php | 2 +- Deploy/src/V1/PromoteReleaseOperation.php | 187 +++ Deploy/src/V1/PromoteReleaseRule.php | 260 ++++ Deploy/src/V1/Release.php | 20 +- .../V1/Release/TargetRender/FailureCause.php | 9 + Deploy/src/V1/ReleaseRenderEvent.php | 42 +- Deploy/src/V1/RepairMode.php | 108 ++ Deploy/src/V1/RepairPhase.php | 109 ++ Deploy/src/V1/RepairRolloutOperation.php | 139 +++ Deploy/src/V1/RepairRolloutRule.php | 262 ++++ Deploy/src/V1/RepairState.php | 89 ++ Deploy/src/V1/Retry.php | 157 +++ Deploy/src/V1/RetryAttempt.php | 179 +++ Deploy/src/V1/RetryJobRequest.php | 15 +- Deploy/src/V1/RetryPhase.php | 208 ++++ Deploy/src/V1/Rollback.php | 71 ++ Deploy/src/V1/RollbackAttempt.php | 169 +++ Deploy/src/V1/RollbackTargetConfig.php | 115 ++ Deploy/src/V1/RollbackTargetRequest.php | 325 +++++ Deploy/src/V1/RollbackTargetResponse.php | 77 ++ Deploy/src/V1/Rollout.php | 112 +- Deploy/src/V1/RolloutUpdateEvent.php | 272 +++++ .../RolloutUpdateEvent/RolloutUpdateType.php | 139 +++ Deploy/src/V1/Target.php | 8 +- Deploy/src/V1/TargetAttribute.php | 120 ++ Deploy/src/V1/TargetsPresentCondition.php | 8 +- Deploy/src/V1/TerminateJobRunRequest.php | 15 +- Deploy/src/V1/UpdateAutomationRequest.php | 306 +++++ Deploy/src/V1/VerifyJobRun.php | 8 +- Deploy/src/V1/VerifyJobRun/FailureCause.php | 2 +- Deploy/src/V1/gapic_metadata.json | 45 + .../resources/cloud_deploy_client_config.json | 45 + .../cloud_deploy_descriptor_config.php | 149 +++ .../cloud_deploy_rest_client_config.php | 110 ++ .../Unit/V1/Client/CloudDeployClientTest.php | 1057 +++++++++++++++-- .../tests/Unit/V1/CloudDeployClientTest.php | 914 +++++++++++++- 130 files changed, 12399 insertions(+), 527 deletions(-) create mode 100644 Deploy/metadata/V1/AutomationPayload.php create mode 100644 Deploy/metadata/V1/AutomationrunPayload.php create mode 100644 Deploy/metadata/V1/RolloutUpdatePayload.php create mode 100644 Deploy/samples/V1/CloudDeployClient/cancel_automation_run.php create mode 100644 Deploy/samples/V1/CloudDeployClient/create_automation.php create mode 100644 Deploy/samples/V1/CloudDeployClient/delete_automation.php create mode 100644 Deploy/samples/V1/CloudDeployClient/get_automation.php create mode 100644 Deploy/samples/V1/CloudDeployClient/get_automation_run.php create mode 100644 Deploy/samples/V1/CloudDeployClient/list_automation_runs.php create mode 100644 Deploy/samples/V1/CloudDeployClient/list_automations.php create mode 100644 Deploy/samples/V1/CloudDeployClient/rollback_target.php create mode 100644 Deploy/samples/V1/CloudDeployClient/update_automation.php create mode 100644 Deploy/src/V1/AdvanceRolloutOperation.php create mode 100644 Deploy/src/V1/AdvanceRolloutRule.php create mode 100644 Deploy/src/V1/Automation.php create mode 100644 Deploy/src/V1/AutomationEvent.php create mode 100644 Deploy/src/V1/AutomationResourceSelector.php create mode 100644 Deploy/src/V1/AutomationRolloutMetadata.php create mode 100644 Deploy/src/V1/AutomationRule.php create mode 100644 Deploy/src/V1/AutomationRuleCondition.php create mode 100644 Deploy/src/V1/AutomationRun.php create mode 100644 Deploy/src/V1/AutomationRun/State.php create mode 100644 Deploy/src/V1/AutomationRunEvent.php create mode 100644 Deploy/src/V1/BackoffMode.php create mode 100644 Deploy/src/V1/CancelAutomationRunRequest.php create mode 100644 Deploy/src/V1/CancelAutomationRunResponse.php create mode 100644 Deploy/src/V1/CreateAutomationRequest.php create mode 100644 Deploy/src/V1/DeleteAutomationRequest.php create mode 100644 Deploy/src/V1/GetAutomationRequest.php create mode 100644 Deploy/src/V1/GetAutomationRunRequest.php create mode 100644 Deploy/src/V1/ListAutomationRunsRequest.php create mode 100644 Deploy/src/V1/ListAutomationRunsResponse.php create mode 100644 Deploy/src/V1/ListAutomationsRequest.php create mode 100644 Deploy/src/V1/ListAutomationsResponse.php create mode 100644 Deploy/src/V1/PromoteReleaseOperation.php create mode 100644 Deploy/src/V1/PromoteReleaseRule.php create mode 100644 Deploy/src/V1/RepairMode.php create mode 100644 Deploy/src/V1/RepairPhase.php create mode 100644 Deploy/src/V1/RepairRolloutOperation.php create mode 100644 Deploy/src/V1/RepairRolloutRule.php create mode 100644 Deploy/src/V1/RepairState.php create mode 100644 Deploy/src/V1/Retry.php create mode 100644 Deploy/src/V1/RetryAttempt.php create mode 100644 Deploy/src/V1/RetryPhase.php create mode 100644 Deploy/src/V1/Rollback.php create mode 100644 Deploy/src/V1/RollbackAttempt.php create mode 100644 Deploy/src/V1/RollbackTargetConfig.php create mode 100644 Deploy/src/V1/RollbackTargetRequest.php create mode 100644 Deploy/src/V1/RollbackTargetResponse.php create mode 100644 Deploy/src/V1/RolloutUpdateEvent.php create mode 100644 Deploy/src/V1/RolloutUpdateEvent/RolloutUpdateType.php create mode 100644 Deploy/src/V1/TargetAttribute.php create mode 100644 Deploy/src/V1/UpdateAutomationRequest.php diff --git a/Deploy/metadata/V1/AutomationPayload.php b/Deploy/metadata/V1/AutomationPayload.php new file mode 100644 index 000000000000..f997f5e2423a --- /dev/null +++ b/Deploy/metadata/V1/AutomationPayload.php @@ -0,0 +1,34 @@ +internalAddGeneratedFile( + ' + +/google/cloud/deploy/v1/automation_payload.protogoogle.cloud.deploy.v1"x +AutomationEvent +message (  + +automation (  + pipeline_uid ( * +type (2.google.cloud.deploy.v1.TypeBj +com.google.cloud.deploy.v1BAutomationPayloadProtoPZ2cloud.google.com/go/deploy/apiv1/deploypb;deploypbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Deploy/metadata/V1/AutomationrunPayload.php b/Deploy/metadata/V1/AutomationrunPayload.php new file mode 100644 index 000000000000..a684c442631c --- /dev/null +++ b/Deploy/metadata/V1/AutomationrunPayload.php @@ -0,0 +1,36 @@ +internalAddGeneratedFile( + ' + +2google/cloud/deploy/v1/automationrun_payload.protogoogle.cloud.deploy.v1" +AutomationRunEvent +message (  +automation_run (  + pipeline_uid (  + automation_id (  +rule_id (  +destination_target_id ( * +type (2.google.cloud.deploy.v1.TypeBm +com.google.cloud.deploy.v1BAutomationRunPayloadProtoPZ2cloud.google.com/go/deploy/apiv1/deploypb;deploypbbproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/Deploy/metadata/V1/CloudDeploy.php b/Deploy/metadata/V1/CloudDeploy.php index 43becbfe44a254b1a2ab3abf5c2e0867c120610c..f2633aa1c39330932ae10dffb362921c7ef13eed 100644 GIT binary patch delta 6023 zcmb7IYit}>74GbK*Y;i8ySd)jyX*Jly>ZsbCLxXUAY*%z*m0cgI%%3VbTYQb$u{eq z?apjzRYeXFRaM#_ZLdUmRc%DcuSyBBkP3eYf*%MFBEYZk3gRJAs8Hb#iV$$lo%h-) z?H|i~ALoAO+;hI~+ip%?YVD$Cj_Z}h z(nY$LG}mBUubW9>P+%8!_eHFq>~Hy=zR;kswRKFqCkxWe5Lq9zz~1UU!LBB|E{AA0 zA+{Bzw2%~?UDkwF)>K2oi6&=4phG0#>@al&|5XrMGVCpxA~77tVP&49O-9(Q&VF_) z-xP0jgjKt`_cz1l77MOIx{CH@%ip4ARP~CX(fn$&!UN5&sL9W??RrfhG0TcBbe>0*|RO_nfoHNcIehEAKwMPi*>6K)N{e5~M?*4WlY&du+bVFdT9DJ^uZYSbX`kZ~6{r6?_IDa7nzvc{k-eIP6_Advc1yW$m;t?Y4C+qw+tCxVieOV~I2T*0JI(-hUhMFerRyrx% zgjFjXQ&gaiA0qk@`=l79UkPMgkw^TKK|p@C!vggMEXJwA89GGT>}y=on;`~3aU#3f z(c5nwby8ojvONelf+0QlQ6ZH+FA(C{pu3@>G*ALN9s4jr`r$XmA2V=2X~8_=f@o#k zAS_AA_L#j4b7u)4Nv{YbTts_xJ!w%*Q(LN3%>I=vk7oOIWGaG()SHDCu@iqKRm31WAdN zI=3IRto>Oa-QzV)H8r16?ddwCJ3T}qRka3IxRM* z47a5T(E|bD6WN9KexFpZ`_h5LZve!ZDhQVk1besZa4fht)VMd>eRj`xVDALbi+^v? zcHlrjh8*}7b^0-!+o9S6Um>2D0PTkk8DQy6-4|G zcW_;Fn@N%Vq^~b6(h1V(xu6&owQ5|_P3RfnUVSNn*(IWsu0fU}{WJ+1pzRjnb+D^@ z(~|+f*;$;mYyeU6wF*$he63XF1dFn4_b1?p_H4COvmJ>d{6Yd6ZXkS2#Wrv0sx*yx zbLU8^QOoqIRy30!2Xqu$?c?dT%H-vPfzD3;vs0O zBS+;){9gn`iB8Tah2p7W#r*7Syop9hb0I%7F*$QA9v*!Yx{WUjWGi+XvA`YCC2TmJ z@{$1(Ezomdk9cJ)N?Kiaq?e#J9uUP~uDEoyjm+x-V;cql!Pq_^%7Qs z=DRy6p>FJGinRG<(|Zv$9Ju_T1J~4V-{EfnpR9dveh++pZYHVudJXATvC{!%Bcqg{ z4}F#sD%Tk-o_2eIt@zM}1G8^HecOf&Pyu@ho|O_@UDQIs2cgMxG!g4{fa{sJ9Fq8m zUliG2PYmEYa1n(G9%U$bcD9doxGK(3NI&P|3-V|k)I&NJVYGck-i4cRY$aKF#kupMOMxy*}$QUYF)_#Pw}PE4S41S)db7TQG_E63cZsn zbcXVB4Qc=bZQB0@fuz^6X3NuI67$O0dg8%T0CH;+w&M-J{ya&K<14fr82=cCb_F&_eWYhiJC=8uZwn;BV#Dj%^trDuXXZ$B%*!=+ z+$G24@e`+x9#u}Bn#e0>W@Zcd@yVl;z>yEZmzU1K?DXVJUM|LkRon896;93MXHHMb z)A3N|r*8G}tH#yEd_kTpD(w3H#Bv%K!umOTT0WguX3va|=kpVAq5vILaL&)(fF`id zrE<@{WiZI=N%%PBKW?+j^0aYk_QYhN05~GKe~zyFhwHqNR+d!b^2b2@2Z6*J+h>etqNhF3 zQX|CHWgg9ZX57BR&ZsY%?CB@>cYaGC?Eyxh!$=)nfib(X(-KZ4WVa!fik5xq+TZT8 zk6z!E`FADyL*U*Zj~SG$>r6EcvUp`^s9~X-k*D3$?A#dkpLSQaA3yYa5TYP{=%_~! zd#Z8R@r?6j;F(sD&hX=o)1yxCa=znu@8tRSOL+VTVdDb2i#_sqZ_unG1?e2l4SK<} zWWu68>8yLU?P}xMp0~dfNaq?XN^?+SJ*fwfbb2?=N~>q>^A&!6Q99}P-n-iO(Rr=` tKm#nVKNfm1vhtSxUMT#&JZ*jT48vDXKv5Xk+KOKkMxKYi?9tlH{{WswflUAa delta 124 zcmV-?0E7R9uL7jy0k9ne1FqZwvmgXQ6tiR+Tnqy36|+_+Py_<#1hc3s%K-tMld)4` zlh!RDvl%Xg2?F~Kv!6H31GBU{FarZj3J8;qKTDH;KUx8KliNRevkyTn9FxIxy#q3) eE3>wCUj?)DeEScR-jh)RxCOH@l(+(uIG0U7Brr_? diff --git a/Deploy/metadata/V1/ReleaseRenderPayload.php b/Deploy/metadata/V1/ReleaseRenderPayload.php index de716878e6a7..62137ad172fe 100644 --- a/Deploy/metadata/V1/ReleaseRenderPayload.php +++ b/Deploy/metadata/V1/ReleaseRenderPayload.php @@ -14,13 +14,15 @@ public static function initOnce() { if (static::$is_initialized == true) { return; } + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); $pool->internalAddGeneratedFile( ' - -3google/cloud/deploy/v1/release_render_payload.protogoogle.cloud.deploy.v1"6 + +3google/cloud/deploy/v1/release_render_payload.protogoogle.cloud.deploy.v1" ReleaseRenderEvent message (  -release ( Bm +release ( I +release_render_state (2+.google.cloud.deploy.v1.Release.RenderStateBm com.google.cloud.deploy.v1BReleaseRenderPayloadProtoPZ2cloud.google.com/go/deploy/apiv1/deploypb;deploypbbproto3' , true); diff --git a/Deploy/metadata/V1/RolloutUpdatePayload.php b/Deploy/metadata/V1/RolloutUpdatePayload.php new file mode 100644 index 0000000000000000000000000000000000000000..976c45d43dbca5a77e0967ce14df490f797a8b10 GIT binary patch literal 1351 zcmbW1|4-9E6u=#fjom;-Q8SH+Cy+3VZUKH9pegGyXX;k>g#@#txwW^^r0X^9m1G)z zHU4w{PrhEa!9-$Wf9bt<_df64`*J5A{3{>r;5zeIKn1h$V1mUJ!+yX8x44T3(QwED zZ1J)0xGX4RthI2n)x|_>bYFvM$fLkwRXpN+ua(z$kjRc6k zBMhG(4P3{l{4O*VXO8Yor#%FhZ z4!JnRv(StAy!xJpFiR!2>x1ndX{0Pvlw31UC{NIu@A%AhJZ46YT}57zsFX-AJ?L) z3k(I^LlcK|#EKc|>kUdvcviw+J_L`Aw|_37%>^$Kxr1J{Te{xrb0GYc%VH6eMP2Dwu7e6SYGMOAuMU(KL;AtKKG^PGMPjj8IK& z)`+ghR%vA&<)$(aR}_RYA62~z>rA}W>D6k4Xdq_et#h@Z!+KSDiZ)dPs28dZ&c5^- zZBXZwHME+jK|-KCX=T>Z~owTwismO6LhpUZ|}Fs+}#<|2S-$%OeW|C-5~TE Dk|vsa literal 0 HcmV?d00001 diff --git a/Deploy/samples/V1/CloudDeployClient/abandon_release.php b/Deploy/samples/V1/CloudDeployClient/abandon_release.php index 82bf477492b3..eafb10268a4b 100644 --- a/Deploy/samples/V1/CloudDeployClient/abandon_release.php +++ b/Deploy/samples/V1/CloudDeployClient/abandon_release.php @@ -32,8 +32,7 @@ * Abandons a Release in the Delivery Pipeline. * * @param string $formattedName Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. */ function abandon_release_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/advance_rollout.php b/Deploy/samples/V1/CloudDeployClient/advance_rollout.php index a4e29ebaa7fb..720fdb84a5c5 100644 --- a/Deploy/samples/V1/CloudDeployClient/advance_rollout.php +++ b/Deploy/samples/V1/CloudDeployClient/advance_rollout.php @@ -32,8 +32,7 @@ * Advances a Rollout in a given project and location. * * @param string $formattedName Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId The phase ID to advance the `Rollout` to. */ diff --git a/Deploy/samples/V1/CloudDeployClient/approve_rollout.php b/Deploy/samples/V1/CloudDeployClient/approve_rollout.php index f2da1166c019..1f69efe0d961 100644 --- a/Deploy/samples/V1/CloudDeployClient/approve_rollout.php +++ b/Deploy/samples/V1/CloudDeployClient/approve_rollout.php @@ -32,8 +32,7 @@ * Approves a Rollout. * * @param string $formattedName Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param bool $approved True = approve; false = reject */ diff --git a/Deploy/samples/V1/CloudDeployClient/cancel_automation_run.php b/Deploy/samples/V1/CloudDeployClient/cancel_automation_run.php new file mode 100644 index 000000000000..359e1d67b819 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/cancel_automation_run.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var CancelAutomationRunResponse $response */ + $response = $cloudDeployClient->cancelAutomationRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudDeployClient::automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + + cancel_automation_run_sample($formattedName); +} +// [END clouddeploy_v1_generated_CloudDeploy_CancelAutomationRun_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/cancel_rollout.php b/Deploy/samples/V1/CloudDeployClient/cancel_rollout.php index 2f06b27d86a9..245d3fbd5dd6 100644 --- a/Deploy/samples/V1/CloudDeployClient/cancel_rollout.php +++ b/Deploy/samples/V1/CloudDeployClient/cancel_rollout.php @@ -32,8 +32,7 @@ * Cancels a Rollout in a given project and location. * * @param string $formattedName Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. */ function cancel_rollout_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/create_automation.php b/Deploy/samples/V1/CloudDeployClient/create_automation.php new file mode 100644 index 000000000000..c5c741206d82 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/create_automation.php @@ -0,0 +1,107 @@ +setServiceAccount($automationServiceAccount) + ->setSelector($automationSelector) + ->setRules($automationRules); + $request = (new CreateAutomationRequest()) + ->setParent($formattedParent) + ->setAutomationId($automationId) + ->setAutomation($automation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudDeployClient->createAutomation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Automation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = CloudDeployClient::deliveryPipelineName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]' + ); + $automationId = '[AUTOMATION_ID]'; + $automationServiceAccount = '[SERVICE_ACCOUNT]'; + + create_automation_sample($formattedParent, $automationId, $automationServiceAccount); +} +// [END clouddeploy_v1_generated_CloudDeploy_CreateAutomation_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/create_delivery_pipeline.php b/Deploy/samples/V1/CloudDeployClient/create_delivery_pipeline.php index bf8a7ac6d3a3..7c0b63f18968 100644 --- a/Deploy/samples/V1/CloudDeployClient/create_delivery_pipeline.php +++ b/Deploy/samples/V1/CloudDeployClient/create_delivery_pipeline.php @@ -34,7 +34,8 @@ * Creates a new DeliveryPipeline in a given project and location. * * @param string $formattedParent The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. Please see + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * @param string $deliveryPipelineId ID of the `DeliveryPipeline`. */ diff --git a/Deploy/samples/V1/CloudDeployClient/create_release.php b/Deploy/samples/V1/CloudDeployClient/create_release.php index e5446b1c445e..872c4c7b5815 100644 --- a/Deploy/samples/V1/CloudDeployClient/create_release.php +++ b/Deploy/samples/V1/CloudDeployClient/create_release.php @@ -35,7 +35,7 @@ * * @param string $formattedParent The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. * @param string $releaseId ID of the `Release`. */ diff --git a/Deploy/samples/V1/CloudDeployClient/create_rollout.php b/Deploy/samples/V1/CloudDeployClient/create_rollout.php index c46ab0213837..0c9e742e481e 100644 --- a/Deploy/samples/V1/CloudDeployClient/create_rollout.php +++ b/Deploy/samples/V1/CloudDeployClient/create_rollout.php @@ -35,7 +35,7 @@ * * @param string $formattedParent The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. * @param string $rolloutId ID of the `Rollout`. * @param string $rolloutTargetId The ID of Target to which this `Rollout` is deploying. diff --git a/Deploy/samples/V1/CloudDeployClient/create_target.php b/Deploy/samples/V1/CloudDeployClient/create_target.php index 18601019c823..334c3470358b 100644 --- a/Deploy/samples/V1/CloudDeployClient/create_target.php +++ b/Deploy/samples/V1/CloudDeployClient/create_target.php @@ -35,7 +35,7 @@ * * @param string $formattedParent The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. Please see + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * @param string $targetId ID of the `Target`. */ diff --git a/Deploy/samples/V1/CloudDeployClient/delete_automation.php b/Deploy/samples/V1/CloudDeployClient/delete_automation.php new file mode 100644 index 000000000000..54178a2f4f57 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/delete_automation.php @@ -0,0 +1,86 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudDeployClient->deleteAutomation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudDeployClient::automationName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION]' + ); + + delete_automation_sample($formattedName); +} +// [END clouddeploy_v1_generated_CloudDeploy_DeleteAutomation_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/delete_delivery_pipeline.php b/Deploy/samples/V1/CloudDeployClient/delete_delivery_pipeline.php index ba31ce72c6ce..1477a288dcda 100644 --- a/Deploy/samples/V1/CloudDeployClient/delete_delivery_pipeline.php +++ b/Deploy/samples/V1/CloudDeployClient/delete_delivery_pipeline.php @@ -33,7 +33,7 @@ * Deletes a single DeliveryPipeline. * * @param string $formattedName The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. */ function delete_delivery_pipeline_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/delete_target.php b/Deploy/samples/V1/CloudDeployClient/delete_target.php index 418ebf348524..a1629ee68f80 100644 --- a/Deploy/samples/V1/CloudDeployClient/delete_target.php +++ b/Deploy/samples/V1/CloudDeployClient/delete_target.php @@ -33,7 +33,7 @@ * Deletes a single Target. * * @param string $formattedName The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. Please see + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. Please see * {@see CloudDeployClient::targetName()} for help formatting this field. */ function delete_target_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/get_automation.php b/Deploy/samples/V1/CloudDeployClient/get_automation.php new file mode 100644 index 000000000000..594e3c31dfe3 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/get_automation.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Automation $response */ + $response = $cloudDeployClient->getAutomation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudDeployClient::automationName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION]' + ); + + get_automation_sample($formattedName); +} +// [END clouddeploy_v1_generated_CloudDeploy_GetAutomation_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/get_automation_run.php b/Deploy/samples/V1/CloudDeployClient/get_automation_run.php new file mode 100644 index 000000000000..7f6403ed78ce --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/get_automation_run.php @@ -0,0 +1,77 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var AutomationRun $response */ + $response = $cloudDeployClient->getAutomationRun($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudDeployClient::automationRunName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]', + '[AUTOMATION_RUN]' + ); + + get_automation_run_sample($formattedName); +} +// [END clouddeploy_v1_generated_CloudDeploy_GetAutomationRun_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/get_delivery_pipeline.php b/Deploy/samples/V1/CloudDeployClient/get_delivery_pipeline.php index 2c41013e1fab..d4bee4d94754 100644 --- a/Deploy/samples/V1/CloudDeployClient/get_delivery_pipeline.php +++ b/Deploy/samples/V1/CloudDeployClient/get_delivery_pipeline.php @@ -32,7 +32,7 @@ * Gets details of a single DeliveryPipeline. * * @param string $formattedName Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. */ function get_delivery_pipeline_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/get_job_run.php b/Deploy/samples/V1/CloudDeployClient/get_job_run.php index 464dfb132a12..0dbb116c9a28 100644 --- a/Deploy/samples/V1/CloudDeployClient/get_job_run.php +++ b/Deploy/samples/V1/CloudDeployClient/get_job_run.php @@ -32,7 +32,7 @@ * Gets details of a single JobRun. * * @param string $formattedName Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. Please see * {@see CloudDeployClient::jobRunName()} for help formatting this field. */ function get_job_run_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/get_release.php b/Deploy/samples/V1/CloudDeployClient/get_release.php index fc99a2eab671..cb5f7a68fd20 100644 --- a/Deploy/samples/V1/CloudDeployClient/get_release.php +++ b/Deploy/samples/V1/CloudDeployClient/get_release.php @@ -32,7 +32,7 @@ * Gets details of a single Release. * * @param string $formattedName Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. */ function get_release_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/get_rollout.php b/Deploy/samples/V1/CloudDeployClient/get_rollout.php index 667b70399884..a7f90080be4b 100644 --- a/Deploy/samples/V1/CloudDeployClient/get_rollout.php +++ b/Deploy/samples/V1/CloudDeployClient/get_rollout.php @@ -32,7 +32,7 @@ * Gets details of a single Rollout. * * @param string $formattedName Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. */ function get_rollout_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/get_target.php b/Deploy/samples/V1/CloudDeployClient/get_target.php index f70889e7980d..067f3c5ca779 100644 --- a/Deploy/samples/V1/CloudDeployClient/get_target.php +++ b/Deploy/samples/V1/CloudDeployClient/get_target.php @@ -32,7 +32,7 @@ * Gets details of a single Target. * * @param string $formattedName Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. Please see + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. Please see * {@see CloudDeployClient::targetName()} for help formatting this field. */ function get_target_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/ignore_job.php b/Deploy/samples/V1/CloudDeployClient/ignore_job.php index a6299b104e6e..4bd3dc729846 100644 --- a/Deploy/samples/V1/CloudDeployClient/ignore_job.php +++ b/Deploy/samples/V1/CloudDeployClient/ignore_job.php @@ -32,8 +32,7 @@ * Ignores the specified Job in a Rollout. * * @param string $formattedRollout Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId The phase ID the Job to ignore belongs to. * @param string $jobId The job ID for the Job to ignore. diff --git a/Deploy/samples/V1/CloudDeployClient/list_automation_runs.php b/Deploy/samples/V1/CloudDeployClient/list_automation_runs.php new file mode 100644 index 000000000000..204e53d68cdc --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/list_automation_runs.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudDeployClient->listAutomationRuns($request); + + /** @var AutomationRun $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 = CloudDeployClient::deliveryPipelineName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]' + ); + + list_automation_runs_sample($formattedParent); +} +// [END clouddeploy_v1_generated_CloudDeploy_ListAutomationRuns_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/list_automations.php b/Deploy/samples/V1/CloudDeployClient/list_automations.php new file mode 100644 index 000000000000..4d0061e788f9 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/list_automations.php @@ -0,0 +1,82 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $cloudDeployClient->listAutomations($request); + + /** @var Automation $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 = CloudDeployClient::deliveryPipelineName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]' + ); + + list_automations_sample($formattedParent); +} +// [END clouddeploy_v1_generated_CloudDeploy_ListAutomations_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/list_delivery_pipelines.php b/Deploy/samples/V1/CloudDeployClient/list_delivery_pipelines.php index 447dbe52066c..87c54fc5d9cb 100644 --- a/Deploy/samples/V1/CloudDeployClient/list_delivery_pipelines.php +++ b/Deploy/samples/V1/CloudDeployClient/list_delivery_pipelines.php @@ -33,7 +33,7 @@ * Lists DeliveryPipelines in a given project and location. * * @param string $formattedParent The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. Please see + * be `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. */ function list_delivery_pipelines_sample(string $formattedParent): void diff --git a/Deploy/samples/V1/CloudDeployClient/list_targets.php b/Deploy/samples/V1/CloudDeployClient/list_targets.php index 9a60148f6746..1204a1613bdc 100644 --- a/Deploy/samples/V1/CloudDeployClient/list_targets.php +++ b/Deploy/samples/V1/CloudDeployClient/list_targets.php @@ -33,7 +33,7 @@ * Lists Targets in a given project and location. * * @param string $formattedParent The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. Please see + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. */ function list_targets_sample(string $formattedParent): void diff --git a/Deploy/samples/V1/CloudDeployClient/retry_job.php b/Deploy/samples/V1/CloudDeployClient/retry_job.php index 1b7a6dc8cd22..c06c85c51fff 100644 --- a/Deploy/samples/V1/CloudDeployClient/retry_job.php +++ b/Deploy/samples/V1/CloudDeployClient/retry_job.php @@ -32,8 +32,7 @@ * Retries the specified Job in a Rollout. * * @param string $formattedRollout Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId The phase ID the Job to retry belongs to. * @param string $jobId The job ID for the Job to retry. diff --git a/Deploy/samples/V1/CloudDeployClient/rollback_target.php b/Deploy/samples/V1/CloudDeployClient/rollback_target.php new file mode 100644 index 000000000000..e5afdf57cc52 --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/rollback_target.php @@ -0,0 +1,83 @@ +setName($formattedName) + ->setTargetId($targetId) + ->setRolloutId($rolloutId); + + // Call the API and handle any network failures. + try { + /** @var RollbackTargetResponse $response */ + $response = $cloudDeployClient->rollbackTarget($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = CloudDeployClient::deliveryPipelineName( + '[PROJECT]', + '[LOCATION]', + '[DELIVERY_PIPELINE]' + ); + $targetId = '[TARGET_ID]'; + $rolloutId = '[ROLLOUT_ID]'; + + rollback_target_sample($formattedName, $targetId, $rolloutId); +} +// [END clouddeploy_v1_generated_CloudDeploy_RollbackTarget_sync] diff --git a/Deploy/samples/V1/CloudDeployClient/terminate_job_run.php b/Deploy/samples/V1/CloudDeployClient/terminate_job_run.php index 8be2add33f13..4f1bbcf8f8a1 100644 --- a/Deploy/samples/V1/CloudDeployClient/terminate_job_run.php +++ b/Deploy/samples/V1/CloudDeployClient/terminate_job_run.php @@ -32,8 +32,7 @@ * Terminates a Job Run in a given project and location. * * @param string $formattedName Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. Please see * {@see CloudDeployClient::jobRunName()} for help formatting this field. */ function terminate_job_run_sample(string $formattedName): void diff --git a/Deploy/samples/V1/CloudDeployClient/update_automation.php b/Deploy/samples/V1/CloudDeployClient/update_automation.php new file mode 100644 index 000000000000..742c9c3f5a2f --- /dev/null +++ b/Deploy/samples/V1/CloudDeployClient/update_automation.php @@ -0,0 +1,94 @@ +setServiceAccount($automationServiceAccount) + ->setSelector($automationSelector) + ->setRules($automationRules); + $request = (new UpdateAutomationRequest()) + ->setUpdateMask($updateMask) + ->setAutomation($automation); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $cloudDeployClient->updateAutomation($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Automation $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $automationServiceAccount = '[SERVICE_ACCOUNT]'; + + update_automation_sample($automationServiceAccount); +} +// [END clouddeploy_v1_generated_CloudDeploy_UpdateAutomation_sync] diff --git a/Deploy/src/V1/AbandonReleaseRequest.php b/Deploy/src/V1/AbandonReleaseRequest.php index e1f06a8e0f14..06ff87a323c3 100644 --- a/Deploy/src/V1/AbandonReleaseRequest.php +++ b/Deploy/src/V1/AbandonReleaseRequest.php @@ -17,8 +17,7 @@ class AbandonReleaseRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -26,8 +25,7 @@ class AbandonReleaseRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\AbandonReleaseRequest @@ -48,8 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. * } */ public function __construct($data = NULL) { @@ -59,8 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -72,8 +68,7 @@ public function getName() /** * Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/AdvanceChildRolloutJobRun.php b/Deploy/src/V1/AdvanceChildRolloutJobRun.php index 5779d869641d..9f2a7ad1a456 100644 --- a/Deploy/src/V1/AdvanceChildRolloutJobRun.php +++ b/Deploy/src/V1/AdvanceChildRolloutJobRun.php @@ -17,9 +17,8 @@ class AdvanceChildRolloutJobRun extends \Google\Protobuf\Internal\Message { /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -38,9 +37,8 @@ class AdvanceChildRolloutJobRun extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $rollout - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * @type string $rollout_phase_id * Output only. the ID of the ChildRollout's Phase. * } @@ -51,9 +49,8 @@ public function __construct($data = NULL) { } /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -64,9 +61,8 @@ public function getRollout() } /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Deploy/src/V1/AdvanceRolloutOperation.php b/Deploy/src/V1/AdvanceRolloutOperation.php new file mode 100644 index 000000000000..24becc5028e1 --- /dev/null +++ b/Deploy/src/V1/AdvanceRolloutOperation.php @@ -0,0 +1,179 @@ +google.cloud.deploy.v1.AdvanceRolloutOperation + */ +class AdvanceRolloutOperation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The phase of a deployment that initiated the operation. + * + * Generated from protobuf field string source_phase = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $source_phase = ''; + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $wait = null; + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rollout = ''; + /** + * Output only. The phase to which the rollout will be advanced to. + * + * Generated from protobuf field string destination_phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $destination_phase = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_phase + * Output only. The phase of a deployment that initiated the operation. + * @type \Google\Protobuf\Duration $wait + * Output only. How long the operation will be paused. + * @type string $rollout + * Output only. The name of the rollout that initiates the `AutomationRun`. + * @type string $destination_phase + * Output only. The phase to which the rollout will be advanced to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The phase of a deployment that initiated the operation. + * + * Generated from protobuf field string source_phase = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSourcePhase() + { + return $this->source_phase; + } + + /** + * Output only. The phase of a deployment that initiated the operation. + * + * Generated from protobuf field string source_phase = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSourcePhase($var) + { + GPBUtil::checkString($var, True); + $this->source_phase = $var; + + return $this; + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRollout() + { + return $this->rollout; + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkString($var, True); + $this->rollout = $var; + + return $this; + } + + /** + * Output only. The phase to which the rollout will be advanced to. + * + * Generated from protobuf field string destination_phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDestinationPhase() + { + return $this->destination_phase; + } + + /** + * Output only. The phase to which the rollout will be advanced to. + * + * Generated from protobuf field string destination_phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDestinationPhase($var) + { + GPBUtil::checkString($var, True); + $this->destination_phase = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AdvanceRolloutRequest.php b/Deploy/src/V1/AdvanceRolloutRequest.php index 5a5b88966f3d..9631871c44e8 100644 --- a/Deploy/src/V1/AdvanceRolloutRequest.php +++ b/Deploy/src/V1/AdvanceRolloutRequest.php @@ -17,8 +17,7 @@ class AdvanceRolloutRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -32,8 +31,7 @@ class AdvanceRolloutRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId Required. The phase ID to advance the `Rollout` to. * @@ -56,8 +54,7 @@ public static function build(string $name, string $phaseId): self * * @type string $name * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $phase_id * Required. The phase ID to advance the `Rollout` to. * } @@ -69,8 +66,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -82,8 +78,7 @@ public function getName() /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/AdvanceRolloutRule.php b/Deploy/src/V1/AdvanceRolloutRule.php new file mode 100644 index 000000000000..0ac9ab030b72 --- /dev/null +++ b/Deploy/src/V1/AdvanceRolloutRule.php @@ -0,0 +1,210 @@ +google.cloud.deploy.v1.AdvanceRolloutRule + */ +class AdvanceRolloutRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $id = ''; + /** + * Optional. Proceeds only after phase name matched any one in the list. + * This value must consist of lower-case letters, numbers, and hyphens, + * start with a letter and end with a letter or a number, and have a max + * length of 63 characters. In other words, it must match the following + * regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $source_phases; + /** + * Optional. How long to wait after a rollout is finished. + * + * Generated from protobuf field .google.protobuf.Duration wait = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $wait = null; + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_phases + * Optional. Proceeds only after phase name matched any one in the list. + * This value must consist of lower-case letters, numbers, and hyphens, + * start with a letter and end with a letter or a number, and have a max + * length of 63 characters. In other words, it must match the following + * regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * @type \Google\Protobuf\Duration $wait + * Optional. How long to wait after a rollout is finished. + * @type \Google\Cloud\Deploy\V1\AutomationRuleCondition $condition + * Output only. Information around the state of the Automation rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. Proceeds only after phase name matched any one in the list. + * This value must consist of lower-case letters, numbers, and hyphens, + * start with a letter and end with a letter or a number, and have a max + * length of 63 characters. In other words, it must match the following + * regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourcePhases() + { + return $this->source_phases; + } + + /** + * Optional. Proceeds only after phase name matched any one in the list. + * This value must consist of lower-case letters, numbers, and hyphens, + * start with a letter and end with a letter or a number, and have a max + * length of 63 characters. In other words, it must match the following + * regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourcePhases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_phases = $arr; + + return $this; + } + + /** + * Optional. How long to wait after a rollout is finished. + * + * Generated from protobuf field .google.protobuf.Duration wait = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Optional. How long to wait after a rollout is finished. + * + * Generated from protobuf field .google.protobuf.Duration wait = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\AutomationRuleCondition|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\AutomationRuleCondition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationRuleCondition::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ApproveRolloutRequest.php b/Deploy/src/V1/ApproveRolloutRequest.php index 693f1b278317..7758dadfa7c7 100644 --- a/Deploy/src/V1/ApproveRolloutRequest.php +++ b/Deploy/src/V1/ApproveRolloutRequest.php @@ -17,8 +17,7 @@ class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -32,8 +31,7 @@ class ApproveRolloutRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\ApproveRolloutRequest @@ -54,8 +52,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type bool $approved * Required. True = approve; false = reject * } @@ -67,8 +64,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -80,8 +76,7 @@ public function getName() /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/Automation.php b/Deploy/src/V1/Automation.php new file mode 100644 index 000000000000..3702350f6e41 --- /dev/null +++ b/Deploy/src/V1/Automation.php @@ -0,0 +1,596 @@ +google.cloud.deploy.v1.Automation + */ +class Automation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the `Automation`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Output only. Unique identifier of the `Automation`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $uid = ''; + /** + * Optional. Description of the `Automation`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $description = ''; + /** + * Output only. Time at which the automation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Time at which the automation was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $update_time = null; + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Cloud Deploy. Annotations must meet the following + * constraints: + * * Annotations are key/value pairs. + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (`/`). + * * The name segment is required and must be 63 characters or less, + * beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with + * dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. + * * The prefix is optional. If specified, the prefix must be a DNS subdomain: + * a series of DNS labels separated by dots(`.`), not longer than 253 + * characters in total, followed by a slash (`/`). + * See + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set + * for more details. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Cloud Deploy. Labels must meet the following constraints: + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. + * * All characters must use UTF-8 encoding, and international characters are + * allowed. + * * Keys must start with a lowercase letter or international character. + * * Each resource is limited to a maximum of 64 labels. + * Both keys and values are additionally constrained to be <= 63 characters. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The weak etag of the `Automation` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $etag = ''; + /** + * Optional. When Suspended, automation is deactivated from execution. + * + * Generated from protobuf field bool suspended = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $suspended = false; + /** + * Required. Email address of the user-managed IAM service account that + * creates Cloud Deploy release and rollout resources. + * + * Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = REQUIRED]; + */ + private $service_account = ''; + /** + * Required. Selected resources to which the automation will be applied. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationResourceSelector selector = 11 [(.google.api.field_behavior) = REQUIRED]; + */ + private $selector = null; + /** + * Required. List of Automation rules associated with the Automation resource. + * Must have at least one rule and limited to 250 rules per Delivery Pipeline. + * Note: the order of the rules here is not the same as the order of + * execution. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRule rules = 14 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rules; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the `Automation`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`. + * @type string $uid + * Output only. Unique identifier of the `Automation`. + * @type string $description + * Optional. Description of the `Automation`. Max length is 255 characters. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the automation was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time at which the automation was updated. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Cloud Deploy. Annotations must meet the following + * constraints: + * * Annotations are key/value pairs. + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (`/`). + * * The name segment is required and must be 63 characters or less, + * beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with + * dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. + * * The prefix is optional. If specified, the prefix must be a DNS subdomain: + * a series of DNS labels separated by dots(`.`), not longer than 253 + * characters in total, followed by a slash (`/`). + * See + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set + * for more details. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels are attributes that can be set and used by both the + * user and by Cloud Deploy. Labels must meet the following constraints: + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. + * * All characters must use UTF-8 encoding, and international characters are + * allowed. + * * Keys must start with a lowercase letter or international character. + * * Each resource is limited to a maximum of 64 labels. + * Both keys and values are additionally constrained to be <= 63 characters. + * @type string $etag + * Optional. The weak etag of the `Automation` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type bool $suspended + * Optional. When Suspended, automation is deactivated from execution. + * @type string $service_account + * Required. Email address of the user-managed IAM service account that + * creates Cloud Deploy release and rollout resources. + * @type \Google\Cloud\Deploy\V1\AutomationResourceSelector $selector + * Required. Selected resources to which the automation will be applied. + * @type array<\Google\Cloud\Deploy\V1\AutomationRule>|\Google\Protobuf\Internal\RepeatedField $rules + * Required. List of Automation rules associated with the Automation resource. + * Must have at least one rule and limited to 250 rules per Delivery Pipeline. + * Note: the order of the rules here is not the same as the order of + * execution. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the `Automation`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the `Automation`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}`. + * + * 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. Unique identifier of the `Automation`. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Unique identifier of the `Automation`. + * + * 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; + } + + /** + * Optional. Description of the `Automation`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. Description of the `Automation`. Max length is 255 characters. + * + * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Output only. Time at which the automation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Time at which the automation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.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. Time at which the automation was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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. Time at which the automation was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.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; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Cloud Deploy. Annotations must meet the following + * constraints: + * * Annotations are key/value pairs. + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (`/`). + * * The name segment is required and must be 63 characters or less, + * beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with + * dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. + * * The prefix is optional. If specified, the prefix must be a DNS subdomain: + * a series of DNS labels separated by dots(`.`), not longer than 253 + * characters in total, followed by a slash (`/`). + * See + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set + * for more details. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. User annotations. These attributes can only be set and used by + * the user, and not by Cloud Deploy. Annotations must meet the following + * constraints: + * * Annotations are key/value pairs. + * * Valid annotation keys have two segments: an optional prefix and name, + * separated by a slash (`/`). + * * The name segment is required and must be 63 characters or less, + * beginning and ending with an alphanumeric character (`[a-z0-9A-Z]`) with + * dashes (`-`), underscores (`_`), dots (`.`), and alphanumerics between. + * * The prefix is optional. If specified, the prefix must be a DNS subdomain: + * a series of DNS labels separated by dots(`.`), not longer than 253 + * characters in total, followed by a slash (`/`). + * See + * https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set + * for more details. + * + * Generated from protobuf field map annotations = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Cloud Deploy. Labels must meet the following constraints: + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. + * * All characters must use UTF-8 encoding, and international characters are + * allowed. + * * Keys must start with a lowercase letter or international character. + * * Each resource is limited to a maximum of 64 labels. + * Both keys and values are additionally constrained to be <= 63 characters. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels are attributes that can be set and used by both the + * user and by Cloud Deploy. Labels must meet the following constraints: + * * Keys and values can contain only lowercase letters, numeric characters, + * underscores, and dashes. + * * All characters must use UTF-8 encoding, and international characters are + * allowed. + * * Keys must start with a lowercase letter or international character. + * * Each resource is limited to a maximum of 64 labels. + * Both keys and values are additionally constrained to be <= 63 characters. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The weak etag of the `Automation` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The weak etag of the `Automation` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Optional. When Suspended, automation is deactivated from execution. + * + * Generated from protobuf field bool suspended = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSuspended() + { + return $this->suspended; + } + + /** + * Optional. When Suspended, automation is deactivated from execution. + * + * Generated from protobuf field bool suspended = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSuspended($var) + { + GPBUtil::checkBool($var); + $this->suspended = $var; + + return $this; + } + + /** + * Required. Email address of the user-managed IAM service account that + * creates Cloud Deploy release and rollout resources. + * + * Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Required. Email address of the user-managed IAM service account that + * creates Cloud Deploy release and rollout resources. + * + * Generated from protobuf field string service_account = 10 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Required. Selected resources to which the automation will be applied. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationResourceSelector selector = 11 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\AutomationResourceSelector|null + */ + public function getSelector() + { + return $this->selector; + } + + public function hasSelector() + { + return isset($this->selector); + } + + public function clearSelector() + { + unset($this->selector); + } + + /** + * Required. Selected resources to which the automation will be applied. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationResourceSelector selector = 11 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\AutomationResourceSelector $var + * @return $this + */ + public function setSelector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationResourceSelector::class); + $this->selector = $var; + + return $this; + } + + /** + * Required. List of Automation rules associated with the Automation resource. + * Must have at least one rule and limited to 250 rules per Delivery Pipeline. + * Note: the order of the rules here is not the same as the order of + * execution. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRule rules = 14 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRules() + { + return $this->rules; + } + + /** + * Required. List of Automation rules associated with the Automation resource. + * Must have at least one rule and limited to 250 rules per Delivery Pipeline. + * Note: the order of the rules here is not the same as the order of + * execution. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRule rules = 14 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Deploy\V1\AutomationRule>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRules($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\AutomationRule::class); + $this->rules = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AutomationEvent.php b/Deploy/src/V1/AutomationEvent.php new file mode 100644 index 000000000000..78bb08011c48 --- /dev/null +++ b/Deploy/src/V1/AutomationEvent.php @@ -0,0 +1,174 @@ +google.cloud.deploy.v1.AutomationEvent + */ +class AutomationEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + */ + private $message = ''; + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation = 2; + */ + private $automation = ''; + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + */ + private $pipeline_uid = ''; + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 4; + */ + private $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * @type string $automation + * The name of the `AutomationRun`. + * @type string $pipeline_uid + * Unique identifier of the `DeliveryPipeline`. + * @type int $type + * Type of this notification, e.g. for a Pub/Sub failure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\AutomationPayload::initOnce(); + parent::__construct($data); + } + + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation = 2; + * @return string + */ + public function getAutomation() + { + return $this->automation; + } + + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation = 2; + * @param string $var + * @return $this + */ + public function setAutomation($var) + { + GPBUtil::checkString($var, True); + $this->automation = $var; + + return $this; + } + + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + * @return string + */ + public function getPipelineUid() + { + return $this->pipeline_uid; + } + + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + * @param string $var + * @return $this + */ + public function setPipelineUid($var) + { + GPBUtil::checkString($var, True); + $this->pipeline_uid = $var; + + return $this; + } + + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 4; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 4; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AutomationResourceSelector.php b/Deploy/src/V1/AutomationResourceSelector.php new file mode 100644 index 000000000000..dc60ab39a0d9 --- /dev/null +++ b/Deploy/src/V1/AutomationResourceSelector.php @@ -0,0 +1,68 @@ +google.cloud.deploy.v1.AutomationResourceSelector + */ +class AutomationResourceSelector extends \Google\Protobuf\Internal\Message +{ + /** + * Contains attributes about a target. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.TargetAttribute targets = 1; + */ + private $targets; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Deploy\V1\TargetAttribute>|\Google\Protobuf\Internal\RepeatedField $targets + * Contains attributes about a target. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Contains attributes about a target. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.TargetAttribute targets = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTargets() + { + return $this->targets; + } + + /** + * Contains attributes about a target. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.TargetAttribute targets = 1; + * @param array<\Google\Cloud\Deploy\V1\TargetAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTargets($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\TargetAttribute::class); + $this->targets = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AutomationRolloutMetadata.php b/Deploy/src/V1/AutomationRolloutMetadata.php new file mode 100644 index 000000000000..0854ad8aed52 --- /dev/null +++ b/Deploy/src/V1/AutomationRolloutMetadata.php @@ -0,0 +1,148 @@ +google.cloud.deploy.v1.AutomationRolloutMetadata + */ +class AutomationRolloutMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ID of the AutomationRun initiated by a promote release + * rule. + * + * Generated from protobuf field string promote_automation_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $promote_automation_run = ''; + /** + * Output only. The IDs of the AutomationRuns initiated by an advance rollout + * rule. + * + * Generated from protobuf field repeated string advance_automation_runs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $advance_automation_runs; + /** + * Output only. The IDs of the AutomationRuns initiated by a repair rollout + * rule. + * + * Generated from protobuf field repeated string repair_automation_runs = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $repair_automation_runs; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $promote_automation_run + * Output only. The ID of the AutomationRun initiated by a promote release + * rule. + * @type array|\Google\Protobuf\Internal\RepeatedField $advance_automation_runs + * Output only. The IDs of the AutomationRuns initiated by an advance rollout + * rule. + * @type array|\Google\Protobuf\Internal\RepeatedField $repair_automation_runs + * Output only. The IDs of the AutomationRuns initiated by a repair rollout + * rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ID of the AutomationRun initiated by a promote release + * rule. + * + * Generated from protobuf field string promote_automation_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPromoteAutomationRun() + { + return $this->promote_automation_run; + } + + /** + * Output only. The ID of the AutomationRun initiated by a promote release + * rule. + * + * Generated from protobuf field string promote_automation_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPromoteAutomationRun($var) + { + GPBUtil::checkString($var, True); + $this->promote_automation_run = $var; + + return $this; + } + + /** + * Output only. The IDs of the AutomationRuns initiated by an advance rollout + * rule. + * + * Generated from protobuf field repeated string advance_automation_runs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdvanceAutomationRuns() + { + return $this->advance_automation_runs; + } + + /** + * Output only. The IDs of the AutomationRuns initiated by an advance rollout + * rule. + * + * Generated from protobuf field repeated string advance_automation_runs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdvanceAutomationRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->advance_automation_runs = $arr; + + return $this; + } + + /** + * Output only. The IDs of the AutomationRuns initiated by a repair rollout + * rule. + * + * Generated from protobuf field repeated string repair_automation_runs = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRepairAutomationRuns() + { + return $this->repair_automation_runs; + } + + /** + * Output only. The IDs of the AutomationRuns initiated by a repair rollout + * rule. + * + * Generated from protobuf field repeated string repair_automation_runs = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRepairAutomationRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->repair_automation_runs = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AutomationRule.php b/Deploy/src/V1/AutomationRule.php new file mode 100644 index 000000000000..b3a96930a309 --- /dev/null +++ b/Deploy/src/V1/AutomationRule.php @@ -0,0 +1,150 @@ +google.cloud.deploy.v1.AutomationRule + */ +class AutomationRule extends \Google\Protobuf\Internal\Message +{ + protected $rule; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\PromoteReleaseRule $promote_release_rule + * Optional. `PromoteReleaseRule` will automatically promote a release from + * the current target to a specified target. + * @type \Google\Cloud\Deploy\V1\AdvanceRolloutRule $advance_rollout_rule + * Optional. The `AdvanceRolloutRule` will automatically advance a + * successful Rollout. + * @type \Google\Cloud\Deploy\V1\RepairRolloutRule $repair_rollout_rule + * Optional. The `RepairRolloutRule` will automatically repair a failed + * rollout. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. `PromoteReleaseRule` will automatically promote a release from + * the current target to a specified target. + * + * Generated from protobuf field .google.cloud.deploy.v1.PromoteReleaseRule promote_release_rule = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\PromoteReleaseRule|null + */ + public function getPromoteReleaseRule() + { + return $this->readOneof(1); + } + + public function hasPromoteReleaseRule() + { + return $this->hasOneof(1); + } + + /** + * Optional. `PromoteReleaseRule` will automatically promote a release from + * the current target to a specified target. + * + * Generated from protobuf field .google.cloud.deploy.v1.PromoteReleaseRule promote_release_rule = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\PromoteReleaseRule $var + * @return $this + */ + public function setPromoteReleaseRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PromoteReleaseRule::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. The `AdvanceRolloutRule` will automatically advance a + * successful Rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.AdvanceRolloutRule advance_rollout_rule = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\AdvanceRolloutRule|null + */ + public function getAdvanceRolloutRule() + { + return $this->readOneof(2); + } + + public function hasAdvanceRolloutRule() + { + return $this->hasOneof(2); + } + + /** + * Optional. The `AdvanceRolloutRule` will automatically advance a + * successful Rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.AdvanceRolloutRule advance_rollout_rule = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\AdvanceRolloutRule $var + * @return $this + */ + public function setAdvanceRolloutRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AdvanceRolloutRule::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Optional. The `RepairRolloutRule` will automatically repair a failed + * rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairRolloutRule repair_rollout_rule = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\RepairRolloutRule|null + */ + public function getRepairRolloutRule() + { + return $this->readOneof(3); + } + + public function hasRepairRolloutRule() + { + return $this->hasOneof(3); + } + + /** + * Optional. The `RepairRolloutRule` will automatically repair a failed + * rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairRolloutRule repair_rollout_rule = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\RepairRolloutRule $var + * @return $this + */ + public function setRepairRolloutRule($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RepairRolloutRule::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getRule() + { + return $this->whichOneof("rule"); + } + +} + diff --git a/Deploy/src/V1/AutomationRuleCondition.php b/Deploy/src/V1/AutomationRuleCondition.php new file mode 100644 index 000000000000..5a291f07751e --- /dev/null +++ b/Deploy/src/V1/AutomationRuleCondition.php @@ -0,0 +1,78 @@ +google.cloud.deploy.v1.AutomationRuleCondition + */ +class AutomationRuleCondition extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Details around targets enumerated in the rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $targets_present_condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\TargetsPresentCondition $targets_present_condition + * Optional. Details around targets enumerated in the rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Details around targets enumerated in the rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\TargetsPresentCondition|null + */ + public function getTargetsPresentCondition() + { + return $this->targets_present_condition; + } + + public function hasTargetsPresentCondition() + { + return isset($this->targets_present_condition); + } + + public function clearTargetsPresentCondition() + { + unset($this->targets_present_condition); + } + + /** + * Optional. Details around targets enumerated in the rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.TargetsPresentCondition targets_present_condition = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\TargetsPresentCondition $var + * @return $this + */ + public function setTargetsPresentCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\TargetsPresentCondition::class); + $this->targets_present_condition = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/AutomationRun.php b/Deploy/src/V1/AutomationRun.php new file mode 100644 index 000000000000..9f167abebab1 --- /dev/null +++ b/Deploy/src/V1/AutomationRun.php @@ -0,0 +1,679 @@ +google.cloud.deploy.v1.AutomationRun + */ +class AutomationRun extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $name = ''; + /** + * Output only. Time at which the `AutomationRun` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $create_time = null; + /** + * Output only. Time at which the automationRun was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $update_time = null; + /** + * Output only. The weak etag of the `AutomationRun` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $etag = ''; + /** + * Output only. Email address of the user-managed IAM service account that + * performs the operations against Cloud Deploy resources. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_account = ''; + /** + * Output only. Snapshot of the Automation taken at AutomationRun creation + * time. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation_snapshot = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $automation_snapshot = null; + /** + * Output only. The ID of the target that represents the promotion stage that + * initiates the `AutomationRun`. The value of this field is the last segment + * of a target name. + * + * Generated from protobuf field string target_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_id = ''; + /** + * Output only. Current state of the `AutomationRun`. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Output only. Explains the current state of the `AutomationRun`. Present + * only an explanation is needed. + * + * Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state_description = ''; + /** + * Output only. Time the `AutomationRun` will expire. An `AutomationRun` will + * expire after 14 days from its creation date. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $expire_time = null; + /** + * Output only. The ID of the automation rule that initiated the operation. + * + * Generated from protobuf field string rule_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rule_id = ''; + /** + * Output only. The ID of the automation that initiated the operation. + * + * Generated from protobuf field string automation_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $automation_id = ''; + /** + * Output only. Earliest time the `AutomationRun` will attempt to resume. + * Wait-time is configured by `wait` in automation rule. + * + * Generated from protobuf field .google.protobuf.Timestamp wait_until_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $wait_until_time = null; + protected $operation; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Output only. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. Time at which the `AutomationRun` was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. Time at which the automationRun was updated. + * @type string $etag + * Output only. The weak etag of the `AutomationRun` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type string $service_account + * Output only. Email address of the user-managed IAM service account that + * performs the operations against Cloud Deploy resources. + * @type \Google\Cloud\Deploy\V1\Automation $automation_snapshot + * Output only. Snapshot of the Automation taken at AutomationRun creation + * time. + * @type string $target_id + * Output only. The ID of the target that represents the promotion stage that + * initiates the `AutomationRun`. The value of this field is the last segment + * of a target name. + * @type int $state + * Output only. Current state of the `AutomationRun`. + * @type string $state_description + * Output only. Explains the current state of the `AutomationRun`. Present + * only an explanation is needed. + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Time the `AutomationRun` will expire. An `AutomationRun` will + * expire after 14 days from its creation date. + * @type string $rule_id + * Output only. The ID of the automation rule that initiated the operation. + * @type string $automation_id + * Output only. The ID of the automation that initiated the operation. + * @type \Google\Cloud\Deploy\V1\PromoteReleaseOperation $promote_release_operation + * Output only. Promotes a release to a specified 'Target'. + * @type \Google\Cloud\Deploy\V1\AdvanceRolloutOperation $advance_rollout_operation + * Output only. Advances a rollout to the next phase. + * @type \Google\Cloud\Deploy\V1\RepairRolloutOperation $repair_rollout_operation + * Output only. Repairs a failed 'Rollout'. + * @type \Google\Protobuf\Timestamp $wait_until_time + * Output only. Earliest time the `AutomationRun` will attempt to resume. + * Wait-time is configured by `wait` in automation rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * 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. Time at which the `AutomationRun` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Time at which the `AutomationRun` was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.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. Time at which the automationRun was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.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. Time at which the automationRun was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. The weak etag of the `AutomationRun` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. The weak etag of the `AutomationRun` resource. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. Email address of the user-managed IAM service account that + * performs the operations against Cloud Deploy resources. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Output only. Email address of the user-managed IAM service account that + * performs the operations against Cloud Deploy resources. + * + * Generated from protobuf field string service_account = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Output only. Snapshot of the Automation taken at AutomationRun creation + * time. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation_snapshot = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\Automation|null + */ + public function getAutomationSnapshot() + { + return $this->automation_snapshot; + } + + public function hasAutomationSnapshot() + { + return isset($this->automation_snapshot); + } + + public function clearAutomationSnapshot() + { + unset($this->automation_snapshot); + } + + /** + * Output only. Snapshot of the Automation taken at AutomationRun creation + * time. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation_snapshot = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\Automation $var + * @return $this + */ + public function setAutomationSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Automation::class); + $this->automation_snapshot = $var; + + return $this; + } + + /** + * Output only. The ID of the target that represents the promotion stage that + * initiates the `AutomationRun`. The value of this field is the last segment + * of a target name. + * + * Generated from protobuf field string target_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Output only. The ID of the target that represents the promotion stage that + * initiates the `AutomationRun`. The value of this field is the last segment + * of a target name. + * + * Generated from protobuf field string target_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Output only. Current state of the `AutomationRun`. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Current state of the `AutomationRun`. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRun.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\AutomationRun\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Explains the current state of the `AutomationRun`. Present + * only an explanation is needed. + * + * Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStateDescription() + { + return $this->state_description; + } + + /** + * Output only. Explains the current state of the `AutomationRun`. Present + * only an explanation is needed. + * + * Generated from protobuf field string state_description = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStateDescription($var) + { + GPBUtil::checkString($var, True); + $this->state_description = $var; + + return $this; + } + + /** + * Output only. Time the `AutomationRun` will expire. An `AutomationRun` will + * expire after 14 days from its creation date. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Time the `AutomationRun` will expire. An `AutomationRun` will + * expire after 14 days from its creation date. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The ID of the automation rule that initiated the operation. + * + * Generated from protobuf field string rule_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Output only. The ID of the automation rule that initiated the operation. + * + * Generated from protobuf field string rule_id = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * Output only. The ID of the automation that initiated the operation. + * + * Generated from protobuf field string automation_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAutomationId() + { + return $this->automation_id; + } + + /** + * Output only. The ID of the automation that initiated the operation. + * + * Generated from protobuf field string automation_id = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAutomationId($var) + { + GPBUtil::checkString($var, True); + $this->automation_id = $var; + + return $this; + } + + /** + * Output only. Promotes a release to a specified 'Target'. + * + * Generated from protobuf field .google.cloud.deploy.v1.PromoteReleaseOperation promote_release_operation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\PromoteReleaseOperation|null + */ + public function getPromoteReleaseOperation() + { + return $this->readOneof(13); + } + + public function hasPromoteReleaseOperation() + { + return $this->hasOneof(13); + } + + /** + * Output only. Promotes a release to a specified 'Target'. + * + * Generated from protobuf field .google.cloud.deploy.v1.PromoteReleaseOperation promote_release_operation = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\PromoteReleaseOperation $var + * @return $this + */ + public function setPromoteReleaseOperation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\PromoteReleaseOperation::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Output only. Advances a rollout to the next phase. + * + * Generated from protobuf field .google.cloud.deploy.v1.AdvanceRolloutOperation advance_rollout_operation = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\AdvanceRolloutOperation|null + */ + public function getAdvanceRolloutOperation() + { + return $this->readOneof(14); + } + + public function hasAdvanceRolloutOperation() + { + return $this->hasOneof(14); + } + + /** + * Output only. Advances a rollout to the next phase. + * + * Generated from protobuf field .google.cloud.deploy.v1.AdvanceRolloutOperation advance_rollout_operation = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\AdvanceRolloutOperation $var + * @return $this + */ + public function setAdvanceRolloutOperation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AdvanceRolloutOperation::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Output only. Repairs a failed 'Rollout'. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairRolloutOperation repair_rollout_operation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\RepairRolloutOperation|null + */ + public function getRepairRolloutOperation() + { + return $this->readOneof(17); + } + + public function hasRepairRolloutOperation() + { + return $this->hasOneof(17); + } + + /** + * Output only. Repairs a failed 'Rollout'. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairRolloutOperation repair_rollout_operation = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\RepairRolloutOperation $var + * @return $this + */ + public function setRepairRolloutOperation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RepairRolloutOperation::class); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * Output only. Earliest time the `AutomationRun` will attempt to resume. + * Wait-time is configured by `wait` in automation rule. + * + * Generated from protobuf field .google.protobuf.Timestamp wait_until_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getWaitUntilTime() + { + return $this->wait_until_time; + } + + public function hasWaitUntilTime() + { + return isset($this->wait_until_time); + } + + public function clearWaitUntilTime() + { + unset($this->wait_until_time); + } + + /** + * Output only. Earliest time the `AutomationRun` will attempt to resume. + * Wait-time is configured by `wait` in automation rule. + * + * Generated from protobuf field .google.protobuf.Timestamp wait_until_time = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setWaitUntilTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->wait_until_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getOperation() + { + return $this->whichOneof("operation"); + } + +} + diff --git a/Deploy/src/V1/AutomationRun/State.php b/Deploy/src/V1/AutomationRun/State.php new file mode 100644 index 000000000000..eb4b51e86633 --- /dev/null +++ b/Deploy/src/V1/AutomationRun/State.php @@ -0,0 +1,83 @@ +google.cloud.deploy.v1.AutomationRun.State + */ +class State +{ + /** + * The `AutomationRun` has an unspecified state. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The `AutomationRun` has succeeded. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * The `AutomationRun` was cancelled. + * + * Generated from protobuf enum CANCELLED = 2; + */ + const CANCELLED = 2; + /** + * The `AutomationRun` has failed. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + /** + * The `AutomationRun` is in progress. + * + * Generated from protobuf enum IN_PROGRESS = 4; + */ + const IN_PROGRESS = 4; + /** + * The `AutomationRun` is pending. + * + * Generated from protobuf enum PENDING = 5; + */ + const PENDING = 5; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::CANCELLED => 'CANCELLED', + self::FAILED => 'FAILED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::PENDING => 'PENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Deploy/src/V1/AutomationRunEvent.php b/Deploy/src/V1/AutomationRunEvent.php new file mode 100644 index 000000000000..c81ff9cee813 --- /dev/null +++ b/Deploy/src/V1/AutomationRunEvent.php @@ -0,0 +1,276 @@ +google.cloud.deploy.v1.AutomationRunEvent + */ +class AutomationRunEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + */ + private $message = ''; + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation_run = 2; + */ + private $automation_run = ''; + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + */ + private $pipeline_uid = ''; + /** + * Identifier of the `Automation`. + * + * Generated from protobuf field string automation_id = 4; + */ + private $automation_id = ''; + /** + * Identifier of the `Automation` rule. + * + * Generated from protobuf field string rule_id = 5; + */ + private $rule_id = ''; + /** + * ID of the `Target` to which the `AutomationRun` is created. + * + * Generated from protobuf field string destination_target_id = 6; + */ + private $destination_target_id = ''; + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + */ + private $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $message + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * @type string $automation_run + * The name of the `AutomationRun`. + * @type string $pipeline_uid + * Unique identifier of the `DeliveryPipeline`. + * @type string $automation_id + * Identifier of the `Automation`. + * @type string $rule_id + * Identifier of the `Automation` rule. + * @type string $destination_target_id + * ID of the `Target` to which the `AutomationRun` is created. + * @type int $type + * Type of this notification, e.g. for a Pub/Sub failure. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\AutomationrunPayload::initOnce(); + parent::__construct($data); + } + + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Debug message for when there is an update on the AutomationRun. + * Provides further details about the resource creation or state change. + * + * Generated from protobuf field string message = 1; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation_run = 2; + * @return string + */ + public function getAutomationRun() + { + return $this->automation_run; + } + + /** + * The name of the `AutomationRun`. + * + * Generated from protobuf field string automation_run = 2; + * @param string $var + * @return $this + */ + public function setAutomationRun($var) + { + GPBUtil::checkString($var, True); + $this->automation_run = $var; + + return $this; + } + + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + * @return string + */ + public function getPipelineUid() + { + return $this->pipeline_uid; + } + + /** + * Unique identifier of the `DeliveryPipeline`. + * + * Generated from protobuf field string pipeline_uid = 3; + * @param string $var + * @return $this + */ + public function setPipelineUid($var) + { + GPBUtil::checkString($var, True); + $this->pipeline_uid = $var; + + return $this; + } + + /** + * Identifier of the `Automation`. + * + * Generated from protobuf field string automation_id = 4; + * @return string + */ + public function getAutomationId() + { + return $this->automation_id; + } + + /** + * Identifier of the `Automation`. + * + * Generated from protobuf field string automation_id = 4; + * @param string $var + * @return $this + */ + public function setAutomationId($var) + { + GPBUtil::checkString($var, True); + $this->automation_id = $var; + + return $this; + } + + /** + * Identifier of the `Automation` rule. + * + * Generated from protobuf field string rule_id = 5; + * @return string + */ + public function getRuleId() + { + return $this->rule_id; + } + + /** + * Identifier of the `Automation` rule. + * + * Generated from protobuf field string rule_id = 5; + * @param string $var + * @return $this + */ + public function setRuleId($var) + { + GPBUtil::checkString($var, True); + $this->rule_id = $var; + + return $this; + } + + /** + * ID of the `Target` to which the `AutomationRun` is created. + * + * Generated from protobuf field string destination_target_id = 6; + * @return string + */ + public function getDestinationTargetId() + { + return $this->destination_target_id; + } + + /** + * ID of the `Target` to which the `AutomationRun` is created. + * + * Generated from protobuf field string destination_target_id = 6; + * @param string $var + * @return $this + */ + public function setDestinationTargetId($var) + { + GPBUtil::checkString($var, True); + $this->destination_target_id = $var; + + return $this; + } + + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of this notification, e.g. for a Pub/Sub failure. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/BackoffMode.php b/Deploy/src/V1/BackoffMode.php new file mode 100644 index 000000000000..ae0edaeec84e --- /dev/null +++ b/Deploy/src/V1/BackoffMode.php @@ -0,0 +1,61 @@ +google.cloud.deploy.v1.BackoffMode + */ +class BackoffMode +{ + /** + * No WaitMode is specified. + * + * Generated from protobuf enum BACKOFF_MODE_UNSPECIFIED = 0; + */ + const BACKOFF_MODE_UNSPECIFIED = 0; + /** + * Increases the wait time linearly. + * + * Generated from protobuf enum BACKOFF_MODE_LINEAR = 1; + */ + const BACKOFF_MODE_LINEAR = 1; + /** + * Increases the wait time exponentially. + * + * Generated from protobuf enum BACKOFF_MODE_EXPONENTIAL = 2; + */ + const BACKOFF_MODE_EXPONENTIAL = 2; + + private static $valueToName = [ + self::BACKOFF_MODE_UNSPECIFIED => 'BACKOFF_MODE_UNSPECIFIED', + self::BACKOFF_MODE_LINEAR => 'BACKOFF_MODE_LINEAR', + self::BACKOFF_MODE_EXPONENTIAL => 'BACKOFF_MODE_EXPONENTIAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/Deploy/src/V1/CanaryDeployment.php b/Deploy/src/V1/CanaryDeployment.php index 98f1f53db40a..43798d288ba7 100644 --- a/Deploy/src/V1/CanaryDeployment.php +++ b/Deploy/src/V1/CanaryDeployment.php @@ -31,14 +31,14 @@ class CanaryDeployment extends \Google\Protobuf\Internal\Message private $verify = false; /** * Optional. Configuration for the predeploy job of the first phase. If this - * is not configured, predeploy job will not be present. + * is not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 3 [(.google.api.field_behavior) = OPTIONAL]; */ private $predeploy = null; /** * Optional. Configuration for the postdeploy job of the last phase. If this - * is not configured, postdeploy job will not be present. + * is not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 4 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -58,10 +58,10 @@ class CanaryDeployment extends \Google\Protobuf\Internal\Message * Whether to run verify tests after each percentage deployment. * @type \Google\Cloud\Deploy\V1\Predeploy $predeploy * Optional. Configuration for the predeploy job of the first phase. If this - * is not configured, predeploy job will not be present. + * is not configured, there will be no predeploy job for this phase. * @type \Google\Cloud\Deploy\V1\Postdeploy $postdeploy * Optional. Configuration for the postdeploy job of the last phase. If this - * is not configured, postdeploy job will not be present. + * is not configured, there will be no postdeploy job for this phase. * } */ public function __construct($data = NULL) { @@ -127,7 +127,7 @@ public function setVerify($var) /** * Optional. Configuration for the predeploy job of the first phase. If this - * is not configured, predeploy job will not be present. + * is not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Deploy\V1\Predeploy|null @@ -149,7 +149,7 @@ public function clearPredeploy() /** * Optional. Configuration for the predeploy job of the first phase. If this - * is not configured, predeploy job will not be present. + * is not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Deploy\V1\Predeploy $var @@ -165,7 +165,7 @@ public function setPredeploy($var) /** * Optional. Configuration for the postdeploy job of the last phase. If this - * is not configured, postdeploy job will not be present. + * is not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Deploy\V1\Postdeploy|null @@ -187,7 +187,7 @@ public function clearPostdeploy() /** * Optional. Configuration for the postdeploy job of the last phase. If this - * is not configured, postdeploy job will not be present. + * is not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Deploy\V1\Postdeploy $var diff --git a/Deploy/src/V1/CancelAutomationRunRequest.php b/Deploy/src/V1/CancelAutomationRunRequest.php new file mode 100644 index 000000000000..f5f914a02594 --- /dev/null +++ b/Deploy/src/V1/CancelAutomationRunRequest.php @@ -0,0 +1,86 @@ +google.cloud.deploy.v1.CancelAutomationRunRequest + */ +class CancelAutomationRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. Please see + * {@see CloudDeployClient::automationRunName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\CancelAutomationRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * 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/Deploy/src/V1/CancelAutomationRunResponse.php b/Deploy/src/V1/CancelAutomationRunResponse.php new file mode 100644 index 000000000000..c68cf6577c3f --- /dev/null +++ b/Deploy/src/V1/CancelAutomationRunResponse.php @@ -0,0 +1,33 @@ +google.cloud.deploy.v1.CancelAutomationRunResponse + */ +class CancelAutomationRunResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + +} + diff --git a/Deploy/src/V1/CancelRolloutRequest.php b/Deploy/src/V1/CancelRolloutRequest.php index 6a89985c2af0..b8d2ff53ad15 100644 --- a/Deploy/src/V1/CancelRolloutRequest.php +++ b/Deploy/src/V1/CancelRolloutRequest.php @@ -17,8 +17,7 @@ class CancelRolloutRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -26,8 +25,7 @@ class CancelRolloutRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\CancelRolloutRequest @@ -48,8 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * } */ public function __construct($data = NULL) { @@ -59,8 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -72,8 +68,7 @@ public function getName() /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/Client/CloudDeployClient.php b/Deploy/src/V1/Client/CloudDeployClient.php index ce6e1cee3483..67153bf7b05b 100644 --- a/Deploy/src/V1/Client/CloudDeployClient.php +++ b/Deploy/src/V1/Client/CloudDeployClient.php @@ -41,16 +41,24 @@ use Google\Cloud\Deploy\V1\AdvanceRolloutResponse; use Google\Cloud\Deploy\V1\ApproveRolloutRequest; use Google\Cloud\Deploy\V1\ApproveRolloutResponse; +use Google\Cloud\Deploy\V1\Automation; +use Google\Cloud\Deploy\V1\AutomationRun; +use Google\Cloud\Deploy\V1\CancelAutomationRunRequest; +use Google\Cloud\Deploy\V1\CancelAutomationRunResponse; use Google\Cloud\Deploy\V1\CancelRolloutRequest; use Google\Cloud\Deploy\V1\CancelRolloutResponse; use Google\Cloud\Deploy\V1\Config; +use Google\Cloud\Deploy\V1\CreateAutomationRequest; use Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\CreateReleaseRequest; use Google\Cloud\Deploy\V1\CreateRolloutRequest; use Google\Cloud\Deploy\V1\CreateTargetRequest; +use Google\Cloud\Deploy\V1\DeleteAutomationRequest; use Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\DeleteTargetRequest; use Google\Cloud\Deploy\V1\DeliveryPipeline; +use Google\Cloud\Deploy\V1\GetAutomationRequest; +use Google\Cloud\Deploy\V1\GetAutomationRunRequest; use Google\Cloud\Deploy\V1\GetConfigRequest; use Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\GetJobRunRequest; @@ -60,6 +68,8 @@ use Google\Cloud\Deploy\V1\IgnoreJobRequest; use Google\Cloud\Deploy\V1\IgnoreJobResponse; use Google\Cloud\Deploy\V1\JobRun; +use Google\Cloud\Deploy\V1\ListAutomationRunsRequest; +use Google\Cloud\Deploy\V1\ListAutomationsRequest; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest; use Google\Cloud\Deploy\V1\ListJobRunsRequest; use Google\Cloud\Deploy\V1\ListReleasesRequest; @@ -68,10 +78,13 @@ use Google\Cloud\Deploy\V1\Release; use Google\Cloud\Deploy\V1\RetryJobRequest; use Google\Cloud\Deploy\V1\RetryJobResponse; +use Google\Cloud\Deploy\V1\RollbackTargetRequest; +use Google\Cloud\Deploy\V1\RollbackTargetResponse; use Google\Cloud\Deploy\V1\Rollout; use Google\Cloud\Deploy\V1\Target; use Google\Cloud\Deploy\V1\TerminateJobRunRequest; use Google\Cloud\Deploy\V1\TerminateJobRunResponse; +use Google\Cloud\Deploy\V1\UpdateAutomationRequest; use Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\UpdateTargetRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -105,13 +118,18 @@ * @method PromiseInterface abandonReleaseAsync(AbandonReleaseRequest $request, array $optionalArgs = []) * @method PromiseInterface advanceRolloutAsync(AdvanceRolloutRequest $request, array $optionalArgs = []) * @method PromiseInterface approveRolloutAsync(ApproveRolloutRequest $request, array $optionalArgs = []) + * @method PromiseInterface cancelAutomationRunAsync(CancelAutomationRunRequest $request, array $optionalArgs = []) * @method PromiseInterface cancelRolloutAsync(CancelRolloutRequest $request, array $optionalArgs = []) + * @method PromiseInterface createAutomationAsync(CreateAutomationRequest $request, array $optionalArgs = []) * @method PromiseInterface createDeliveryPipelineAsync(CreateDeliveryPipelineRequest $request, array $optionalArgs = []) * @method PromiseInterface createReleaseAsync(CreateReleaseRequest $request, array $optionalArgs = []) * @method PromiseInterface createRolloutAsync(CreateRolloutRequest $request, array $optionalArgs = []) * @method PromiseInterface createTargetAsync(CreateTargetRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteAutomationAsync(DeleteAutomationRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteDeliveryPipelineAsync(DeleteDeliveryPipelineRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteTargetAsync(DeleteTargetRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAutomationAsync(GetAutomationRequest $request, array $optionalArgs = []) + * @method PromiseInterface getAutomationRunAsync(GetAutomationRunRequest $request, array $optionalArgs = []) * @method PromiseInterface getConfigAsync(GetConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface getDeliveryPipelineAsync(GetDeliveryPipelineRequest $request, array $optionalArgs = []) * @method PromiseInterface getJobRunAsync(GetJobRunRequest $request, array $optionalArgs = []) @@ -119,13 +137,17 @@ * @method PromiseInterface getRolloutAsync(GetRolloutRequest $request, array $optionalArgs = []) * @method PromiseInterface getTargetAsync(GetTargetRequest $request, array $optionalArgs = []) * @method PromiseInterface ignoreJobAsync(IgnoreJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAutomationRunsAsync(ListAutomationRunsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listAutomationsAsync(ListAutomationsRequest $request, array $optionalArgs = []) * @method PromiseInterface listDeliveryPipelinesAsync(ListDeliveryPipelinesRequest $request, array $optionalArgs = []) * @method PromiseInterface listJobRunsAsync(ListJobRunsRequest $request, array $optionalArgs = []) * @method PromiseInterface listReleasesAsync(ListReleasesRequest $request, array $optionalArgs = []) * @method PromiseInterface listRolloutsAsync(ListRolloutsRequest $request, array $optionalArgs = []) * @method PromiseInterface listTargetsAsync(ListTargetsRequest $request, array $optionalArgs = []) * @method PromiseInterface retryJobAsync(RetryJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface rollbackTargetAsync(RollbackTargetRequest $request, array $optionalArgs = []) * @method PromiseInterface terminateJobRunAsync(TerminateJobRunRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateAutomationAsync(UpdateAutomationRequest $request, array $optionalArgs = []) * @method PromiseInterface updateDeliveryPipelineAsync(UpdateDeliveryPipelineRequest $request, array $optionalArgs = []) * @method PromiseInterface updateTargetAsync(UpdateTargetRequest $request, array $optionalArgs = []) * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) @@ -206,6 +228,48 @@ public function resumeOperation($operationName, $methodName = null) return $operation; } + /** + * Formats a string containing the fully-qualified path to represent a automation + * resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $automation + * + * @return string The formatted automation resource. + */ + public static function automationName(string $project, string $location, string $deliveryPipeline, string $automation): string + { + return self::getPathTemplate('automation')->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'automation' => $automation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * automation_run resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $automationRun + * + * @return string The formatted automation_run resource. + */ + public static function automationRunName(string $project, string $location, string $deliveryPipeline, string $automationRun): string + { + return self::getPathTemplate('automationRun')->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'automation_run' => $automationRun, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a build * resource. @@ -280,6 +344,25 @@ public static function deliveryPipelineName(string $project, string $location, s ]); } + /** + * Formats a string containing the fully-qualified path to represent a job + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted job resource. + */ + public static function jobName(string $project, string $location, string $job): string + { + return self::getPathTemplate('job')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a job_run * resource. @@ -446,10 +529,13 @@ public static function workerPoolName(string $project, string $location, string * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - automation: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation} + * - automationRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run} * - build: projects/{project}/locations/{location}/builds/{build} * - cluster: projects/{project}/locations/{location}/clusters/{cluster} * - config: projects/{project}/locations/{location}/config * - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline} + * - job: projects/{project}/locations/{location}/jobs/{job} * - jobRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run} * - location: projects/{project}/locations/{location} * - membership: projects/{project}/locations/{location}/memberships/{membership} @@ -627,6 +713,35 @@ public function approveRollout(ApproveRolloutRequest $request, array $callOption return $this->startApiCall('ApproveRollout', $request, $callOptions)->wait(); } + /** + * Cancels an AutomationRun. The `state` of the `AutomationRun` after + * cancelling is `CANCELLED`. `CancelAutomationRun` can be called on + * AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun + * in a different state returns an `FAILED_PRECONDITION` error. + * + * The async variant is {@see CloudDeployClient::cancelAutomationRunAsync()} . + * + * @example samples/V1/CloudDeployClient/cancel_automation_run.php + * + * @param CancelAutomationRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CancelAutomationRunResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelAutomationRun(CancelAutomationRunRequest $request, array $callOptions = []): CancelAutomationRunResponse + { + return $this->startApiCall('CancelAutomationRun', $request, $callOptions)->wait(); + } + /** * Cancels a Rollout in a given project and location. * @@ -653,6 +768,32 @@ public function cancelRollout(CancelRolloutRequest $request, array $callOptions return $this->startApiCall('CancelRollout', $request, $callOptions)->wait(); } + /** + * Creates a new Automation in a given project and location. + * + * The async variant is {@see CloudDeployClient::createAutomationAsync()} . + * + * @example samples/V1/CloudDeployClient/create_automation.php + * + * @param CreateAutomationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createAutomation(CreateAutomationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateAutomation', $request, $callOptions)->wait(); + } + /** * Creates a new DeliveryPipeline in a given project and location. * @@ -757,6 +898,32 @@ public function createTarget(CreateTargetRequest $request, array $callOptions = return $this->startApiCall('CreateTarget', $request, $callOptions)->wait(); } + /** + * Deletes a single Automation resource. + * + * The async variant is {@see CloudDeployClient::deleteAutomationAsync()} . + * + * @example samples/V1/CloudDeployClient/delete_automation.php + * + * @param DeleteAutomationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteAutomation(DeleteAutomationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteAutomation', $request, $callOptions)->wait(); + } + /** * Deletes a single DeliveryPipeline. * @@ -809,6 +976,58 @@ public function deleteTarget(DeleteTargetRequest $request, array $callOptions = return $this->startApiCall('DeleteTarget', $request, $callOptions)->wait(); } + /** + * Gets details of a single Automation. + * + * The async variant is {@see CloudDeployClient::getAutomationAsync()} . + * + * @example samples/V1/CloudDeployClient/get_automation.php + * + * @param GetAutomationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Automation + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAutomation(GetAutomationRequest $request, array $callOptions = []): Automation + { + return $this->startApiCall('GetAutomation', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single AutomationRun. + * + * The async variant is {@see CloudDeployClient::getAutomationRunAsync()} . + * + * @example samples/V1/CloudDeployClient/get_automation_run.php + * + * @param GetAutomationRunRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AutomationRun + * + * @throws ApiException Thrown if the API call fails. + */ + public function getAutomationRun(GetAutomationRunRequest $request, array $callOptions = []): AutomationRun + { + return $this->startApiCall('GetAutomationRun', $request, $callOptions)->wait(); + } + /** * Gets the configuration for a location. * @@ -991,6 +1210,58 @@ public function ignoreJob(IgnoreJobRequest $request, array $callOptions = []): I return $this->startApiCall('IgnoreJob', $request, $callOptions)->wait(); } + /** + * Lists AutomationRuns in a given project and location. + * + * The async variant is {@see CloudDeployClient::listAutomationRunsAsync()} . + * + * @example samples/V1/CloudDeployClient/list_automation_runs.php + * + * @param ListAutomationRunsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAutomationRuns(ListAutomationRunsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAutomationRuns', $request, $callOptions); + } + + /** + * Lists Automations in a given project and location. + * + * The async variant is {@see CloudDeployClient::listAutomationsAsync()} . + * + * @example samples/V1/CloudDeployClient/list_automations.php + * + * @param ListAutomationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listAutomations(ListAutomationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListAutomations', $request, $callOptions); + } + /** * Lists DeliveryPipelines in a given project and location. * @@ -1147,6 +1418,32 @@ public function retryJob(RetryJobRequest $request, array $callOptions = []): Ret return $this->startApiCall('RetryJob', $request, $callOptions)->wait(); } + /** + * Creates a `Rollout` to roll back the specified target. + * + * The async variant is {@see CloudDeployClient::rollbackTargetAsync()} . + * + * @example samples/V1/CloudDeployClient/rollback_target.php + * + * @param RollbackTargetRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RollbackTargetResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rollbackTarget(RollbackTargetRequest $request, array $callOptions = []): RollbackTargetResponse + { + return $this->startApiCall('RollbackTarget', $request, $callOptions)->wait(); + } + /** * Terminates a Job Run in a given project and location. * @@ -1173,6 +1470,32 @@ public function terminateJobRun(TerminateJobRunRequest $request, array $callOpti return $this->startApiCall('TerminateJobRun', $request, $callOptions)->wait(); } + /** + * Updates the parameters of a single Automation resource. + * + * The async variant is {@see CloudDeployClient::updateAutomationAsync()} . + * + * @example samples/V1/CloudDeployClient/update_automation.php + * + * @param UpdateAutomationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateAutomation(UpdateAutomationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateAutomation', $request, $callOptions)->wait(); + } + /** * Updates the parameters of a single DeliveryPipeline. * diff --git a/Deploy/src/V1/CloudRunMetadata.php b/Deploy/src/V1/CloudRunMetadata.php index c4728fbf24cf..a47e5956a683 100644 --- a/Deploy/src/V1/CloudRunMetadata.php +++ b/Deploy/src/V1/CloudRunMetadata.php @@ -18,7 +18,7 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message /** * Output only. The name of the Cloud Run Service that is associated with a * `Rollout`. Format is - * projects/{project}/locations/{location}/services/{service}. + * `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -36,6 +36,14 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field string revision = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $revision = ''; + /** + * Output only. The name of the Cloud Run job that is associated with a + * `Rollout`. Format is + * `projects/{project}/locations/{location}/jobs/{job_name}`. + * + * Generated from protobuf field string job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $job = ''; /** * Constructor. @@ -46,12 +54,16 @@ class CloudRunMetadata extends \Google\Protobuf\Internal\Message * @type string $service * Output only. The name of the Cloud Run Service that is associated with a * `Rollout`. Format is - * projects/{project}/locations/{location}/services/{service}. + * `projects/{project}/locations/{location}/services/{service}`. * @type array|\Google\Protobuf\Internal\RepeatedField $service_urls * Output only. The Cloud Run Service urls that are associated with a * `Rollout`. * @type string $revision * Output only. The Cloud Run Revision id associated with a `Rollout`. + * @type string $job + * Output only. The name of the Cloud Run job that is associated with a + * `Rollout`. Format is + * `projects/{project}/locations/{location}/jobs/{job_name}`. * } */ public function __construct($data = NULL) { @@ -62,7 +74,7 @@ public function __construct($data = NULL) { /** * Output only. The name of the Cloud Run Service that is associated with a * `Rollout`. Format is - * projects/{project}/locations/{location}/services/{service}. + * `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -75,7 +87,7 @@ public function getService() /** * Output only. The name of the Cloud Run Service that is associated with a * `Rollout`. Format is - * projects/{project}/locations/{location}/services/{service}. + * `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var @@ -143,5 +155,35 @@ public function setRevision($var) return $this; } + /** + * Output only. The name of the Cloud Run job that is associated with a + * `Rollout`. Format is + * `projects/{project}/locations/{location}/jobs/{job_name}`. + * + * Generated from protobuf field string job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return string + */ + public function getJob() + { + return $this->job; + } + + /** + * Output only. The name of the Cloud Run job that is associated with a + * `Rollout`. Format is + * `projects/{project}/locations/{location}/jobs/{job_name}`. + * + * Generated from protobuf field string job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setJob($var) + { + GPBUtil::checkString($var, True); + $this->job = $var; + + return $this; + } + } diff --git a/Deploy/src/V1/CloudRunRenderMetadata.php b/Deploy/src/V1/CloudRunRenderMetadata.php index 277cde2a61bf..6471fb97e238 100644 --- a/Deploy/src/V1/CloudRunRenderMetadata.php +++ b/Deploy/src/V1/CloudRunRenderMetadata.php @@ -18,7 +18,7 @@ class CloudRunRenderMetadata extends \Google\Protobuf\Internal\Message { /** * Output only. The name of the Cloud Run Service in the rendered manifest. - * Format is projects/{project}/locations/{location}/services/{service}. + * Format is `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -32,7 +32,7 @@ class CloudRunRenderMetadata extends \Google\Protobuf\Internal\Message * * @type string $service * Output only. The name of the Cloud Run Service in the rendered manifest. - * Format is projects/{project}/locations/{location}/services/{service}. + * Format is `projects/{project}/locations/{location}/services/{service}`. * } */ public function __construct($data = NULL) { @@ -42,7 +42,7 @@ public function __construct($data = NULL) { /** * Output only. The name of the Cloud Run Service in the rendered manifest. - * Format is projects/{project}/locations/{location}/services/{service}. + * Format is `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -54,7 +54,7 @@ public function getService() /** * Output only. The name of the Cloud Run Service in the rendered manifest. - * Format is projects/{project}/locations/{location}/services/{service}. + * Format is `projects/{project}/locations/{location}/services/{service}`. * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/CreateAutomationRequest.php b/Deploy/src/V1/CreateAutomationRequest.php new file mode 100644 index 000000000000..d17a3d6bcde1 --- /dev/null +++ b/Deploy/src/V1/CreateAutomationRequest.php @@ -0,0 +1,285 @@ +google.cloud.deploy.v1.CreateAutomationRequest + */ +class CreateAutomationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * Required. ID of the `Automation`. + * + * Generated from protobuf field string automation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $automation_id = ''; + /** + * Required. The `Automation` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $automation = null; + /** + * Optional. A 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]; + */ + private $request_id = ''; + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * @param string $parent Required. The parent collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see + * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. + * @param \Google\Cloud\Deploy\V1\Automation $automation Required. The `Automation` to create. + * @param string $automationId Required. ID of the `Automation`. + * + * @return \Google\Cloud\Deploy\V1\CreateAutomationRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\Deploy\V1\Automation $automation, string $automationId): self + { + return (new self()) + ->setParent($parent) + ->setAutomation($automation) + ->setAutomationId($automationId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @type string $automation_id + * Required. ID of the `Automation`. + * @type \Google\Cloud\Deploy\V1\Automation $automation + * Required. The `Automation` to create. + * @type string $request_id + * Optional. A 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 bool $validate_only + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * 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 collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. ID of the `Automation`. + * + * Generated from protobuf field string automation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAutomationId() + { + return $this->automation_id; + } + + /** + * Required. ID of the `Automation`. + * + * Generated from protobuf field string automation_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAutomationId($var) + { + GPBUtil::checkString($var, True); + $this->automation_id = $var; + + return $this; + } + + /** + * Required. The `Automation` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Automation|null + */ + public function getAutomation() + { + return $this->automation; + } + + public function hasAutomation() + { + return isset($this->automation); + } + + public function clearAutomation() + { + unset($this->automation); + } + + /** + * Required. The `Automation` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Automation $var + * @return $this + */ + public function setAutomation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Automation::class); + $this->automation = $var; + + return $this; + } + + /** + * Optional. A 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. A 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; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/CreateChildRolloutJobRun.php b/Deploy/src/V1/CreateChildRolloutJobRun.php index 4949e02f7fc9..89484e5f5401 100644 --- a/Deploy/src/V1/CreateChildRolloutJobRun.php +++ b/Deploy/src/V1/CreateChildRolloutJobRun.php @@ -17,9 +17,8 @@ class CreateChildRolloutJobRun extends \Google\Protobuf\Internal\Message { /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -38,9 +37,8 @@ class CreateChildRolloutJobRun extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $rollout - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * @type string $rollout_phase_id * Output only. The ID of the childRollout Phase initiated by this JobRun. * } @@ -51,9 +49,8 @@ public function __construct($data = NULL) { } /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -64,9 +61,8 @@ public function getRollout() } /** - * Output only. Name of the `ChildRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ChildRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var diff --git a/Deploy/src/V1/CreateDeliveryPipelineRequest.php b/Deploy/src/V1/CreateDeliveryPipelineRequest.php index 7b1e1802f075..c2423f6b4eec 100644 --- a/Deploy/src/V1/CreateDeliveryPipelineRequest.php +++ b/Deploy/src/V1/CreateDeliveryPipelineRequest.php @@ -17,7 +17,8 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message { /** * Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -60,7 +61,8 @@ class CreateDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. Please see + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * @param \Google\Cloud\Deploy\V1\DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to create. * @param string $deliveryPipelineId Required. ID of the `DeliveryPipeline`. @@ -85,7 +87,8 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\DeliveryPip * * @type string $parent * Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. * @type string $delivery_pipeline_id * Required. ID of the `DeliveryPipeline`. * @type \Google\Cloud\Deploy\V1\DeliveryPipeline $delivery_pipeline @@ -114,7 +117,8 @@ public function __construct($data = NULL) { /** * Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -126,7 +130,8 @@ public function getParent() /** * Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/CreateReleaseRequest.php b/Deploy/src/V1/CreateReleaseRequest.php index dc22d99105cd..8ce93cb40ac9 100644 --- a/Deploy/src/V1/CreateReleaseRequest.php +++ b/Deploy/src/V1/CreateReleaseRequest.php @@ -18,7 +18,7 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message /** * Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -62,7 +62,7 @@ class CreateReleaseRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. * @param \Google\Cloud\Deploy\V1\Release $release Required. The `Release` to create. * @param string $releaseId Required. ID of the `Release`. @@ -88,7 +88,7 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\Release $re * @type string $parent * Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * @type string $release_id * Required. ID of the `Release`. * @type \Google\Cloud\Deploy\V1\Release $release @@ -118,7 +118,7 @@ public function __construct($data = NULL) { /** * Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -131,7 +131,7 @@ public function getParent() /** * Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/CreateRolloutRequest.php b/Deploy/src/V1/CreateRolloutRequest.php index 35df462ff684..158c0f6ed40c 100644 --- a/Deploy/src/V1/CreateRolloutRequest.php +++ b/Deploy/src/V1/CreateRolloutRequest.php @@ -18,7 +18,7 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message /** * Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -69,7 +69,7 @@ class CreateRolloutRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. * @param \Google\Cloud\Deploy\V1\Rollout $rollout Required. The `Rollout` to create. * @param string $rolloutId Required. ID of the `Rollout`. @@ -95,7 +95,7 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\Rollout $ro * @type string $parent * Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * @type string $rollout_id * Required. ID of the `Rollout`. * @type \Google\Cloud\Deploy\V1\Rollout $rollout @@ -128,7 +128,7 @@ public function __construct($data = NULL) { /** * Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -141,7 +141,7 @@ public function getParent() /** * Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/CreateTargetRequest.php b/Deploy/src/V1/CreateTargetRequest.php index 86da967d90a6..2a69f6f10a90 100644 --- a/Deploy/src/V1/CreateTargetRequest.php +++ b/Deploy/src/V1/CreateTargetRequest.php @@ -18,7 +18,7 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message /** * Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -62,7 +62,7 @@ class CreateTargetRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. Please see + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * @param \Google\Cloud\Deploy\V1\Target $target Required. The `Target` to create. * @param string $targetId Required. ID of the `Target`. @@ -88,7 +88,7 @@ public static function build(string $parent, \Google\Cloud\Deploy\V1\Target $tar * @type string $parent * Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * @type string $target_id * Required. ID of the `Target`. * @type \Google\Cloud\Deploy\V1\Target $target @@ -118,7 +118,7 @@ public function __construct($data = NULL) { /** * Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -131,7 +131,7 @@ public function getParent() /** * Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php index b6e7cc147719..e656b77ceb69 100644 --- a/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php +++ b/Deploy/src/V1/CustomCanaryDeployment/PhaseConfig.php @@ -48,14 +48,14 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message private $verify = false; /** * Optional. Configuration for the predeploy job of this phase. If this is - * not configured, predeploy job will not be present for this phase. + * not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 5 [(.google.api.field_behavior) = OPTIONAL]; */ private $predeploy = null; /** * Optional. Configuration for the postdeploy job of this phase. If this is - * not configured, postdeploy job will not be present for this phase. + * not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 6 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -83,10 +83,10 @@ class PhaseConfig extends \Google\Protobuf\Internal\Message * Whether to run verify tests after the deployment. * @type \Google\Cloud\Deploy\V1\Predeploy $predeploy * Optional. Configuration for the predeploy job of this phase. If this is - * not configured, predeploy job will not be present for this phase. + * not configured, there will be no predeploy job for this phase. * @type \Google\Cloud\Deploy\V1\Postdeploy $postdeploy * Optional. Configuration for the postdeploy job of this phase. If this is - * not configured, postdeploy job will not be present for this phase. + * not configured, there will be no postdeploy job for this phase. * } */ public function __construct($data = NULL) { @@ -212,7 +212,7 @@ public function setVerify($var) /** * Optional. Configuration for the predeploy job of this phase. If this is - * not configured, predeploy job will not be present for this phase. + * not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 5 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Deploy\V1\Predeploy|null @@ -234,7 +234,7 @@ public function clearPredeploy() /** * Optional. Configuration for the predeploy job of this phase. If this is - * not configured, predeploy job will not be present for this phase. + * not configured, there will be no predeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Predeploy predeploy = 5 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Deploy\V1\Predeploy $var @@ -250,7 +250,7 @@ public function setPredeploy($var) /** * Optional. Configuration for the postdeploy job of this phase. If this is - * not configured, postdeploy job will not be present for this phase. + * not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return \Google\Cloud\Deploy\V1\Postdeploy|null @@ -272,7 +272,7 @@ public function clearPostdeploy() /** * Optional. Configuration for the postdeploy job of this phase. If this is - * not configured, postdeploy job will not be present for this phase. + * not configured, there will be no postdeploy job for this phase. * * Generated from protobuf field .google.cloud.deploy.v1.Postdeploy postdeploy = 6 [(.google.api.field_behavior) = OPTIONAL]; * @param \Google\Cloud\Deploy\V1\Postdeploy $var diff --git a/Deploy/src/V1/DeleteAutomationRequest.php b/Deploy/src/V1/DeleteAutomationRequest.php new file mode 100644 index 000000000000..131236ba3549 --- /dev/null +++ b/Deploy/src/V1/DeleteAutomationRequest.php @@ -0,0 +1,282 @@ +google.cloud.deploy.v1.DeleteAutomationRequest + */ +class DeleteAutomationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Optional. A 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 = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `Automation` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + /** + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $etag = ''; + + /** + * @param string $name Required. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. Please see + * {@see CloudDeployClient::automationName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\DeleteAutomationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * @type string $request_id + * Optional. A 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 bool $allow_missing + * Optional. If set to true, then deleting an already deleted or non-existing + * `Automation` will succeed. + * @type bool $validate_only + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. + * @type string $etag + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_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. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_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; + } + + /** + * Optional. A 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 = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A 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 = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `Automation` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, then deleting an already deleted or non-existing + * `Automation` will succeed. + * + * Generated from protobuf field bool allow_missing = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php index 37a8d3ddca88..025b60fda870 100644 --- a/Deploy/src/V1/DeleteDeliveryPipelineRequest.php +++ b/Deploy/src/V1/DeleteDeliveryPipelineRequest.php @@ -17,7 +17,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message { /** * Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -71,7 +71,7 @@ class DeleteDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest @@ -92,7 +92,7 @@ public static function build(string $name): self * * @type string $name * Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * @type string $request_id * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -128,7 +128,7 @@ public function __construct($data = NULL) { /** * Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -140,7 +140,7 @@ public function getName() /** * Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/DeleteTargetRequest.php b/Deploy/src/V1/DeleteTargetRequest.php index a455cef9d29e..d36f98128a06 100644 --- a/Deploy/src/V1/DeleteTargetRequest.php +++ b/Deploy/src/V1/DeleteTargetRequest.php @@ -17,7 +17,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message { /** * Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -63,7 +63,7 @@ class DeleteTargetRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. Please see + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. Please see * {@see CloudDeployClient::targetName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\DeleteTargetRequest @@ -84,7 +84,7 @@ public static function build(string $name): self * * @type string $name * Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * @type string $request_id * Optional. A request ID to identify requests. Specify a unique request ID * so that if you must retry your request, the server will know to ignore @@ -116,7 +116,7 @@ public function __construct($data = NULL) { /** * Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -128,7 +128,7 @@ public function getName() /** * Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/DeliveryPipeline.php b/Deploy/src/V1/DeliveryPipeline.php index 3ddedd8ec8a7..6fdcabce6375 100644 --- a/Deploy/src/V1/DeliveryPipeline.php +++ b/Deploy/src/V1/DeliveryPipeline.php @@ -18,8 +18,8 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message { /** - * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `DeliveryPipeline`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -99,8 +99,8 @@ class DeliveryPipeline extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `DeliveryPipeline`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. * @type string $uid * Output only. Unique identifier of the `DeliveryPipeline`. * @type string $description @@ -142,8 +142,8 @@ public function __construct($data = NULL) { } /** - * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `DeliveryPipeline`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -154,8 +154,8 @@ public function getName() } /** - * Optional. Name of the `DeliveryPipeline`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `DeliveryPipeline`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/DeployJobRun.php b/Deploy/src/V1/DeployJobRun.php index 3f3b489fddea..c309be058cc1 100644 --- a/Deploy/src/V1/DeployJobRun.php +++ b/Deploy/src/V1/DeployJobRun.php @@ -18,7 +18,7 @@ class DeployJobRun extends \Google\Protobuf\Internal\Message /** * Output only. The resource name of the Cloud Build `Build` object that is * used to deploy. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -58,7 +58,7 @@ class DeployJobRun extends \Google\Protobuf\Internal\Message * @type string $build * Output only. The resource name of the Cloud Build `Build` object that is * used to deploy. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * @type int $failure_cause * Output only. The reason the deploy failed. This will always be unspecified * while the deploy is in progress or if it succeeded. @@ -78,7 +78,7 @@ public function __construct($data = NULL) { /** * Output only. The resource name of the Cloud Build `Build` object that is * used to deploy. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -91,7 +91,7 @@ public function getBuild() /** * Output only. The resource name of the Cloud Build `Build` object that is * used to deploy. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/DeployJobRun/FailureCause.php b/Deploy/src/V1/DeployJobRun/FailureCause.php index 59c690200bcd..619d0fd92c3d 100644 --- a/Deploy/src/V1/DeployJobRun/FailureCause.php +++ b/Deploy/src/V1/DeployJobRun/FailureCause.php @@ -35,7 +35,7 @@ class FailureCause */ const EXECUTION_FAILED = 2; /** - * The deploy build did not complete within the alloted time. + * The deploy job run did not complete within the alloted time. * * Generated from protobuf enum DEADLINE_EXCEEDED = 3; */ diff --git a/Deploy/src/V1/DeploymentJobs.php b/Deploy/src/V1/DeploymentJobs.php index 7ff52e0e1d6c..561b42520eed 100644 --- a/Deploy/src/V1/DeploymentJobs.php +++ b/Deploy/src/V1/DeploymentJobs.php @@ -28,15 +28,13 @@ class DeploymentJobs extends \Google\Protobuf\Internal\Message */ private $verify_job = null; /** - * Output only. The predeploy Job. This is the predeploy job in the phase. - * This is the first job of the phase. + * Output only. The predeploy Job, which is the first job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job predeploy_job = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $predeploy_job = null; /** - * Output only. The postdeploy Job. This is the postdeploy job in the phase. - * This is the last job of the phase. + * Output only. The postdeploy Job, which is the last job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -53,11 +51,9 @@ class DeploymentJobs extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Deploy\V1\Job $verify_job * Output only. The verify Job. Runs after a deploy if the deploy succeeds. * @type \Google\Cloud\Deploy\V1\Job $predeploy_job - * Output only. The predeploy Job. This is the predeploy job in the phase. - * This is the first job of the phase. + * Output only. The predeploy Job, which is the first job on the phase. * @type \Google\Cloud\Deploy\V1\Job $postdeploy_job - * Output only. The postdeploy Job. This is the postdeploy job in the phase. - * This is the last job of the phase. + * Output only. The postdeploy Job, which is the last job on the phase. * } */ public function __construct($data = NULL) { @@ -138,8 +134,7 @@ public function setVerifyJob($var) } /** - * Output only. The predeploy Job. This is the predeploy job in the phase. - * This is the first job of the phase. + * Output only. The predeploy Job, which is the first job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job predeploy_job = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\Deploy\V1\Job|null @@ -160,8 +155,7 @@ public function clearPredeployJob() } /** - * Output only. The predeploy Job. This is the predeploy job in the phase. - * This is the first job of the phase. + * Output only. The predeploy Job, which is the first job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job predeploy_job = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\Deploy\V1\Job $var @@ -176,8 +170,7 @@ public function setPredeployJob($var) } /** - * Output only. The postdeploy Job. This is the postdeploy job in the phase. - * This is the last job of the phase. + * Output only. The postdeploy Job, which is the last job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\Deploy\V1\Job|null @@ -198,8 +191,7 @@ public function clearPostdeployJob() } /** - * Output only. The postdeploy Job. This is the postdeploy job in the phase. - * This is the last job of the phase. + * Output only. The postdeploy Job, which is the last job on the phase. * * Generated from protobuf field .google.cloud.deploy.v1.Job postdeploy_job = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\Deploy\V1\Job $var diff --git a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php index 8020376d518c..0c9aec4795a4 100644 --- a/Deploy/src/V1/Gapic/CloudDeployGapicClient.php +++ b/Deploy/src/V1/Gapic/CloudDeployGapicClient.php @@ -42,16 +42,24 @@ use Google\Cloud\Deploy\V1\AdvanceRolloutResponse; use Google\Cloud\Deploy\V1\ApproveRolloutRequest; use Google\Cloud\Deploy\V1\ApproveRolloutResponse; +use Google\Cloud\Deploy\V1\Automation; +use Google\Cloud\Deploy\V1\AutomationRun; +use Google\Cloud\Deploy\V1\CancelAutomationRunRequest; +use Google\Cloud\Deploy\V1\CancelAutomationRunResponse; use Google\Cloud\Deploy\V1\CancelRolloutRequest; use Google\Cloud\Deploy\V1\CancelRolloutResponse; use Google\Cloud\Deploy\V1\Config; +use Google\Cloud\Deploy\V1\CreateAutomationRequest; use Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\CreateReleaseRequest; use Google\Cloud\Deploy\V1\CreateRolloutRequest; use Google\Cloud\Deploy\V1\CreateTargetRequest; +use Google\Cloud\Deploy\V1\DeleteAutomationRequest; use Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\DeleteTargetRequest; use Google\Cloud\Deploy\V1\DeliveryPipeline; +use Google\Cloud\Deploy\V1\GetAutomationRequest; +use Google\Cloud\Deploy\V1\GetAutomationRunRequest; use Google\Cloud\Deploy\V1\GetConfigRequest; use Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\GetJobRunRequest; @@ -61,6 +69,10 @@ use Google\Cloud\Deploy\V1\IgnoreJobRequest; use Google\Cloud\Deploy\V1\IgnoreJobResponse; use Google\Cloud\Deploy\V1\JobRun; +use Google\Cloud\Deploy\V1\ListAutomationRunsRequest; +use Google\Cloud\Deploy\V1\ListAutomationRunsResponse; +use Google\Cloud\Deploy\V1\ListAutomationsRequest; +use Google\Cloud\Deploy\V1\ListAutomationsResponse; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse; use Google\Cloud\Deploy\V1\ListJobRunsRequest; @@ -74,10 +86,14 @@ use Google\Cloud\Deploy\V1\Release; use Google\Cloud\Deploy\V1\RetryJobRequest; use Google\Cloud\Deploy\V1\RetryJobResponse; +use Google\Cloud\Deploy\V1\RollbackTargetConfig; +use Google\Cloud\Deploy\V1\RollbackTargetRequest; +use Google\Cloud\Deploy\V1\RollbackTargetResponse; use Google\Cloud\Deploy\V1\Rollout; use Google\Cloud\Deploy\V1\Target; use Google\Cloud\Deploy\V1\TerminateJobRunRequest; use Google\Cloud\Deploy\V1\TerminateJobRunResponse; +use Google\Cloud\Deploy\V1\UpdateAutomationRequest; use Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\UpdateTargetRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -139,6 +155,10 @@ class CloudDeployGapicClient 'https://www.googleapis.com/auth/cloud-platform', ]; + private static $automationNameTemplate; + + private static $automationRunNameTemplate; + private static $buildNameTemplate; private static $clusterNameTemplate; @@ -147,6 +167,8 @@ class CloudDeployGapicClient private static $deliveryPipelineNameTemplate; + private static $jobNameTemplate; + private static $jobRunNameTemplate; private static $locationNameTemplate; @@ -192,6 +214,28 @@ private static function getClientDefaults() ]; } + private static function getAutomationNameTemplate() + { + if (self::$automationNameTemplate == null) { + self::$automationNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}' + ); + } + + return self::$automationNameTemplate; + } + + private static function getAutomationRunNameTemplate() + { + if (self::$automationRunNameTemplate == null) { + self::$automationRunNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}' + ); + } + + return self::$automationRunNameTemplate; + } + private static function getBuildNameTemplate() { if (self::$buildNameTemplate == null) { @@ -236,6 +280,17 @@ private static function getDeliveryPipelineNameTemplate() return self::$deliveryPipelineNameTemplate; } + private static function getJobNameTemplate() + { + if (self::$jobNameTemplate == null) { + self::$jobNameTemplate = new PathTemplate( + 'projects/{project}/locations/{location}/jobs/{job}' + ); + } + + return self::$jobNameTemplate; + } + private static function getJobRunNameTemplate() { if (self::$jobRunNameTemplate == null) { @@ -328,10 +383,13 @@ private static function getPathTemplateMap() { if (self::$pathTemplateMap == null) { self::$pathTemplateMap = [ + 'automation' => self::getAutomationNameTemplate(), + 'automationRun' => self::getAutomationRunNameTemplate(), 'build' => self::getBuildNameTemplate(), 'cluster' => self::getClusterNameTemplate(), 'config' => self::getConfigNameTemplate(), 'deliveryPipeline' => self::getDeliveryPipelineNameTemplate(), + 'job' => self::getJobNameTemplate(), 'jobRun' => self::getJobRunNameTemplate(), 'location' => self::getLocationNameTemplate(), 'membership' => self::getMembershipNameTemplate(), @@ -346,6 +404,56 @@ private static function getPathTemplateMap() return self::$pathTemplateMap; } + /** + * Formats a string containing the fully-qualified path to represent a automation + * resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $automation + * + * @return string The formatted automation resource. + */ + public static function automationName( + $project, + $location, + $deliveryPipeline, + $automation + ) { + return self::getAutomationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'automation' => $automation, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * automation_run resource. + * + * @param string $project + * @param string $location + * @param string $deliveryPipeline + * @param string $automationRun + * + * @return string The formatted automation_run resource. + */ + public static function automationRunName( + $project, + $location, + $deliveryPipeline, + $automationRun + ) { + return self::getAutomationRunNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'delivery_pipeline' => $deliveryPipeline, + 'automation_run' => $automationRun, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a build * resource. @@ -423,6 +531,25 @@ public static function deliveryPipelineName( ]); } + /** + * 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 job_run * resource. @@ -604,10 +731,13 @@ public static function workerPoolName($project, $location, $workerPool) * Parses a formatted name string and returns an associative array of the components in the name. * The following name formats are supported: * Template: Pattern + * - automation: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation} + * - automationRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run} * - build: projects/{project}/locations/{location}/builds/{build} * - cluster: projects/{project}/locations/{location}/clusters/{cluster} * - config: projects/{project}/locations/{location}/config * - deliveryPipeline: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline} + * - job: projects/{project}/locations/{location}/jobs/{job} * - jobRun: projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run} * - location: projects/{project}/locations/{location} * - membership: projects/{project}/locations/{location}/memberships/{membership} @@ -767,8 +897,7 @@ public function __construct(array $options = []) * ``` * * @param string $name Required. Name of the Release. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. * @param array $optionalArgs { * Optional. * @@ -818,8 +947,7 @@ public function abandonRelease($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param string $phaseId Required. The phase ID to advance the `Rollout` to. * @param array $optionalArgs { * Optional. @@ -871,8 +999,7 @@ public function advanceRollout($name, $phaseId, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param bool $approved Required. True = approve; false = reject * @param array $optionalArgs { * Optional. @@ -908,6 +1035,58 @@ public function approveRollout($name, $approved, array $optionalArgs = []) )->wait(); } + /** + * Cancels an AutomationRun. The `state` of the `AutomationRun` after + * cancelling is `CANCELLED`. `CancelAutomationRun` can be called on + * AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun + * in a different state returns an `FAILED_PRECONDITION` error. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + * $response = $cloudDeployClient->cancelAutomationRun($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `AutomationRun`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * @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\Deploy\V1\CancelAutomationRunResponse + * + * @throws ApiException if the remote call fails + */ + public function cancelAutomationRun($name, array $optionalArgs = []) + { + $request = new CancelAutomationRunRequest(); + $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( + 'CancelAutomationRun', + CancelAutomationRunResponse::class, + $optionalArgs, + $request + )->wait(); + } + /** * Cancels a Rollout in a given project and location. * @@ -923,8 +1102,7 @@ public function approveRollout($name, $approved, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param array $optionalArgs { * Optional. * @@ -958,6 +1136,116 @@ public function cancelRollout($name, array $optionalArgs = []) )->wait(); } + /** + * Creates a new Automation in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $automationId = 'automation_id'; + * $automation = new Automation(); + * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->createAutomation($formattedParent, $automationId, $automation); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'createAutomation'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which the `Automation` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @param string $automationId Required. ID of the `Automation`. + * @param Automation $automation Required. The `Automation` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A 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 bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * @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 createAutomation( + $parent, + $automationId, + $automation, + array $optionalArgs = [] + ) { + $request = new CreateAutomationRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setAutomationId($automationId); + $request->setAutomation($automation); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'CreateAutomation', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Creates a new DeliveryPipeline in a given project and location. * @@ -1000,7 +1288,8 @@ public function cancelRollout($name, array $optionalArgs = []) * ``` * * @param string $parent Required. The parent collection in which the `DeliveryPipeline` should be - * created. Format should be projects/{project_id}/locations/{location_name}. + * created. Format should be + * `projects/{project_id}/locations/{location_name}`. * @param string $deliveryPipelineId Required. ID of the `DeliveryPipeline`. * @param DeliveryPipeline $deliveryPipeline Required. The `DeliveryPipeline` to create. * @param array $optionalArgs { @@ -1110,7 +1399,7 @@ public function createDeliveryPipeline( * * @param string $parent Required. The parent collection in which the `Release` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * @param string $releaseId Required. ID of the `Release`. * @param Release $release Required. The `Release` to create. * @param array $optionalArgs { @@ -1220,7 +1509,7 @@ public function createRelease( * * @param string $parent Required. The parent collection in which the `Rollout` should be created. * Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * @param string $rolloutId Required. ID of the `Rollout`. * @param Rollout $rollout Required. The `Rollout` to create. * @param array $optionalArgs { @@ -1337,7 +1626,7 @@ public function createRollout( * * @param string $parent Required. The parent collection in which the `Target` should be created. * Format should be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * @param string $targetId Required. ID of the `Target`. * @param Target $target Required. The `Target` to create. * @param array $optionalArgs { @@ -1405,14 +1694,14 @@ public function createTarget( } /** - * Deletes a single DeliveryPipeline. + * Deletes a single Automation resource. * * Sample code: * ``` * $cloudDeployClient = new CloudDeployClient(); * try { - * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); + * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { * // operation succeeded and returns no value @@ -1422,10 +1711,10 @@ public function createTarget( * } * // Alternatively: * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); + * $operationResponse = $cloudDeployClient->deleteAutomation($formattedName); * $operationName = $operationResponse->getName(); * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteDeliveryPipeline'); + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteAutomation'); * while (!$newOperationResponse->isDone()) { * // ... do other work * $newOperationResponse->reload(); @@ -1441,8 +1730,8 @@ public function createTarget( * } * ``` * - * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * @param string $name Required. The name of the `Automation` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. * @param array $optionalArgs { * Optional. * @@ -1462,17 +1751,14 @@ public function createTarget( * not supported (00000000-0000-0000-0000-000000000000). * @type bool $allowMissing * Optional. If set to true, then deleting an already deleted or non-existing - * `DeliveryPipeline` will succeed. + * `Automation` will succeed. * @type bool $validateOnly - * Optional. If set, validate the request and preview the review, but do not - * actually post it. - * @type bool $force - * Optional. If set to true, all child resources under this pipeline will also - * be deleted. Otherwise, the request will only work if the pipeline has no - * child resources. + * Optional. If set, validate the request and verify whether the resource + * exists, but do not actually post it. * @type string $etag - * Optional. This checksum is computed by the server based on the value of - * other fields, and may be sent on update and delete requests to ensure the + * Optional. The weak etag of the request. + * This checksum is computed by the server based on the value of other + * fields, and may be sent on update and delete requests to ensure the * client has an up-to-date value before proceeding. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an @@ -1484,9 +1770,9 @@ public function createTarget( * * @throws ApiException if the remote call fails */ - public function deleteDeliveryPipeline($name, array $optionalArgs = []) + public function deleteAutomation($name, array $optionalArgs = []) { - $request = new DeleteDeliveryPipelineRequest(); + $request = new DeleteAutomationRequest(); $requestParamHeaders = []; $request->setName($name); $requestParamHeaders['name'] = $name; @@ -1502,10 +1788,6 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) $request->setValidateOnly($optionalArgs['validateOnly']); } - if (isset($optionalArgs['force'])) { - $request->setForce($optionalArgs['force']); - } - if (isset($optionalArgs['etag'])) { $request->setEtag($optionalArgs['etag']); } @@ -1517,7 +1799,7 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startOperationsCall( - 'DeleteDeliveryPipeline', + 'DeleteAutomation', $optionalArgs, $request, $this->getOperationsClient() @@ -1525,14 +1807,14 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) } /** - * Deletes a single Target. + * Deletes a single DeliveryPipeline. * * Sample code: * ``` * $cloudDeployClient = new CloudDeployClient(); * try { - * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); + * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); * $operationResponse->pollUntilComplete(); * if ($operationResponse->operationSucceeded()) { * // operation succeeded and returns no value @@ -1542,10 +1824,10 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) * } * // Alternatively: * // start the operation, keep the operation name, and resume later - * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); + * $operationResponse = $cloudDeployClient->deleteDeliveryPipeline($formattedName); * $operationName = $operationResponse->getName(); * // ... do other work - * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteTarget'); + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteDeliveryPipeline'); * while (!$newOperationResponse->isDone()) { * // ... do other work * $newOperationResponse->reload(); @@ -1561,8 +1843,8 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) * } * ``` * - * @param string $name Required. The name of the `Target` to delete. Format should be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * @param string $name Required. The name of the `DeliveryPipeline` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * @param array $optionalArgs { * Optional. * @@ -1582,10 +1864,14 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) * not supported (00000000-0000-0000-0000-000000000000). * @type bool $allowMissing * Optional. If set to true, then deleting an already deleted or non-existing - * `Target` will succeed. + * `DeliveryPipeline` will succeed. * @type bool $validateOnly * Optional. If set, validate the request and preview the review, but do not * actually post it. + * @type bool $force + * Optional. If set to true, all child resources under this pipeline will also + * be deleted. Otherwise, the request will only work if the pipeline has no + * child resources. * @type string $etag * Optional. This checksum is computed by the server based on the value of * other fields, and may be sent on update and delete requests to ensure the @@ -1600,9 +1886,9 @@ public function deleteDeliveryPipeline($name, array $optionalArgs = []) * * @throws ApiException if the remote call fails */ - public function deleteTarget($name, array $optionalArgs = []) + public function deleteDeliveryPipeline($name, array $optionalArgs = []) { - $request = new DeleteTargetRequest(); + $request = new DeleteDeliveryPipelineRequest(); $requestParamHeaders = []; $request->setName($name); $requestParamHeaders['name'] = $name; @@ -1618,6 +1904,10 @@ public function deleteTarget($name, array $optionalArgs = []) $request->setValidateOnly($optionalArgs['validateOnly']); } + if (isset($optionalArgs['force'])) { + $request->setForce($optionalArgs['force']); + } + if (isset($optionalArgs['etag'])) { $request->setEtag($optionalArgs['etag']); } @@ -1629,7 +1919,7 @@ public function deleteTarget($name, array $optionalArgs = []) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); return $this->startOperationsCall( - 'DeleteTarget', + 'DeleteDeliveryPipeline', $optionalArgs, $request, $this->getOperationsClient() @@ -1637,16 +1927,226 @@ public function deleteTarget($name, array $optionalArgs = []) } /** - * Gets the configuration for a location. + * Deletes a single Target. * * Sample code: * ``` * $cloudDeployClient = new CloudDeployClient(); * try { - * $formattedName = $cloudDeployClient->configName('[PROJECT]', '[LOCATION]'); - * $response = $cloudDeployClient->getConfig($formattedName); - * } finally { - * $cloudDeployClient->close(); + * $formattedName = $cloudDeployClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + * $operationResponse = $cloudDeployClient->deleteTarget($formattedName); + * $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 = $cloudDeployClient->deleteTarget($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'deleteTarget'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the `Target` to delete. Format should be + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A 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 bool $allowMissing + * Optional. If set to true, then deleting an already deleted or non-existing + * `Target` will succeed. + * @type bool $validateOnly + * Optional. If set, validate the request and preview the review, but do not + * actually post it. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @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 deleteTarget($name, array $optionalArgs = []) + { + $request = new DeleteTargetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'DeleteTarget', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + + /** + * Gets details of a single Automation. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + * $response = $cloudDeployClient->getAutomation($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_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\Deploy\V1\Automation + * + * @throws ApiException if the remote call fails + */ + public function getAutomation($name, array $optionalArgs = []) + { + $request = new GetAutomationRequest(); + $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( + 'GetAutomation', + Automation::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets details of a single AutomationRun. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + * $response = $cloudDeployClient->getAutomationRun($formattedName); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * @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\Deploy\V1\AutomationRun + * + * @throws ApiException if the remote call fails + */ + public function getAutomationRun($name, array $optionalArgs = []) + { + $request = new GetAutomationRunRequest(); + $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( + 'GetAutomationRun', + AutomationRun::class, + $optionalArgs, + $request + )->wait(); + } + + /** + * Gets the configuration for a location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->configName('[PROJECT]', '[LOCATION]'); + * $response = $cloudDeployClient->getConfig($formattedName); + * } finally { + * $cloudDeployClient->close(); * } * ``` * @@ -1699,7 +2199,7 @@ public function getConfig($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * @param array $optionalArgs { * Optional. * @@ -1748,7 +2248,7 @@ public function getDeliveryPipeline($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. * @param array $optionalArgs { * Optional. * @@ -1797,7 +2297,7 @@ public function getJobRun($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * @param array $optionalArgs { * Optional. * @@ -1846,7 +2346,7 @@ public function getRelease($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. * @param array $optionalArgs { * Optional. * @@ -1895,7 +2395,7 @@ public function getRollout($name, array $optionalArgs = []) * ``` * * @param string $name Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * @param array $optionalArgs { * Optional. * @@ -1946,8 +2446,7 @@ public function getTarget($name, array $optionalArgs = []) * ``` * * @param string $rollout Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param string $phaseId Required. The phase ID the Job to ignore belongs to. * @param string $jobId Required. The job ID for the Job to ignore. * @param array $optionalArgs { @@ -1989,6 +2488,190 @@ public function ignoreJob( )->wait(); } + /** + * Lists AutomationRuns in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listAutomationRuns($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. + * @param array $optionalArgs { + * Optional. + * + * @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 string $filter + * Filter automationRuns to be returned. All fields can be used in the + * filter. + * @type string $orderBy + * Field to sort by. + * @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 listAutomationRuns($parent, array $optionalArgs = []) + { + $request = new ListAutomationRunsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListAutomationRuns', + $optionalArgs, + ListAutomationRunsResponse::class, + $request + ); + } + + /** + * Lists Automations in a given project and location. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedParent = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * // Iterate over pages of elements + * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $cloudDeployClient->listAutomations($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @param array $optionalArgs { + * Optional. + * + * @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 string $filter + * Filter automations to be returned. All fields can be used in the + * filter. + * @type string $orderBy + * Field to sort by. + * @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 listAutomations($parent, array $optionalArgs = []) + { + $request = new ListAutomationsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->getPagedListResponse( + 'ListAutomations', + $optionalArgs, + ListAutomationsResponse::class, + $request + ); + } + /** * Lists DeliveryPipelines in a given project and location. * @@ -2016,7 +2699,7 @@ public function ignoreJob( * ``` * * @param string $parent Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. + * be `projects/{project_id}/locations/{location_name}`. * @param array $optionalArgs { * Optional. * @@ -2381,7 +3064,7 @@ public function listRollouts($parent, array $optionalArgs = []) * ``` * * @param string $parent Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * @param array $optionalArgs { * Optional. * @@ -2463,8 +3146,7 @@ public function listTargets($parent, array $optionalArgs = []) * ``` * * @param string $rollout Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @param string $phaseId Required. The phase ID the Job to retry belongs to. * @param string $jobId Required. The job ID for the Job to retry. * @param array $optionalArgs { @@ -2506,6 +3188,94 @@ public function retryJob( )->wait(); } + /** + * Creates a `Rollout` to roll back the specified target. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $formattedName = $cloudDeployClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + * $targetId = 'target_id'; + * $rolloutId = 'rollout_id'; + * $response = $cloudDeployClient->rollbackTarget($formattedName, $targetId, $rolloutId); + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @param string $targetId Required. ID of the `Target` that is being rolled back. + * @param string $rolloutId Required. ID of the rollback `Rollout` to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $releaseId + * Optional. ID of the `Release` to roll back to. If this isn't specified, the + * previous successful `Rollout` to the specified target will be used to + * determine the `Release`. + * @type string $rolloutToRollBack + * Optional. If provided, this must be the latest `Rollout` that is on the + * `Target`. + * @type RollbackTargetConfig $rollbackConfig + * Optional. Configs for the rollback `Rollout`. + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided + * with a `RollbackTargetResponse`. + * @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\Deploy\V1\RollbackTargetResponse + * + * @throws ApiException if the remote call fails + */ + public function rollbackTarget( + $name, + $targetId, + $rolloutId, + array $optionalArgs = [] + ) { + $request = new RollbackTargetRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setTargetId($targetId); + $request->setRolloutId($rolloutId); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['releaseId'])) { + $request->setReleaseId($optionalArgs['releaseId']); + } + + if (isset($optionalArgs['rolloutToRollBack'])) { + $request->setRolloutToRollBack($optionalArgs['rolloutToRollBack']); + } + + if (isset($optionalArgs['rollbackConfig'])) { + $request->setRollbackConfig($optionalArgs['rollbackConfig']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startCall( + 'RollbackTarget', + RollbackTargetResponse::class, + $optionalArgs, + $request + )->wait(); + } + /** * Terminates a Job Run in a given project and location. * @@ -2521,8 +3291,7 @@ public function retryJob( * ``` * * @param string $name Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. * @param array $optionalArgs { * Optional. * @@ -2556,6 +3325,121 @@ public function terminateJobRun($name, array $optionalArgs = []) )->wait(); } + /** + * Updates the parameters of a single Automation resource. + * + * Sample code: + * ``` + * $cloudDeployClient = new CloudDeployClient(); + * try { + * $updateMask = new FieldMask(); + * $automation = new Automation(); + * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $cloudDeployClient->updateAutomation($updateMask, $automation); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $cloudDeployClient->resumeOperation($operationName, 'updateAutomation'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $cloudDeployClient->close(); + * } + * ``` + * + * @param FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param Automation $automation Required. The `Automation` to update. + * @param array $optionalArgs { + * Optional. + * + * @type string $requestId + * Optional. A 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 bool $allowMissing + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * @type bool $validateOnly + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * @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 updateAutomation( + $updateMask, + $automation, + array $optionalArgs = [] + ) { + $request = new UpdateAutomationRequest(); + $requestParamHeaders = []; + $request->setUpdateMask($updateMask); + $request->setAutomation($automation); + $requestParamHeaders['automation.name'] = $automation->getName(); + if (isset($optionalArgs['requestId'])) { + $request->setRequestId($optionalArgs['requestId']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + if (isset($optionalArgs['validateOnly'])) { + $request->setValidateOnly($optionalArgs['validateOnly']); + } + + $requestParams = new RequestParamsHeaderDescriptor( + $requestParamHeaders + ); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + return $this->startOperationsCall( + 'UpdateAutomation', + $optionalArgs, + $request, + $this->getOperationsClient() + )->wait(); + } + /** * Updates the parameters of a single DeliveryPipeline. * diff --git a/Deploy/src/V1/GetAutomationRequest.php b/Deploy/src/V1/GetAutomationRequest.php new file mode 100644 index 000000000000..fdea3420dc9e --- /dev/null +++ b/Deploy/src/V1/GetAutomationRequest.php @@ -0,0 +1,86 @@ +google.cloud.deploy.v1.GetAutomationRequest + */ +class GetAutomationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. Please see + * {@see CloudDeployClient::automationName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\GetAutomationRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_name}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_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. Name of the `Automation`. Format must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/automations/{automation_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/Deploy/src/V1/GetAutomationRunRequest.php b/Deploy/src/V1/GetAutomationRunRequest.php new file mode 100644 index 000000000000..d249b14ceb1a --- /dev/null +++ b/Deploy/src/V1/GetAutomationRunRequest.php @@ -0,0 +1,86 @@ +google.cloud.deploy.v1.GetAutomationRunRequest + */ +class GetAutomationRunRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + + /** + * @param string $name Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. Please see + * {@see CloudDeployClient::automationRunName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\GetAutomationRunRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the `AutomationRun`. Format must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. + * + * 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/Deploy/src/V1/GetDeliveryPipelineRequest.php b/Deploy/src/V1/GetDeliveryPipelineRequest.php index c006f8d7e0d5..3e22baeb615b 100644 --- a/Deploy/src/V1/GetDeliveryPipelineRequest.php +++ b/Deploy/src/V1/GetDeliveryPipelineRequest.php @@ -17,7 +17,7 @@ class GetDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetDeliveryPipelineRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the `DeliveryPipeline`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/GetJobRunRequest.php b/Deploy/src/V1/GetJobRunRequest.php index 51dea861e3e4..1f4e58266c18 100644 --- a/Deploy/src/V1/GetJobRunRequest.php +++ b/Deploy/src/V1/GetJobRunRequest.php @@ -17,7 +17,7 @@ class GetJobRunRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetJobRunRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. Please see * {@see CloudDeployClient::jobRunName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\GetJobRunRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the `JobRun`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}/jobRuns/{job_run_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/GetReleaseRequest.php b/Deploy/src/V1/GetReleaseRequest.php index c558a0d9e5c4..ebb3240557cc 100644 --- a/Deploy/src/V1/GetReleaseRequest.php +++ b/Deploy/src/V1/GetReleaseRequest.php @@ -17,7 +17,7 @@ class GetReleaseRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetReleaseRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. Please see * {@see CloudDeployClient::releaseName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\GetReleaseRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the `Release`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/GetRolloutRequest.php b/Deploy/src/V1/GetRolloutRequest.php index 43f81d521799..536e7371abe8 100644 --- a/Deploy/src/V1/GetRolloutRequest.php +++ b/Deploy/src/V1/GetRolloutRequest.php @@ -17,7 +17,7 @@ class GetRolloutRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetRolloutRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. Please see + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\GetRolloutRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the `Rollout`. Format must be - * projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}. + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}/releases/{release_name}/rollouts/{rollout_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/GetTargetRequest.php b/Deploy/src/V1/GetTargetRequest.php index 43469cb122e1..ec237d10e015 100644 --- a/Deploy/src/V1/GetTargetRequest.php +++ b/Deploy/src/V1/GetTargetRequest.php @@ -17,7 +17,7 @@ class GetTargetRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -25,7 +25,7 @@ class GetTargetRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. Please see + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. Please see * {@see CloudDeployClient::targetName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\GetTargetRequest @@ -46,7 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * } */ public function __construct($data = NULL) { @@ -56,7 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -68,7 +68,7 @@ public function getName() /** * Required. Name of the `Target`. Format must be - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/GkeCluster.php b/Deploy/src/V1/GkeCluster.php index 0a743be437fb..f740425b9e3b 100644 --- a/Deploy/src/V1/GkeCluster.php +++ b/Deploy/src/V1/GkeCluster.php @@ -17,7 +17,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message { /** * Information specifying a GKE Cluster. Format is - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { */ @@ -43,7 +43,7 @@ class GkeCluster extends \Google\Protobuf\Internal\Message * * @type string $cluster * Information specifying a GKE Cluster. Format is - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * @type bool $internal_ip * Optional. If true, `cluster` is accessed using the private IP address of * the control plane endpoint. Otherwise, the default IP address of the @@ -61,7 +61,7 @@ public function __construct($data = NULL) { /** * Information specifying a GKE Cluster. Format is - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { * @return string @@ -73,7 +73,7 @@ public function getCluster() /** * Information specifying a GKE Cluster. Format is - * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}. + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`. * * Generated from protobuf field string cluster = 1 [(.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/IgnoreJobRequest.php b/Deploy/src/V1/IgnoreJobRequest.php index 9f855f4d1b50..0a4ea21c773f 100644 --- a/Deploy/src/V1/IgnoreJobRequest.php +++ b/Deploy/src/V1/IgnoreJobRequest.php @@ -17,8 +17,7 @@ class IgnoreJobRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -38,8 +37,7 @@ class IgnoreJobRequest extends \Google\Protobuf\Internal\Message /** * @param string $rollout Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId Required. The phase ID the Job to ignore belongs to. * @param string $jobId Required. The job ID for the Job to ignore. @@ -64,8 +62,7 @@ public static function build(string $rollout, string $phaseId, string $jobId): s * * @type string $rollout * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $phase_id * Required. The phase ID the Job to ignore belongs to. * @type string $job_id @@ -79,8 +76,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -92,8 +88,7 @@ public function getRollout() /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/JobRun.php b/Deploy/src/V1/JobRun.php index 80d345f4eeb3..81075e3d4705 100644 --- a/Deploy/src/V1/JobRun.php +++ b/Deploy/src/V1/JobRun.php @@ -18,9 +18,7 @@ class JobRun extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `JobRun`. Format is - * projects/{project}/locations/{location}/ - * deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ - * {rollouts}/jobRuns/{uuid}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -85,9 +83,7 @@ class JobRun extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `JobRun`. Format is - * projects/{project}/locations/{location}/ - * deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ - * {rollouts}/jobRuns/{uuid}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`. * @type string $uid * Output only. Unique identifier of the `JobRun`. * @type string $phase_id @@ -127,9 +123,7 @@ public function __construct($data = NULL) { /** * Optional. Name of the `JobRun`. Format is - * projects/{project}/locations/{location}/ - * deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ - * {rollouts}/jobRuns/{uuid}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -141,9 +135,7 @@ public function getName() /** * Optional. Name of the `JobRun`. Format is - * projects/{project}/locations/{location}/ - * deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/ - * {rollouts}/jobRuns/{uuid}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{releases}/rollouts/{rollouts}/jobRuns/{uuid}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/ListAutomationRunsRequest.php b/Deploy/src/V1/ListAutomationRunsRequest.php new file mode 100644 index 000000000000..9d4025a8eb3d --- /dev/null +++ b/Deploy/src/V1/ListAutomationRunsRequest.php @@ -0,0 +1,255 @@ +google.cloud.deploy.v1.ListAutomationRunsRequest + */ +class ListAutomationRunsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * The maximum number of automationRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 automationRuns will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + private $page_size = 0; + /** + * A page token, received from a previous `ListAutomationRuns` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + private $page_token = ''; + /** + * Filter automationRuns to be returned. All fields can be used in the + * filter. + * + * Generated from protobuf field string filter = 4; + */ + private $filter = ''; + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + */ + private $order_by = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. Please see + * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\ListAutomationRunsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. + * @type int $page_size + * The maximum number of automationRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 automationRuns will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @type string $page_token + * A page token, received from a previous `ListAutomationRuns` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Filter automationRuns to be returned. All fields can be used in the + * filter. + * @type string $order_by + * Field to sort by. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. + * + * 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, which owns this collection of automationRuns. Format + * must be + * `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}`. + * + * 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; + } + + /** + * The maximum number of automationRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 automationRuns will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of automationRuns to return. The service may return + * fewer than this value. If unspecified, at most 50 automationRuns will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListAutomationRuns` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListAutomationRuns` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the 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; + } + + /** + * Filter automationRuns to be returned. All fields can be used in the + * filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter automationRuns to be returned. All fields can be used in the + * 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; + } + + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListAutomationRunsResponse.php b/Deploy/src/V1/ListAutomationRunsResponse.php new file mode 100644 index 000000000000..22af1ab166a8 --- /dev/null +++ b/Deploy/src/V1/ListAutomationRunsResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListAutomationRunsResponse + */ +class ListAutomationRunsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `AutomationRuns` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRun automation_runs = 1; + */ + private $automation_runs; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $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\Deploy\V1\AutomationRun>|\Google\Protobuf\Internal\RepeatedField $automation_runs + * The `AutomationRuns` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `AutomationRuns` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRun automation_runs = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutomationRuns() + { + return $this->automation_runs; + } + + /** + * The `AutomationRuns` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.AutomationRun automation_runs = 1; + * @param array<\Google\Cloud\Deploy\V1\AutomationRun>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutomationRuns($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\AutomationRun::class); + $this->automation_runs = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/Deploy/src/V1/ListAutomationsRequest.php b/Deploy/src/V1/ListAutomationsRequest.php new file mode 100644 index 000000000000..96e698e78d17 --- /dev/null +++ b/Deploy/src/V1/ListAutomationsRequest.php @@ -0,0 +1,255 @@ +google.cloud.deploy.v1.ListAutomationsRequest + */ +class ListAutomationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $parent = ''; + /** + * The maximum number of automations to return. The service may return + * fewer than this value. If unspecified, at most 50 automations will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + */ + private $page_size = 0; + /** + * A page token, received from a previous `ListAutomations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + private $page_token = ''; + /** + * Filter automations to be returned. All fields can be used in the + * filter. + * + * Generated from protobuf field string filter = 4; + */ + private $filter = ''; + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + */ + private $order_by = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see + * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. + * + * @return \Google\Cloud\Deploy\V1\ListAutomationsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @type int $page_size + * The maximum number of automations to return. The service may return + * fewer than this value. If unspecified, at most 50 automations will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * @type string $page_token + * A page token, received from a previous `ListAutomations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * @type string $filter + * Filter automations to be returned. All fields can be used in the + * filter. + * @type string $order_by + * Field to sort by. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * 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, which owns this collection of automations. Format + * must be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * 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; + } + + /** + * The maximum number of automations to return. The service may return + * fewer than this value. If unspecified, at most 50 automations will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of automations to return. The service may return + * fewer than this value. If unspecified, at most 50 automations will + * be returned. The maximum value is 1000; values above 1000 will be set + * to 1000. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * A page token, received from a previous `ListAutomations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * A page token, received from a previous `ListAutomations` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other provided parameters match + * the call that provided the 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; + } + + /** + * Filter automations to be returned. All fields can be used in the + * filter. + * + * Generated from protobuf field string filter = 4; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Filter automations to be returned. All fields can be used in the + * 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; + } + + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Field to sort by. + * + * Generated from protobuf field string order_by = 5; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/ListAutomationsResponse.php b/Deploy/src/V1/ListAutomationsResponse.php new file mode 100644 index 000000000000..30776f483fac --- /dev/null +++ b/Deploy/src/V1/ListAutomationsResponse.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.ListAutomationsResponse + */ +class ListAutomationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The `Automations` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Automation automations = 1; + */ + private $automations; + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + private $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\Deploy\V1\Automation>|\Google\Protobuf\Internal\RepeatedField $automations + * The `Automations` objects. + * @type string $next_page_token + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The `Automations` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Automation automations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAutomations() + { + return $this->automations; + } + + /** + * The `Automations` objects. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.Automation automations = 1; + * @param array<\Google\Cloud\Deploy\V1\Automation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAutomations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\Automation::class); + $this->automations = $arr; + + return $this; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token, which can be sent as `page_token` to retrieve the next page. + * If this field is omitted, there are no subsequent pages. + * + * 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/Deploy/src/V1/ListDeliveryPipelinesRequest.php b/Deploy/src/V1/ListDeliveryPipelinesRequest.php index 34aa60dca53d..ef072380dab0 100644 --- a/Deploy/src/V1/ListDeliveryPipelinesRequest.php +++ b/Deploy/src/V1/ListDeliveryPipelinesRequest.php @@ -17,7 +17,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message { /** * Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. + * be `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -56,7 +56,7 @@ class ListDeliveryPipelinesRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. Please see + * be `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest @@ -77,7 +77,7 @@ public static function build(string $parent): self * * @type string $parent * Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. + * be `projects/{project_id}/locations/{location_name}`. * @type int $page_size * The maximum number of pipelines to return. The service may return * fewer than this value. If unspecified, at most 50 pipelines will @@ -102,7 +102,7 @@ public function __construct($data = NULL) { /** * Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. + * be `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -114,7 +114,7 @@ public function getParent() /** * Required. The parent, which owns this collection of pipelines. Format must - * be projects/{project_id}/locations/{location_name}. + * be `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/ListTargetsRequest.php b/Deploy/src/V1/ListTargetsRequest.php index 6395c1708e89..e4add9f854e2 100644 --- a/Deploy/src/V1/ListTargetsRequest.php +++ b/Deploy/src/V1/ListTargetsRequest.php @@ -17,7 +17,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message { /** * Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -57,7 +57,7 @@ class ListTargetsRequest extends \Google\Protobuf\Internal\Message /** * @param string $parent Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. Please see + * `projects/{project_id}/locations/{location_name}`. Please see * {@see CloudDeployClient::locationName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\ListTargetsRequest @@ -78,7 +78,7 @@ public static function build(string $parent): self * * @type string $parent * Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * @type int $page_size * Optional. The maximum number of `Target` objects to return. The service may * return fewer than this value. If unspecified, at most 50 `Target` objects @@ -104,7 +104,7 @@ public function __construct($data = NULL) { /** * Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -116,7 +116,7 @@ public function getParent() /** * Required. The parent, which owns this collection of targets. Format must be - * projects/{project_id}/locations/{location_name}. + * `projects/{project_id}/locations/{location_name}`. * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/Metadata.php b/Deploy/src/V1/Metadata.php index 54d36402392d..7ac6c72f51d6 100644 --- a/Deploy/src/V1/Metadata.php +++ b/Deploy/src/V1/Metadata.php @@ -22,6 +22,13 @@ class Metadata extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.deploy.v1.CloudRunMetadata cloud_run = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $cloud_run = null; + /** + * Output only. AutomationRolloutMetadata contains the information about the + * interactions between Automation service and this rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRolloutMetadata automation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $automation = null; /** * Constructor. @@ -32,6 +39,9 @@ class Metadata extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Deploy\V1\CloudRunMetadata $cloud_run * Output only. The name of the Cloud Run Service that is associated with a * `Rollout`. + * @type \Google\Cloud\Deploy\V1\AutomationRolloutMetadata $automation + * Output only. AutomationRolloutMetadata contains the information about the + * interactions between Automation service and this rollout. * } */ public function __construct($data = NULL) { @@ -77,5 +87,43 @@ public function setCloudRun($var) return $this; } + /** + * Output only. AutomationRolloutMetadata contains the information about the + * interactions between Automation service and this rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRolloutMetadata automation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\AutomationRolloutMetadata|null + */ + public function getAutomation() + { + return $this->automation; + } + + public function hasAutomation() + { + return isset($this->automation); + } + + public function clearAutomation() + { + unset($this->automation); + } + + /** + * Output only. AutomationRolloutMetadata contains the information about the + * interactions between Automation service and this rollout. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRolloutMetadata automation = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\AutomationRolloutMetadata $var + * @return $this + */ + public function setAutomation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationRolloutMetadata::class); + $this->automation = $var; + + return $this; + } + } diff --git a/Deploy/src/V1/Postdeploy.php b/Deploy/src/V1/Postdeploy.php index 51fecf576910..9d9352935c0e 100644 --- a/Deploy/src/V1/Postdeploy.php +++ b/Deploy/src/V1/Postdeploy.php @@ -16,7 +16,7 @@ class Postdeploy extends \Google\Protobuf\Internal\Message { /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the postdeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -30,7 +30,7 @@ class Postdeploy extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $actions - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the postdeploy job. * } */ @@ -40,7 +40,7 @@ public function __construct($data = NULL) { } /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the postdeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -52,7 +52,7 @@ public function getActions() } /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the postdeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/Deploy/src/V1/PostdeployJobRun.php b/Deploy/src/V1/PostdeployJobRun.php index 073a5ad3e207..e6e0cc7de825 100644 --- a/Deploy/src/V1/PostdeployJobRun.php +++ b/Deploy/src/V1/PostdeployJobRun.php @@ -18,7 +18,7 @@ class PostdeployJobRun extends \Google\Protobuf\Internal\Message /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the postdeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -47,7 +47,7 @@ class PostdeployJobRun extends \Google\Protobuf\Internal\Message * @type string $build * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the postdeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * @type int $failure_cause * Output only. The reason the postdeploy failed. This will always be * unspecified while the postdeploy is in progress or if it succeeded. @@ -64,7 +64,7 @@ public function __construct($data = NULL) { /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the postdeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -77,7 +77,7 @@ public function getBuild() /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the postdeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/PostdeployJobRun/FailureCause.php b/Deploy/src/V1/PostdeployJobRun/FailureCause.php index 26010488f11d..8bce2a448afc 100644 --- a/Deploy/src/V1/PostdeployJobRun/FailureCause.php +++ b/Deploy/src/V1/PostdeployJobRun/FailureCause.php @@ -35,7 +35,7 @@ class FailureCause */ const EXECUTION_FAILED = 2; /** - * The postdeploy build did not complete within the alloted time. + * The postdeploy job run did not complete within the alloted time. * * Generated from protobuf enum DEADLINE_EXCEEDED = 3; */ diff --git a/Deploy/src/V1/Predeploy.php b/Deploy/src/V1/Predeploy.php index 2efbb9f5855a..cb69743fa87d 100644 --- a/Deploy/src/V1/Predeploy.php +++ b/Deploy/src/V1/Predeploy.php @@ -16,7 +16,7 @@ class Predeploy extends \Google\Protobuf\Internal\Message { /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the predeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -30,7 +30,7 @@ class Predeploy extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type array|\Google\Protobuf\Internal\RepeatedField $actions - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the predeploy job. * } */ @@ -40,7 +40,7 @@ public function __construct($data = NULL) { } /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the predeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; @@ -52,7 +52,7 @@ public function getActions() } /** - * Optional. A sequence of skaffold custom actions to invoke during execution + * Optional. A sequence of Skaffold custom actions to invoke during execution * of the predeploy job. * * Generated from protobuf field repeated string actions = 1 [(.google.api.field_behavior) = OPTIONAL]; diff --git a/Deploy/src/V1/PredeployJobRun.php b/Deploy/src/V1/PredeployJobRun.php index 0723018b0441..70920ef199fd 100644 --- a/Deploy/src/V1/PredeployJobRun.php +++ b/Deploy/src/V1/PredeployJobRun.php @@ -18,7 +18,7 @@ class PredeployJobRun extends \Google\Protobuf\Internal\Message /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the predeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -47,7 +47,7 @@ class PredeployJobRun extends \Google\Protobuf\Internal\Message * @type string $build * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the predeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * @type int $failure_cause * Output only. The reason the predeploy failed. This will always be * unspecified while the predeploy is in progress or if it succeeded. @@ -64,7 +64,7 @@ public function __construct($data = NULL) { /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the predeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -77,7 +77,7 @@ public function getBuild() /** * Output only. The resource name of the Cloud Build `Build` object that is * used to execute the custom actions associated with the predeploy Job. - * Format is projects/{project}/locations/{location}/builds/{build}. + * Format is `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/PredeployJobRun/FailureCause.php b/Deploy/src/V1/PredeployJobRun/FailureCause.php index 5a185802f654..f550d66570da 100644 --- a/Deploy/src/V1/PredeployJobRun/FailureCause.php +++ b/Deploy/src/V1/PredeployJobRun/FailureCause.php @@ -35,7 +35,7 @@ class FailureCause */ const EXECUTION_FAILED = 2; /** - * The predeploy build did not complete within the alloted time. + * The predeploy job run did not complete within the alloted time. * * Generated from protobuf enum DEADLINE_EXCEEDED = 3; */ diff --git a/Deploy/src/V1/PromoteReleaseOperation.php b/Deploy/src/V1/PromoteReleaseOperation.php new file mode 100644 index 000000000000..dbdc97d94eb2 --- /dev/null +++ b/Deploy/src/V1/PromoteReleaseOperation.php @@ -0,0 +1,187 @@ +google.cloud.deploy.v1.PromoteReleaseOperation + */ +class PromoteReleaseOperation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ID of the target that represents the promotion stage to + * which the release will be promoted. The value of this field is the last + * segment of a target name. + * + * Generated from protobuf field string target_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $target_id = ''; + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $wait = null; + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rollout = ''; + /** + * Output only. The starting phase of the rollout created by this operation. + * + * Generated from protobuf field string phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $phase = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $target_id + * Output only. The ID of the target that represents the promotion stage to + * which the release will be promoted. The value of this field is the last + * segment of a target name. + * @type \Google\Protobuf\Duration $wait + * Output only. How long the operation will be paused. + * @type string $rollout + * Output only. The name of the rollout that initiates the `AutomationRun`. + * @type string $phase + * Output only. The starting phase of the rollout created by this operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ID of the target that represents the promotion stage to + * which the release will be promoted. The value of this field is the last + * segment of a target name. + * + * Generated from protobuf field string target_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Output only. The ID of the target that represents the promotion stage to + * which the release will be promoted. The value of this field is the last + * segment of a target name. + * + * Generated from protobuf field string target_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRollout() + { + return $this->rollout; + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkString($var, True); + $this->rollout = $var; + + return $this; + } + + /** + * Output only. The starting phase of the rollout created by this operation. + * + * Generated from protobuf field string phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPhase() + { + return $this->phase; + } + + /** + * Output only. The starting phase of the rollout created by this operation. + * + * Generated from protobuf field string phase = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPhase($var) + { + GPBUtil::checkString($var, True); + $this->phase = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/PromoteReleaseRule.php b/Deploy/src/V1/PromoteReleaseRule.php new file mode 100644 index 000000000000..9d30291eefdc --- /dev/null +++ b/Deploy/src/V1/PromoteReleaseRule.php @@ -0,0 +1,260 @@ +google.cloud.deploy.v1.PromoteReleaseRule + */ +class PromoteReleaseRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $id = ''; + /** + * Optional. How long the release need to be paused until being promoted to + * the next target. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $wait = null; + /** + * Optional. The ID of the stage in the pipeline to which this `Release` is + * deploying. If unspecified, default it to the next stage in the promotion + * flow. The value of this field could be one of the following: + * * The last segment of a target name. It only needs the ID to determine + * if the target is one of the stages in the promotion sequence defined + * in the pipeline. + * * "@next", the next target in the promotion sequence. + * + * Generated from protobuf field string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $destination_target_id = ''; + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $condition = null; + /** + * Optional. The starting phase of the rollout created by this operation. + * Default to the first phase. + * + * Generated from protobuf field string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $destination_phase = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * @type \Google\Protobuf\Duration $wait + * Optional. How long the release need to be paused until being promoted to + * the next target. + * @type string $destination_target_id + * Optional. The ID of the stage in the pipeline to which this `Release` is + * deploying. If unspecified, default it to the next stage in the promotion + * flow. The value of this field could be one of the following: + * * The last segment of a target name. It only needs the ID to determine + * if the target is one of the stages in the promotion sequence defined + * in the pipeline. + * * "@next", the next target in the promotion sequence. + * @type \Google\Cloud\Deploy\V1\AutomationRuleCondition $condition + * Output only. Information around the state of the Automation rule. + * @type string $destination_phase + * Optional. The starting phase of the rollout created by this operation. + * Default to the first phase. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. How long the release need to be paused until being promoted to + * the next target. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Optional. How long the release need to be paused until being promoted to + * the next target. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Optional. The ID of the stage in the pipeline to which this `Release` is + * deploying. If unspecified, default it to the next stage in the promotion + * flow. The value of this field could be one of the following: + * * The last segment of a target name. It only needs the ID to determine + * if the target is one of the stages in the promotion sequence defined + * in the pipeline. + * * "@next", the next target in the promotion sequence. + * + * Generated from protobuf field string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDestinationTargetId() + { + return $this->destination_target_id; + } + + /** + * Optional. The ID of the stage in the pipeline to which this `Release` is + * deploying. If unspecified, default it to the next stage in the promotion + * flow. The value of this field could be one of the following: + * * The last segment of a target name. It only needs the ID to determine + * if the target is one of the stages in the promotion sequence defined + * in the pipeline. + * * "@next", the next target in the promotion sequence. + * + * Generated from protobuf field string destination_target_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDestinationTargetId($var) + { + GPBUtil::checkString($var, True); + $this->destination_target_id = $var; + + return $this; + } + + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\AutomationRuleCondition|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Output only. Information around the state of the Automation rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\AutomationRuleCondition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationRuleCondition::class); + $this->condition = $var; + + return $this; + } + + /** + * Optional. The starting phase of the rollout created by this operation. + * Default to the first phase. + * + * Generated from protobuf field string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDestinationPhase() + { + return $this->destination_phase; + } + + /** + * Optional. The starting phase of the rollout created by this operation. + * Default to the first phase. + * + * Generated from protobuf field string destination_phase = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDestinationPhase($var) + { + GPBUtil::checkString($var, True); + $this->destination_phase = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Release.php b/Deploy/src/V1/Release.php index dc4ea2ff67e5..d6f60f5ff90c 100644 --- a/Deploy/src/V1/Release.php +++ b/Deploy/src/V1/Release.php @@ -18,9 +18,8 @@ class Release extends \Google\Protobuf\Internal\Message { /** - * Optional. Name of the `Release`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Release`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -171,9 +170,8 @@ class Release extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Optional. Name of the `Release`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Release`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. * @type string $uid * Output only. Unique identifier of the `Release`. * @type string $description @@ -240,9 +238,8 @@ public function __construct($data = NULL) { } /** - * Optional. Name of the `Release`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Release`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -253,9 +250,8 @@ public function getName() } /** - * Optional. Name of the `Release`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Release`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/Release/TargetRender/FailureCause.php b/Deploy/src/V1/Release/TargetRender/FailureCause.php index 7345b6ace592..d81cd4075e7b 100644 --- a/Deploy/src/V1/Release/TargetRender/FailureCause.php +++ b/Deploy/src/V1/Release/TargetRender/FailureCause.php @@ -41,6 +41,14 @@ class FailureCause * Generated from protobuf enum CLOUD_BUILD_REQUEST_FAILED = 3; */ const CLOUD_BUILD_REQUEST_FAILED = 3; + /** + * The render operation did not complete successfully because the + * verification stanza required for verify was not found on the skaffold + * configuration. + * + * Generated from protobuf enum VERIFICATION_CONFIG_NOT_FOUND = 4; + */ + const VERIFICATION_CONFIG_NOT_FOUND = 4; /** * The render operation did not complete successfully because the custom * action required for predeploy or postdeploy was not found in the @@ -55,6 +63,7 @@ class FailureCause self::CLOUD_BUILD_UNAVAILABLE => 'CLOUD_BUILD_UNAVAILABLE', self::EXECUTION_FAILED => 'EXECUTION_FAILED', self::CLOUD_BUILD_REQUEST_FAILED => 'CLOUD_BUILD_REQUEST_FAILED', + self::VERIFICATION_CONFIG_NOT_FOUND => 'VERIFICATION_CONFIG_NOT_FOUND', self::CUSTOM_ACTION_NOT_FOUND => 'CUSTOM_ACTION_NOT_FOUND', ]; diff --git a/Deploy/src/V1/ReleaseRenderEvent.php b/Deploy/src/V1/ReleaseRenderEvent.php index 39c43a9523e1..e7427f896749 100644 --- a/Deploy/src/V1/ReleaseRenderEvent.php +++ b/Deploy/src/V1/ReleaseRenderEvent.php @@ -24,11 +24,17 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message */ private $message = ''; /** - * The name of the `Release`. + * The name of the release. * * Generated from protobuf field string release = 2; */ private $release = ''; + /** + * The state of the release render. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState release_render_state = 3; + */ + private $release_render_state = 0; /** * Constructor. @@ -40,7 +46,9 @@ class ReleaseRenderEvent extends \Google\Protobuf\Internal\Message * Debug message for when a render transition occurs. Provides further * details as rendering progresses through render states. * @type string $release - * The name of the `Release`. + * The name of the release. + * @type int $release_render_state + * The state of the release render. * } */ public function __construct($data = NULL) { @@ -77,7 +85,7 @@ public function setMessage($var) } /** - * The name of the `Release`. + * The name of the release. * * Generated from protobuf field string release = 2; * @return string @@ -88,7 +96,7 @@ public function getRelease() } /** - * The name of the `Release`. + * The name of the release. * * Generated from protobuf field string release = 2; * @param string $var @@ -102,5 +110,31 @@ public function setRelease($var) return $this; } + /** + * The state of the release render. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState release_render_state = 3; + * @return int + */ + public function getReleaseRenderState() + { + return $this->release_render_state; + } + + /** + * The state of the release render. + * + * Generated from protobuf field .google.cloud.deploy.v1.Release.RenderState release_render_state = 3; + * @param int $var + * @return $this + */ + public function setReleaseRenderState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Release\RenderState::class); + $this->release_render_state = $var; + + return $this; + } + } diff --git a/Deploy/src/V1/RepairMode.php b/Deploy/src/V1/RepairMode.php new file mode 100644 index 000000000000..fc68f99b0bb3 --- /dev/null +++ b/Deploy/src/V1/RepairMode.php @@ -0,0 +1,108 @@ +google.cloud.deploy.v1.RepairMode + */ +class RepairMode extends \Google\Protobuf\Internal\Message +{ + protected $mode; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\Retry $retry + * Optional. Retries a failed job. + * @type \Google\Cloud\Deploy\V1\Rollback $rollback + * Optional. Rolls back a `Rollout`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Retries a failed job. + * + * Generated from protobuf field .google.cloud.deploy.v1.Retry retry = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\Retry|null + */ + public function getRetry() + { + return $this->readOneof(1); + } + + public function hasRetry() + { + return $this->hasOneof(1); + } + + /** + * Optional. Retries a failed job. + * + * Generated from protobuf field .google.cloud.deploy.v1.Retry retry = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\Retry $var + * @return $this + */ + public function setRetry($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Retry::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Rolls back a `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollback rollback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\Rollback|null + */ + public function getRollback() + { + return $this->readOneof(2); + } + + public function hasRollback() + { + return $this->hasOneof(2); + } + + /** + * Optional. Rolls back a `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollback rollback = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\Rollback $var + * @return $this + */ + public function setRollback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Rollback::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getMode() + { + return $this->whichOneof("mode"); + } + +} + diff --git a/Deploy/src/V1/RepairPhase.php b/Deploy/src/V1/RepairPhase.php new file mode 100644 index 000000000000..c0e3879c2809 --- /dev/null +++ b/Deploy/src/V1/RepairPhase.php @@ -0,0 +1,109 @@ +google.cloud.deploy.v1.RepairPhase + */ +class RepairPhase extends \Google\Protobuf\Internal\Message +{ + protected $repair_phase; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\RetryPhase $retry + * Output only. Records of the retry attempts for retry repair mode. + * @type \Google\Cloud\Deploy\V1\RollbackAttempt $rollback + * Output only. Rollback attempt for rollback repair mode . + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Records of the retry attempts for retry repair mode. + * + * Generated from protobuf field .google.cloud.deploy.v1.RetryPhase retry = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\RetryPhase|null + */ + public function getRetry() + { + return $this->readOneof(1); + } + + public function hasRetry() + { + return $this->hasOneof(1); + } + + /** + * Output only. Records of the retry attempts for retry repair mode. + * + * Generated from protobuf field .google.cloud.deploy.v1.RetryPhase retry = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\RetryPhase $var + * @return $this + */ + public function setRetry($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RetryPhase::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Output only. Rollback attempt for rollback repair mode . + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackAttempt rollback = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\RollbackAttempt|null + */ + public function getRollback() + { + return $this->readOneof(2); + } + + public function hasRollback() + { + return $this->hasOneof(2); + } + + /** + * Output only. Rollback attempt for rollback repair mode . + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackAttempt rollback = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\RollbackAttempt $var + * @return $this + */ + public function setRollback($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RollbackAttempt::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getRepairPhase() + { + return $this->whichOneof("repair_phase"); + } + +} + diff --git a/Deploy/src/V1/RepairRolloutOperation.php b/Deploy/src/V1/RepairRolloutOperation.php new file mode 100644 index 000000000000..a991aef6f780 --- /dev/null +++ b/Deploy/src/V1/RepairRolloutOperation.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.RepairRolloutOperation + */ +class RepairRolloutOperation extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rollout = ''; + /** + * Output only. The index of the current repair action in the repair sequence. + * + * Generated from protobuf field int64 current_repair_mode_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $current_repair_mode_index = 0; + /** + * Output only. Records of the repair attempts. Each repair phase may have + * multiple retry attempts or single rollback attempt. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairPhase repair_phases = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $repair_phases; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $rollout + * Output only. The name of the rollout that initiates the `AutomationRun`. + * @type int|string $current_repair_mode_index + * Output only. The index of the current repair action in the repair sequence. + * @type array<\Google\Cloud\Deploy\V1\RepairPhase>|\Google\Protobuf\Internal\RepeatedField $repair_phases + * Output only. Records of the repair attempts. Each repair phase may have + * multiple retry attempts or single rollback attempt. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRollout() + { + return $this->rollout; + } + + /** + * Output only. The name of the rollout that initiates the `AutomationRun`. + * + * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkString($var, True); + $this->rollout = $var; + + return $this; + } + + /** + * Output only. The index of the current repair action in the repair sequence. + * + * Generated from protobuf field int64 current_repair_mode_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCurrentRepairModeIndex() + { + return $this->current_repair_mode_index; + } + + /** + * Output only. The index of the current repair action in the repair sequence. + * + * Generated from protobuf field int64 current_repair_mode_index = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCurrentRepairModeIndex($var) + { + GPBUtil::checkInt64($var); + $this->current_repair_mode_index = $var; + + return $this; + } + + /** + * Output only. Records of the repair attempts. Each repair phase may have + * multiple retry attempts or single rollback attempt. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairPhase repair_phases = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRepairPhases() + { + return $this->repair_phases; + } + + /** + * Output only. Records of the repair attempts. Each repair phase may have + * multiple retry attempts or single rollback attempt. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairPhase repair_phases = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Deploy\V1\RepairPhase>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRepairPhases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\RepairPhase::class); + $this->repair_phases = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RepairRolloutRule.php b/Deploy/src/V1/RepairRolloutRule.php new file mode 100644 index 000000000000..91d287c89e3e --- /dev/null +++ b/Deploy/src/V1/RepairRolloutRule.php @@ -0,0 +1,262 @@ +google.cloud.deploy.v1.RepairRolloutRule + */ +class RepairRolloutRule extends \Google\Protobuf\Internal\Message +{ + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $id = ''; + /** + * Optional. Phases within which jobs are subject to automatic repair actions + * on failure. Proceeds only after phase name matched any one in the list, or + * for all phases if unspecified. This value must consist of lower-case + * letters, numbers, and hyphens, start with a letter and end with a letter or + * a number, and have a max length of 63 characters. In other words, it must + * match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $source_phases; + /** + * Optional. Jobs to repair. Proceeds only after job name matched any one in + * the list, or for all jobs if unspecified or empty. The phase that includes + * the job must match the phase ID specified in `source_phase`. This value + * must consist of lower-case letters, numbers, and hyphens, start with a + * letter and end with a letter or a number, and have a max length of 63 + * characters. In other words, it must match the following regex: + * `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string jobs = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $jobs; + /** + * Required. Defines the types of automatic repair actions for failed jobs. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairMode repair_modes = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + private $repair_modes; + /** + * Output only. Information around the state of the 'Automation' rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $condition = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * @type array|\Google\Protobuf\Internal\RepeatedField $source_phases + * Optional. Phases within which jobs are subject to automatic repair actions + * on failure. Proceeds only after phase name matched any one in the list, or + * for all phases if unspecified. This value must consist of lower-case + * letters, numbers, and hyphens, start with a letter and end with a letter or + * a number, and have a max length of 63 characters. In other words, it must + * match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * @type array|\Google\Protobuf\Internal\RepeatedField $jobs + * Optional. Jobs to repair. Proceeds only after job name matched any one in + * the list, or for all jobs if unspecified or empty. The phase that includes + * the job must match the phase ID specified in `source_phase`. This value + * must consist of lower-case letters, numbers, and hyphens, start with a + * letter and end with a letter or a number, and have a max length of 63 + * characters. In other words, it must match the following regex: + * `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * @type array<\Google\Cloud\Deploy\V1\RepairMode>|\Google\Protobuf\Internal\RepeatedField $repair_modes + * Required. Defines the types of automatic repair actions for failed jobs. + * @type \Google\Cloud\Deploy\V1\AutomationRuleCondition $condition + * Output only. Information around the state of the 'Automation' rule. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * Required. ID of the rule. This id must be unique in the `Automation` + * resource to which this rule belongs. The format is `[a-z][a-z0-9\-]{0,62}`. + * + * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Optional. Phases within which jobs are subject to automatic repair actions + * on failure. Proceeds only after phase name matched any one in the list, or + * for all phases if unspecified. This value must consist of lower-case + * letters, numbers, and hyphens, start with a letter and end with a letter or + * a number, and have a max length of 63 characters. In other words, it must + * match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSourcePhases() + { + return $this->source_phases; + } + + /** + * Optional. Phases within which jobs are subject to automatic repair actions + * on failure. Proceeds only after phase name matched any one in the list, or + * for all phases if unspecified. This value must consist of lower-case + * letters, numbers, and hyphens, start with a letter and end with a letter or + * a number, and have a max length of 63 characters. In other words, it must + * match the following regex: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string source_phases = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSourcePhases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->source_phases = $arr; + + return $this; + } + + /** + * Optional. Jobs to repair. Proceeds only after job name matched any one in + * the list, or for all jobs if unspecified or empty. The phase that includes + * the job must match the phase ID specified in `source_phase`. This value + * must consist of lower-case letters, numbers, and hyphens, start with a + * letter and end with a letter or a number, and have a max length of 63 + * characters. In other words, it must match the following regex: + * `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string jobs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getJobs() + { + return $this->jobs; + } + + /** + * Optional. Jobs to repair. Proceeds only after job name matched any one in + * the list, or for all jobs if unspecified or empty. The phase that includes + * the job must match the phase ID specified in `source_phase`. This value + * must consist of lower-case letters, numbers, and hyphens, start with a + * letter and end with a letter or a number, and have a max length of 63 + * characters. In other words, it must match the following regex: + * `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. + * + * Generated from protobuf field repeated string jobs = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->jobs = $arr; + + return $this; + } + + /** + * Required. Defines the types of automatic repair actions for failed jobs. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairMode repair_modes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRepairModes() + { + return $this->repair_modes; + } + + /** + * Required. Defines the types of automatic repair actions for failed jobs. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RepairMode repair_modes = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Deploy\V1\RepairMode>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRepairModes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\RepairMode::class); + $this->repair_modes = $arr; + + return $this; + } + + /** + * Output only. Information around the state of the 'Automation' rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\Deploy\V1\AutomationRuleCondition|null + */ + public function getCondition() + { + return $this->condition; + } + + public function hasCondition() + { + return isset($this->condition); + } + + public function clearCondition() + { + unset($this->condition); + } + + /** + * Output only. Information around the state of the 'Automation' rule. + * + * Generated from protobuf field .google.cloud.deploy.v1.AutomationRuleCondition condition = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\Deploy\V1\AutomationRuleCondition $var + * @return $this + */ + public function setCondition($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\AutomationRuleCondition::class); + $this->condition = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RepairState.php b/Deploy/src/V1/RepairState.php new file mode 100644 index 000000000000..0069e36d1f81 --- /dev/null +++ b/Deploy/src/V1/RepairState.php @@ -0,0 +1,89 @@ +google.cloud.deploy.v1.RepairState + */ +class RepairState +{ + /** + * The `repair` has an unspecified state. + * + * Generated from protobuf enum REPAIR_STATE_UNSPECIFIED = 0; + */ + const REPAIR_STATE_UNSPECIFIED = 0; + /** + * The `repair` action has succeeded. + * + * Generated from protobuf enum REPAIR_STATE_SUCCEEDED = 1; + */ + const REPAIR_STATE_SUCCEEDED = 1; + /** + * The `repair` action was cancelled. + * + * Generated from protobuf enum REPAIR_STATE_CANCELLED = 2; + */ + const REPAIR_STATE_CANCELLED = 2; + /** + * The `repair` action has failed. + * + * Generated from protobuf enum REPAIR_STATE_FAILED = 3; + */ + const REPAIR_STATE_FAILED = 3; + /** + * The `repair` action is in progress. + * + * Generated from protobuf enum REPAIR_STATE_IN_PROGRESS = 4; + */ + const REPAIR_STATE_IN_PROGRESS = 4; + /** + * The `repair` action is pending. + * + * Generated from protobuf enum REPAIR_STATE_PENDING = 5; + */ + const REPAIR_STATE_PENDING = 5; + /** + * The `repair` action was skipped. + * + * Generated from protobuf enum REPAIR_STATE_SKIPPED = 6; + */ + const REPAIR_STATE_SKIPPED = 6; + + private static $valueToName = [ + self::REPAIR_STATE_UNSPECIFIED => 'REPAIR_STATE_UNSPECIFIED', + self::REPAIR_STATE_SUCCEEDED => 'REPAIR_STATE_SUCCEEDED', + self::REPAIR_STATE_CANCELLED => 'REPAIR_STATE_CANCELLED', + self::REPAIR_STATE_FAILED => 'REPAIR_STATE_FAILED', + self::REPAIR_STATE_IN_PROGRESS => 'REPAIR_STATE_IN_PROGRESS', + self::REPAIR_STATE_PENDING => 'REPAIR_STATE_PENDING', + self::REPAIR_STATE_SKIPPED => 'REPAIR_STATE_SKIPPED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/Deploy/src/V1/Retry.php b/Deploy/src/V1/Retry.php new file mode 100644 index 000000000000..c87d128a9bc1 --- /dev/null +++ b/Deploy/src/V1/Retry.php @@ -0,0 +1,157 @@ +google.cloud.deploy.v1.Retry + */ +class Retry extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Total number of retries. Retry will skipped if set to 0; The + * minimum value is 1, and the maximum value is 10. + * + * Generated from protobuf field int64 attempts = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $attempts = 0; + /** + * Optional. How long to wait for the first retry. Default is 0, and the + * maximum value is 14d. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $wait = null; + /** + * Optional. The pattern of how wait time will be increased. Default is + * linear. Backoff mode will be ignored if `wait` is 0. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $backoff_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $attempts + * Required. Total number of retries. Retry will skipped if set to 0; The + * minimum value is 1, and the maximum value is 10. + * @type \Google\Protobuf\Duration $wait + * Optional. How long to wait for the first retry. Default is 0, and the + * maximum value is 14d. + * @type int $backoff_mode + * Optional. The pattern of how wait time will be increased. Default is + * linear. Backoff mode will be ignored if `wait` is 0. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Total number of retries. Retry will skipped if set to 0; The + * minimum value is 1, and the maximum value is 10. + * + * Generated from protobuf field int64 attempts = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int|string + */ + public function getAttempts() + { + return $this->attempts; + } + + /** + * Required. Total number of retries. Retry will skipped if set to 0; The + * minimum value is 1, and the maximum value is 10. + * + * Generated from protobuf field int64 attempts = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int|string $var + * @return $this + */ + public function setAttempts($var) + { + GPBUtil::checkInt64($var); + $this->attempts = $var; + + return $this; + } + + /** + * Optional. How long to wait for the first retry. Default is 0, and the + * maximum value is 14d. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Optional. How long to wait for the first retry. Default is 0, and the + * maximum value is 14d. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Optional. The pattern of how wait time will be increased. Default is + * linear. Backoff mode will be ignored if `wait` is 0. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getBackoffMode() + { + return $this->backoff_mode; + } + + /** + * Optional. The pattern of how wait time will be increased. Default is + * linear. Backoff mode will be ignored if `wait` is 0. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setBackoffMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\BackoffMode::class); + $this->backoff_mode = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RetryAttempt.php b/Deploy/src/V1/RetryAttempt.php new file mode 100644 index 000000000000..f82a36fb3a83 --- /dev/null +++ b/Deploy/src/V1/RetryAttempt.php @@ -0,0 +1,179 @@ +google.cloud.deploy.v1.RetryAttempt + */ +class RetryAttempt extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The index of this retry attempt. + * + * Generated from protobuf field int64 attempt = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $attempt = 0; + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $wait = null; + /** + * Output only. Valid state of this retry action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Output only. Description of the state of the Retry. + * + * Generated from protobuf field string state_desc = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state_desc = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $attempt + * Output only. The index of this retry attempt. + * @type \Google\Protobuf\Duration $wait + * Output only. How long the operation will be paused. + * @type int $state + * Output only. Valid state of this retry action. + * @type string $state_desc + * Output only. Description of the state of the Retry. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The index of this retry attempt. + * + * Generated from protobuf field int64 attempt = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getAttempt() + { + return $this->attempt; + } + + /** + * Output only. The index of this retry attempt. + * + * Generated from protobuf field int64 attempt = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setAttempt($var) + { + GPBUtil::checkInt64($var); + $this->attempt = $var; + + return $this; + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getWait() + { + return $this->wait; + } + + public function hasWait() + { + return isset($this->wait); + } + + public function clearWait() + { + unset($this->wait); + } + + /** + * Output only. How long the operation will be paused. + * + * Generated from protobuf field .google.protobuf.Duration wait = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setWait($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->wait = $var; + + return $this; + } + + /** + * Output only. Valid state of this retry action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Valid state of this retry action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\RepairState::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Description of the state of the Retry. + * + * Generated from protobuf field string state_desc = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStateDesc() + { + return $this->state_desc; + } + + /** + * Output only. Description of the state of the Retry. + * + * Generated from protobuf field string state_desc = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStateDesc($var) + { + GPBUtil::checkString($var, True); + $this->state_desc = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RetryJobRequest.php b/Deploy/src/V1/RetryJobRequest.php index 3b7d9bf73fcd..584ac5d52b23 100644 --- a/Deploy/src/V1/RetryJobRequest.php +++ b/Deploy/src/V1/RetryJobRequest.php @@ -17,8 +17,7 @@ class RetryJobRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -38,8 +37,7 @@ class RetryJobRequest extends \Google\Protobuf\Internal\Message /** * @param string $rollout Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see * {@see CloudDeployClient::rolloutName()} for help formatting this field. * @param string $phaseId Required. The phase ID the Job to retry belongs to. * @param string $jobId Required. The job ID for the Job to retry. @@ -64,8 +62,7 @@ public static function build(string $rollout, string $phaseId, string $jobId): s * * @type string $rollout * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * @type string $phase_id * Required. The phase ID the Job to retry belongs to. * @type string $job_id @@ -79,8 +76,7 @@ public function __construct($data = NULL) { /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -92,8 +88,7 @@ public function getRollout() /** * Required. Name of the Rollout. Format is - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. * * Generated from protobuf field string rollout = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/RetryPhase.php b/Deploy/src/V1/RetryPhase.php new file mode 100644 index 000000000000..581451ee680a --- /dev/null +++ b/Deploy/src/V1/RetryPhase.php @@ -0,0 +1,208 @@ +google.cloud.deploy.v1.RetryPhase + */ +class RetryPhase extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The number of attempts that have been made. + * + * Generated from protobuf field int64 total_attempts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $total_attempts = 0; + /** + * Output only. The pattern of how the wait time of the retry attempt is + * calculated. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $backoff_mode = 0; + /** + * Output only. The phase ID of the phase that includes the job being retried. + * + * Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $phase_id = ''; + /** + * Output only. The job ID for the Job to retry. + * + * Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $job_id = ''; + /** + * Output only. Detail of a retry action. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RetryAttempt attempts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $attempts; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $total_attempts + * Output only. The number of attempts that have been made. + * @type int $backoff_mode + * Output only. The pattern of how the wait time of the retry attempt is + * calculated. + * @type string $phase_id + * Output only. The phase ID of the phase that includes the job being retried. + * @type string $job_id + * Output only. The job ID for the Job to retry. + * @type array<\Google\Cloud\Deploy\V1\RetryAttempt>|\Google\Protobuf\Internal\RepeatedField $attempts + * Output only. Detail of a retry action. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The number of attempts that have been made. + * + * Generated from protobuf field int64 total_attempts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getTotalAttempts() + { + return $this->total_attempts; + } + + /** + * Output only. The number of attempts that have been made. + * + * Generated from protobuf field int64 total_attempts = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setTotalAttempts($var) + { + GPBUtil::checkInt64($var); + $this->total_attempts = $var; + + return $this; + } + + /** + * Output only. The pattern of how the wait time of the retry attempt is + * calculated. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getBackoffMode() + { + return $this->backoff_mode; + } + + /** + * Output only. The pattern of how the wait time of the retry attempt is + * calculated. + * + * Generated from protobuf field .google.cloud.deploy.v1.BackoffMode backoff_mode = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setBackoffMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\BackoffMode::class); + $this->backoff_mode = $var; + + return $this; + } + + /** + * Output only. The phase ID of the phase that includes the job being retried. + * + * Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPhaseId() + { + return $this->phase_id; + } + + /** + * Output only. The phase ID of the phase that includes the job being retried. + * + * Generated from protobuf field string phase_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPhaseId($var) + { + GPBUtil::checkString($var, True); + $this->phase_id = $var; + + return $this; + } + + /** + * Output only. The job ID for the Job to retry. + * + * Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getJobId() + { + return $this->job_id; + } + + /** + * Output only. The job ID for the Job to retry. + * + * Generated from protobuf field string job_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setJobId($var) + { + GPBUtil::checkString($var, True); + $this->job_id = $var; + + return $this; + } + + /** + * Output only. Detail of a retry action. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RetryAttempt attempts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttempts() + { + return $this->attempts; + } + + /** + * Output only. Detail of a retry action. + * + * Generated from protobuf field repeated .google.cloud.deploy.v1.RetryAttempt attempts = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\Deploy\V1\RetryAttempt>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttempts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Deploy\V1\RetryAttempt::class); + $this->attempts = $arr; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Rollback.php b/Deploy/src/V1/Rollback.php new file mode 100644 index 000000000000..91deb3d77b35 --- /dev/null +++ b/Deploy/src/V1/Rollback.php @@ -0,0 +1,71 @@ +google.cloud.deploy.v1.Rollback + */ +class Rollback extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $destination_phase = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_phase + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDestinationPhase() + { + return $this->destination_phase; + } + + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDestinationPhase($var) + { + GPBUtil::checkString($var, True); + $this->destination_phase = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RollbackAttempt.php b/Deploy/src/V1/RollbackAttempt.php new file mode 100644 index 000000000000..ad08b378c1be --- /dev/null +++ b/Deploy/src/V1/RollbackAttempt.php @@ -0,0 +1,169 @@ +google.cloud.deploy.v1.RollbackAttempt + */ +class RollbackAttempt extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The phase to which the rollout will be rolled back to. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $destination_phase = ''; + /** + * Output only. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rollout_id = ''; + /** + * Output only. Valid state of this rollback action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state = 0; + /** + * Output only. Description of the state of the Rollback. + * + * Generated from protobuf field string state_desc = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $state_desc = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $destination_phase + * Output only. The phase to which the rollout will be rolled back to. + * @type string $rollout_id + * Output only. ID of the rollback `Rollout` to create. + * @type int $state + * Output only. Valid state of this rollback action. + * @type string $state_desc + * Output only. Description of the state of the Rollback. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The phase to which the rollout will be rolled back to. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDestinationPhase() + { + return $this->destination_phase; + } + + /** + * Output only. The phase to which the rollout will be rolled back to. + * + * Generated from protobuf field string destination_phase = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDestinationPhase($var) + { + GPBUtil::checkString($var, True); + $this->destination_phase = $var; + + return $this; + } + + /** + * Output only. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRolloutId() + { + return $this->rollout_id; + } + + /** + * Output only. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRolloutId($var) + { + GPBUtil::checkString($var, True); + $this->rollout_id = $var; + + return $this; + } + + /** + * Output only. Valid state of this rollback action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. Valid state of this rollback action. + * + * Generated from protobuf field .google.cloud.deploy.v1.RepairState state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\RepairState::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Description of the state of the Rollback. + * + * Generated from protobuf field string state_desc = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStateDesc() + { + return $this->state_desc; + } + + /** + * Output only. Description of the state of the Rollback. + * + * Generated from protobuf field string state_desc = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStateDesc($var) + { + GPBUtil::checkString($var, True); + $this->state_desc = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RollbackTargetConfig.php b/Deploy/src/V1/RollbackTargetConfig.php new file mode 100644 index 000000000000..2d2e4d089290 --- /dev/null +++ b/Deploy/src/V1/RollbackTargetConfig.php @@ -0,0 +1,115 @@ +google.cloud.deploy.v1.RollbackTargetConfig + */ +class RollbackTargetConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The rollback `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rollout = null; + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string starting_phase_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $starting_phase_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\Rollout $rollout + * Optional. The rollback `Rollout` to create. + * @type string $starting_phase_id + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The rollback `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\Rollout|null + */ + public function getRollout() + { + return $this->rollout; + } + + public function hasRollout() + { + return isset($this->rollout); + } + + public function clearRollout() + { + unset($this->rollout); + } + + /** + * Optional. The rollback `Rollout` to create. + * + * Generated from protobuf field .google.cloud.deploy.v1.Rollout rollout = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\Rollout $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Rollout::class); + $this->rollout = $var; + + return $this; + } + + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string starting_phase_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getStartingPhaseId() + { + return $this->starting_phase_id; + } + + /** + * Optional. The starting phase ID for the `Rollout`. If unspecified, the + * `Rollout` will start in the stable phase. + * + * Generated from protobuf field string starting_phase_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setStartingPhaseId($var) + { + GPBUtil::checkString($var, True); + $this->starting_phase_id = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RollbackTargetRequest.php b/Deploy/src/V1/RollbackTargetRequest.php new file mode 100644 index 000000000000..5e46e61fd554 --- /dev/null +++ b/Deploy/src/V1/RollbackTargetRequest.php @@ -0,0 +1,325 @@ +google.cloud.deploy.v1.RollbackTargetRequest + */ +class RollbackTargetRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + private $name = ''; + /** + * Required. ID of the `Target` that is being rolled back. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $target_id = ''; + /** + * Required. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $rollout_id = ''; + /** + * Optional. ID of the `Release` to roll back to. If this isn't specified, the + * previous successful `Rollout` to the specified target will be used to + * determine the `Release`. + * + * Generated from protobuf field string release_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $release_id = ''; + /** + * Optional. If provided, this must be the latest `Rollout` that is on the + * `Target`. + * + * Generated from protobuf field string rollout_to_roll_back = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rollout_to_roll_back = ''; + /** + * Optional. Configs for the rollback `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $rollback_config = null; + /** + * Optional. If set to true, the request is validated and the user is provided + * with a `RollbackTargetResponse`. + * + * Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * @param string $name Required. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. Please see + * {@see CloudDeployClient::deliveryPipelineName()} for help formatting this field. + * @param string $targetId Required. ID of the `Target` that is being rolled back. + * @param string $rolloutId Required. ID of the rollback `Rollout` to create. + * + * @return \Google\Cloud\Deploy\V1\RollbackTargetRequest + * + * @experimental + */ + public static function build(string $name, string $targetId, string $rolloutId): self + { + return (new self()) + ->setName($name) + ->setTargetId($targetId) + ->setRolloutId($rolloutId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_name}`. + * @type string $target_id + * Required. ID of the `Target` that is being rolled back. + * @type string $rollout_id + * Required. ID of the rollback `Rollout` to create. + * @type string $release_id + * Optional. ID of the `Release` to roll back to. If this isn't specified, the + * previous successful `Rollout` to the specified target will be used to + * determine the `Release`. + * @type string $rollout_to_roll_back + * Optional. If provided, this must be the latest `Rollout` that is on the + * `Target`. + * @type \Google\Cloud\Deploy\V1\RollbackTargetConfig $rollback_config + * Optional. Configs for the rollback `Rollout`. + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided + * with a `RollbackTargetResponse`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_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. The `DeliveryPipeline` for which the rollback `Rollout` should be + * created. Format should be + * `projects/{project_id}/locations/{location_name}/deliveryPipelines/{pipeline_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; + } + + /** + * Required. ID of the `Target` that is being rolled back. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * Required. ID of the `Target` that is being rolled back. + * + * Generated from protobuf field string target_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * Required. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRolloutId() + { + return $this->rollout_id; + } + + /** + * Required. ID of the rollback `Rollout` to create. + * + * Generated from protobuf field string rollout_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRolloutId($var) + { + GPBUtil::checkString($var, True); + $this->rollout_id = $var; + + return $this; + } + + /** + * Optional. ID of the `Release` to roll back to. If this isn't specified, the + * previous successful `Rollout` to the specified target will be used to + * determine the `Release`. + * + * Generated from protobuf field string release_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getReleaseId() + { + return $this->release_id; + } + + /** + * Optional. ID of the `Release` to roll back to. If this isn't specified, the + * previous successful `Rollout` to the specified target will be used to + * determine the `Release`. + * + * Generated from protobuf field string release_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setReleaseId($var) + { + GPBUtil::checkString($var, True); + $this->release_id = $var; + + return $this; + } + + /** + * Optional. If provided, this must be the latest `Rollout` that is on the + * `Target`. + * + * Generated from protobuf field string rollout_to_roll_back = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRolloutToRollBack() + { + return $this->rollout_to_roll_back; + } + + /** + * Optional. If provided, this must be the latest `Rollout` that is on the + * `Target`. + * + * Generated from protobuf field string rollout_to_roll_back = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRolloutToRollBack($var) + { + GPBUtil::checkString($var, True); + $this->rollout_to_roll_back = $var; + + return $this; + } + + /** + * Optional. Configs for the rollback `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Deploy\V1\RollbackTargetConfig|null + */ + public function getRollbackConfig() + { + return $this->rollback_config; + } + + public function hasRollbackConfig() + { + return isset($this->rollback_config); + } + + public function clearRollbackConfig() + { + unset($this->rollback_config); + } + + /** + * Optional. Configs for the rollback `Rollout`. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Deploy\V1\RollbackTargetConfig $var + * @return $this + */ + public function setRollbackConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RollbackTargetConfig::class); + $this->rollback_config = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with a `RollbackTargetResponse`. + * + * Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with a `RollbackTargetResponse`. + * + * Generated from protobuf field bool validate_only = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RollbackTargetResponse.php b/Deploy/src/V1/RollbackTargetResponse.php new file mode 100644 index 000000000000..4096fbe0bad5 --- /dev/null +++ b/Deploy/src/V1/RollbackTargetResponse.php @@ -0,0 +1,77 @@ +google.cloud.deploy.v1.RollbackTargetResponse + */ +class RollbackTargetResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The config of the rollback `Rollout` created or will be created. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 1; + */ + private $rollback_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Deploy\V1\RollbackTargetConfig $rollback_config + * The config of the rollback `Rollout` created or will be created. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * The config of the rollback `Rollout` created or will be created. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 1; + * @return \Google\Cloud\Deploy\V1\RollbackTargetConfig|null + */ + public function getRollbackConfig() + { + return $this->rollback_config; + } + + public function hasRollbackConfig() + { + return isset($this->rollback_config); + } + + public function clearRollbackConfig() + { + unset($this->rollback_config); + } + + /** + * The config of the rollback `Rollout` created or will be created. + * + * Generated from protobuf field .google.cloud.deploy.v1.RollbackTargetConfig rollback_config = 1; + * @param \Google\Cloud\Deploy\V1\RollbackTargetConfig $var + * @return $this + */ + public function setRollbackConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\RollbackTargetConfig::class); + $this->rollback_config = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/Rollout.php b/Deploy/src/V1/Rollout.php index 3f87e866014a..349bb81594ce 100644 --- a/Deploy/src/V1/Rollout.php +++ b/Deploy/src/V1/Rollout.php @@ -17,9 +17,8 @@ class Rollout extends \Google\Protobuf\Internal\Message { /** - * Optional. Name of the `Rollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Rollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -150,13 +149,25 @@ class Rollout extends \Google\Protobuf\Internal\Message */ private $metadata = null; /** - * Output only. Name of the `ControllerRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ControllerRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $controller_rollout = ''; + /** + * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. + * Empty if this `Rollout` wasn't created as a rollback. + * + * Generated from protobuf field string rollback_of_rollout = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rollback_of_rollout = ''; + /** + * Output only. Names of `Rollouts` that rolled back this `Rollout`. + * + * Generated from protobuf field repeated string rolled_back_by_rollouts = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $rolled_back_by_rollouts; /** * Constructor. @@ -165,9 +176,8 @@ class Rollout extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $name - * Optional. Name of the `Rollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Rollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * @type string $uid * Output only. Unique identifier of the `Rollout`. * @type string $description @@ -222,9 +232,13 @@ class Rollout extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\Deploy\V1\Metadata $metadata * Output only. Metadata contains information about the rollout. * @type string $controller_rollout - * Output only. Name of the `ControllerRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ControllerRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. + * @type string $rollback_of_rollout + * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. + * Empty if this `Rollout` wasn't created as a rollback. + * @type array|\Google\Protobuf\Internal\RepeatedField $rolled_back_by_rollouts + * Output only. Names of `Rollouts` that rolled back this `Rollout`. * } */ public function __construct($data = NULL) { @@ -233,9 +247,8 @@ public function __construct($data = NULL) { } /** - * Optional. Name of the `Rollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Rollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -246,9 +259,8 @@ public function getName() } /** - * Optional. Name of the `Rollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Optional. Name of the `Rollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var @@ -825,9 +837,8 @@ public function setMetadata($var) } /** - * Output only. Name of the `ControllerRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ControllerRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return string @@ -838,9 +849,8 @@ public function getControllerRollout() } /** - * Output only. Name of the `ControllerRollout`. Format is projects/{project}/ - * locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}. + * Output only. Name of the `ControllerRollout`. Format is + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string controller_rollout = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param string $var @@ -854,5 +864,59 @@ public function setControllerRollout($var) return $this; } + /** + * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. + * Empty if this `Rollout` wasn't created as a rollback. + * + * Generated from protobuf field string rollback_of_rollout = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getRollbackOfRollout() + { + return $this->rollback_of_rollout; + } + + /** + * Output only. Name of the `Rollout` that is rolled back by this `Rollout`. + * Empty if this `Rollout` wasn't created as a rollback. + * + * Generated from protobuf field string rollback_of_rollout = 26 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setRollbackOfRollout($var) + { + GPBUtil::checkString($var, True); + $this->rollback_of_rollout = $var; + + return $this; + } + + /** + * Output only. Names of `Rollouts` that rolled back this `Rollout`. + * + * Generated from protobuf field repeated string rolled_back_by_rollouts = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRolledBackByRollouts() + { + return $this->rolled_back_by_rollouts; + } + + /** + * Output only. Names of `Rollouts` that rolled back this `Rollout`. + * + * Generated from protobuf field repeated string rolled_back_by_rollouts = 27 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRolledBackByRollouts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->rolled_back_by_rollouts = $arr; + + return $this; + } + } diff --git a/Deploy/src/V1/RolloutUpdateEvent.php b/Deploy/src/V1/RolloutUpdateEvent.php new file mode 100644 index 000000000000..a2a2113eff46 --- /dev/null +++ b/Deploy/src/V1/RolloutUpdateEvent.php @@ -0,0 +1,272 @@ +google.cloud.deploy.v1.RolloutUpdateEvent + */ +class RolloutUpdateEvent extends \Google\Protobuf\Internal\Message +{ + /** + * Unique identifier of the pipeline. + * + * Generated from protobuf field string pipeline_uid = 1; + */ + private $pipeline_uid = ''; + /** + * Unique identifier of the release. + * + * Generated from protobuf field string release_uid = 2; + */ + private $release_uid = ''; + /** + * The name of the rollout. + * + * Generated from protobuf field string rollout = 3; + */ + private $rollout = ''; + /** + * ID of the target. + * + * Generated from protobuf field string target_id = 4; + */ + private $target_id = ''; + /** + * The type of the rollout update. + * + * Generated from protobuf field .google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType rollout_update_type = 5; + */ + private $rollout_update_type = 0; + /** + * Debug message for when a rollout update event occurs. + * + * Generated from protobuf field string message = 6; + */ + private $message = ''; + /** + * Type of this notification, e.g. for a rollout update event. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + */ + private $type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $pipeline_uid + * Unique identifier of the pipeline. + * @type string $release_uid + * Unique identifier of the release. + * @type string $rollout + * The name of the rollout. + * @type string $target_id + * ID of the target. + * @type int $rollout_update_type + * The type of the rollout update. + * @type string $message + * Debug message for when a rollout update event occurs. + * @type int $type + * Type of this notification, e.g. for a rollout update event. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\RolloutUpdatePayload::initOnce(); + parent::__construct($data); + } + + /** + * Unique identifier of the pipeline. + * + * Generated from protobuf field string pipeline_uid = 1; + * @return string + */ + public function getPipelineUid() + { + return $this->pipeline_uid; + } + + /** + * Unique identifier of the pipeline. + * + * Generated from protobuf field string pipeline_uid = 1; + * @param string $var + * @return $this + */ + public function setPipelineUid($var) + { + GPBUtil::checkString($var, True); + $this->pipeline_uid = $var; + + return $this; + } + + /** + * Unique identifier of the release. + * + * Generated from protobuf field string release_uid = 2; + * @return string + */ + public function getReleaseUid() + { + return $this->release_uid; + } + + /** + * Unique identifier of the release. + * + * Generated from protobuf field string release_uid = 2; + * @param string $var + * @return $this + */ + public function setReleaseUid($var) + { + GPBUtil::checkString($var, True); + $this->release_uid = $var; + + return $this; + } + + /** + * The name of the rollout. + * + * Generated from protobuf field string rollout = 3; + * @return string + */ + public function getRollout() + { + return $this->rollout; + } + + /** + * The name of the rollout. + * + * Generated from protobuf field string rollout = 3; + * @param string $var + * @return $this + */ + public function setRollout($var) + { + GPBUtil::checkString($var, True); + $this->rollout = $var; + + return $this; + } + + /** + * ID of the target. + * + * Generated from protobuf field string target_id = 4; + * @return string + */ + public function getTargetId() + { + return $this->target_id; + } + + /** + * ID of the target. + * + * Generated from protobuf field string target_id = 4; + * @param string $var + * @return $this + */ + public function setTargetId($var) + { + GPBUtil::checkString($var, True); + $this->target_id = $var; + + return $this; + } + + /** + * The type of the rollout update. + * + * Generated from protobuf field .google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType rollout_update_type = 5; + * @return int + */ + public function getRolloutUpdateType() + { + return $this->rollout_update_type; + } + + /** + * The type of the rollout update. + * + * Generated from protobuf field .google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType rollout_update_type = 5; + * @param int $var + * @return $this + */ + public function setRolloutUpdateType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\RolloutUpdateEvent\RolloutUpdateType::class); + $this->rollout_update_type = $var; + + return $this; + } + + /** + * Debug message for when a rollout update event occurs. + * + * Generated from protobuf field string message = 6; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * Debug message for when a rollout update event occurs. + * + * Generated from protobuf field string message = 6; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * Type of this notification, e.g. for a rollout update event. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of this notification, e.g. for a rollout update event. + * + * Generated from protobuf field .google.cloud.deploy.v1.Type type = 7; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Deploy\V1\Type::class); + $this->type = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/RolloutUpdateEvent/RolloutUpdateType.php b/Deploy/src/V1/RolloutUpdateEvent/RolloutUpdateType.php new file mode 100644 index 000000000000..60f15427e31a --- /dev/null +++ b/Deploy/src/V1/RolloutUpdateEvent/RolloutUpdateType.php @@ -0,0 +1,139 @@ +google.cloud.deploy.v1.RolloutUpdateEvent.RolloutUpdateType + */ +class RolloutUpdateType +{ + /** + * Rollout update type unspecified. + * + * Generated from protobuf enum ROLLOUT_UPDATE_TYPE_UNSPECIFIED = 0; + */ + const ROLLOUT_UPDATE_TYPE_UNSPECIFIED = 0; + /** + * rollout state updated to pending. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Rollout state updated to pending release. + * + * Generated from protobuf enum PENDING_RELEASE = 2; + */ + const PENDING_RELEASE = 2; + /** + * Rollout state updated to in progress. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + /** + * Rollout state updated to cancelling. + * + * Generated from protobuf enum CANCELLING = 4; + */ + const CANCELLING = 4; + /** + * Rollout state updated to cancelled. + * + * Generated from protobuf enum CANCELLED = 5; + */ + const CANCELLED = 5; + /** + * Rollout state updated to halted. + * + * Generated from protobuf enum HALTED = 6; + */ + const HALTED = 6; + /** + * Rollout state updated to succeeded. + * + * Generated from protobuf enum SUCCEEDED = 7; + */ + const SUCCEEDED = 7; + /** + * Rollout state updated to failed. + * + * Generated from protobuf enum FAILED = 8; + */ + const FAILED = 8; + /** + * Rollout requires approval. + * + * Generated from protobuf enum APPROVAL_REQUIRED = 9; + */ + const APPROVAL_REQUIRED = 9; + /** + * Rollout has been approved. + * + * Generated from protobuf enum APPROVED = 10; + */ + const APPROVED = 10; + /** + * Rollout has been rejected. + * + * Generated from protobuf enum REJECTED = 11; + */ + const REJECTED = 11; + /** + * Rollout requires advance to the next phase. + * + * Generated from protobuf enum ADVANCE_REQUIRED = 12; + */ + const ADVANCE_REQUIRED = 12; + /** + * Rollout has been advanced. + * + * Generated from protobuf enum ADVANCED = 13; + */ + const ADVANCED = 13; + + private static $valueToName = [ + self::ROLLOUT_UPDATE_TYPE_UNSPECIFIED => 'ROLLOUT_UPDATE_TYPE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::PENDING_RELEASE => 'PENDING_RELEASE', + self::IN_PROGRESS => 'IN_PROGRESS', + self::CANCELLING => 'CANCELLING', + self::CANCELLED => 'CANCELLED', + self::HALTED => 'HALTED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::APPROVAL_REQUIRED => 'APPROVAL_REQUIRED', + self::APPROVED => 'APPROVED', + self::REJECTED => 'REJECTED', + self::ADVANCE_REQUIRED => 'ADVANCE_REQUIRED', + self::ADVANCED => 'ADVANCED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/Deploy/src/V1/Target.php b/Deploy/src/V1/Target.php index 5f0cc875a5ac..baf148437368 100644 --- a/Deploy/src/V1/Target.php +++ b/Deploy/src/V1/Target.php @@ -19,7 +19,7 @@ class Target extends \Google\Protobuf\Internal\Message { /** * Optional. Name of the `Target`. Format is - * projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; */ @@ -119,7 +119,7 @@ class Target extends \Google\Protobuf\Internal\Message * * @type string $name * Optional. Name of the `Target`. Format is - * projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. * @type string $target_id * Output only. Resource id of the `Target`. * @type string $uid @@ -178,7 +178,7 @@ public function __construct($data = NULL) { /** * Optional. Name of the `Target`. Format is - * projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string @@ -190,7 +190,7 @@ public function getName() /** * Optional. Name of the `Target`. Format is - * projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}. + * `projects/{project}/locations/{location}/targets/[a-z][a-z0-9\-]{0,62}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var diff --git a/Deploy/src/V1/TargetAttribute.php b/Deploy/src/V1/TargetAttribute.php new file mode 100644 index 000000000000..874ac4a9b837 --- /dev/null +++ b/Deploy/src/V1/TargetAttribute.php @@ -0,0 +1,120 @@ +google.cloud.deploy.v1.TargetAttribute + */ +class TargetAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the `Target`. The value of this field could be one of the + * following: + * * The last segment of a target name. It only needs the ID to determine + * which target is being referred to + * * "*", all targets in a location. + * + * Generated from protobuf field string id = 1; + */ + private $id = ''; + /** + * Target labels. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $id + * ID of the `Target`. The value of this field could be one of the + * following: + * * The last segment of a target name. It only needs the ID to determine + * which target is being referred to + * * "*", all targets in a location. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Target labels. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * ID of the `Target`. The value of this field could be one of the + * following: + * * The last segment of a target name. It only needs the ID to determine + * which target is being referred to + * * "*", all targets in a location. + * + * Generated from protobuf field string id = 1; + * @return string + */ + public function getId() + { + return $this->id; + } + + /** + * ID of the `Target`. The value of this field could be one of the + * following: + * * The last segment of a target name. It only needs the ID to determine + * which target is being referred to + * * "*", all targets in a location. + * + * Generated from protobuf field string id = 1; + * @param string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkString($var, True); + $this->id = $var; + + return $this; + } + + /** + * Target labels. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Target labels. + * + * Generated from protobuf field map labels = 2; + * @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; + } + +} + diff --git a/Deploy/src/V1/TargetsPresentCondition.php b/Deploy/src/V1/TargetsPresentCondition.php index 48b39286a3e7..7fa8a10f8d42 100644 --- a/Deploy/src/V1/TargetsPresentCondition.php +++ b/Deploy/src/V1/TargetsPresentCondition.php @@ -24,7 +24,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message private $status = false; /** * The list of Target names that do not exist. For example, - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { */ @@ -46,7 +46,7 @@ class TargetsPresentCondition extends \Google\Protobuf\Internal\Message * True if there aren't any missing Targets. * @type array|\Google\Protobuf\Internal\RepeatedField $missing_targets * The list of Target names that do not exist. For example, - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * @type \Google\Protobuf\Timestamp $update_time * Last time the condition was updated. * } @@ -84,7 +84,7 @@ public function setStatus($var) /** * The list of Target names that do not exist. For example, - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { * @return \Google\Protobuf\Internal\RepeatedField @@ -96,7 +96,7 @@ public function getMissingTargets() /** * The list of Target names that do not exist. For example, - * projects/{project_id}/locations/{location_name}/targets/{target_name}. + * `projects/{project_id}/locations/{location_name}/targets/{target_name}`. * * Generated from protobuf field repeated string missing_targets = 2 [(.google.api.resource_reference) = { * @param array|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Deploy/src/V1/TerminateJobRunRequest.php b/Deploy/src/V1/TerminateJobRunRequest.php index 9a47303c4748..0f065707dcfe 100644 --- a/Deploy/src/V1/TerminateJobRunRequest.php +++ b/Deploy/src/V1/TerminateJobRunRequest.php @@ -17,8 +17,7 @@ class TerminateJobRunRequest extends \Google\Protobuf\Internal\Message { /** * Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ @@ -26,8 +25,7 @@ class TerminateJobRunRequest extends \Google\Protobuf\Internal\Message /** * @param string $name Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. Please see + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. Please see * {@see CloudDeployClient::jobRunName()} for help formatting this field. * * @return \Google\Cloud\Deploy\V1\TerminateJobRunRequest @@ -48,8 +46,7 @@ public static function build(string $name): self * * @type string $name * Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. * } */ public function __construct($data = NULL) { @@ -59,8 +56,7 @@ public function __construct($data = NULL) { /** * Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @return string @@ -72,8 +68,7 @@ public function getName() /** * Required. Name of the `JobRun`. Format must be - * projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/ - * releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}. + * `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{jobRun}`. * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/UpdateAutomationRequest.php b/Deploy/src/V1/UpdateAutomationRequest.php new file mode 100644 index 000000000000..4a1c75e22060 --- /dev/null +++ b/Deploy/src/V1/UpdateAutomationRequest.php @@ -0,0 +1,306 @@ +google.cloud.deploy.v1.UpdateAutomationRequest + */ +class UpdateAutomationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $update_mask = null; + /** + * Required. The `Automation` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $automation = null; + /** + * Optional. A 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $request_id = ''; + /** + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $allow_missing = false; + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $validate_only = false; + + /** + * @param \Google\Cloud\Deploy\V1\Automation $automation Required. The `Automation` to update. + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\Deploy\V1\UpdateAutomationRequest + * + * @experimental + */ + public static function build(\Google\Cloud\Deploy\V1\Automation $automation, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setAutomation($automation) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\Deploy\V1\Automation $automation + * Required. The `Automation` to update. + * @type string $request_id + * Optional. A 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 bool $allow_missing + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * @type bool $validate_only + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Deploy\V1\CloudDeploy::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `Automation` resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The `Automation` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Deploy\V1\Automation|null + */ + public function getAutomation() + { + return $this->automation; + } + + public function hasAutomation() + { + return isset($this->automation); + } + + public function clearAutomation() + { + unset($this->automation); + } + + /** + * Required. The `Automation` to update. + * + * Generated from protobuf field .google.cloud.deploy.v1.Automation automation = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Deploy\V1\Automation $var + * @return $this + */ + public function setAutomation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Deploy\V1\Automation::class); + $this->automation = $var; + + return $this; + } + + /** + * Optional. A 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A 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 = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, updating a `Automation` that does not exist will + * result in the creation of a new `Automation`. + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set to true, the request is validated and the user is provided + * with an expected result, but no actual change is made. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/Deploy/src/V1/VerifyJobRun.php b/Deploy/src/V1/VerifyJobRun.php index a30313ea6956..a3442a60bc4d 100644 --- a/Deploy/src/V1/VerifyJobRun.php +++ b/Deploy/src/V1/VerifyJobRun.php @@ -18,7 +18,7 @@ class VerifyJobRun extends \Google\Protobuf\Internal\Message /** * Output only. The resource name of the Cloud Build `Build` object that is * used to verify. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { */ @@ -60,7 +60,7 @@ class VerifyJobRun extends \Google\Protobuf\Internal\Message * @type string $build * Output only. The resource name of the Cloud Build `Build` object that is * used to verify. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * @type string $artifact_uri * Output only. URI of a directory containing the verify artifacts. This * contains the Skaffold event log. @@ -82,7 +82,7 @@ public function __construct($data = NULL) { /** * Output only. The resource name of the Cloud Build `Build` object that is * used to verify. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @return string @@ -95,7 +95,7 @@ public function getBuild() /** * Output only. The resource name of the Cloud Build `Build` object that is * used to verify. Format is - * projects/{project}/locations/{location}/builds/{build}. + * `projects/{project}/locations/{location}/builds/{build}`. * * Generated from protobuf field string build = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { * @param string $var diff --git a/Deploy/src/V1/VerifyJobRun/FailureCause.php b/Deploy/src/V1/VerifyJobRun/FailureCause.php index d6f3ea44152c..f798d1daf9c4 100644 --- a/Deploy/src/V1/VerifyJobRun/FailureCause.php +++ b/Deploy/src/V1/VerifyJobRun/FailureCause.php @@ -35,7 +35,7 @@ class FailureCause */ const EXECUTION_FAILED = 2; /** - * The verify build did not complete within the alloted time. + * The verify job run did not complete within the alloted time. * * Generated from protobuf enum DEADLINE_EXCEEDED = 3; */ diff --git a/Deploy/src/V1/gapic_metadata.json b/Deploy/src/V1/gapic_metadata.json index e1488c9b4b7c..d4c4c7e8eb5e 100644 --- a/Deploy/src/V1/gapic_metadata.json +++ b/Deploy/src/V1/gapic_metadata.json @@ -25,11 +25,21 @@ "approveRollout" ] }, + "CancelAutomationRun": { + "methods": [ + "cancelAutomationRun" + ] + }, "CancelRollout": { "methods": [ "cancelRollout" ] }, + "CreateAutomation": { + "methods": [ + "createAutomation" + ] + }, "CreateDeliveryPipeline": { "methods": [ "createDeliveryPipeline" @@ -50,6 +60,11 @@ "createTarget" ] }, + "DeleteAutomation": { + "methods": [ + "deleteAutomation" + ] + }, "DeleteDeliveryPipeline": { "methods": [ "deleteDeliveryPipeline" @@ -60,6 +75,16 @@ "deleteTarget" ] }, + "GetAutomation": { + "methods": [ + "getAutomation" + ] + }, + "GetAutomationRun": { + "methods": [ + "getAutomationRun" + ] + }, "GetConfig": { "methods": [ "getConfig" @@ -95,6 +120,16 @@ "ignoreJob" ] }, + "ListAutomationRuns": { + "methods": [ + "listAutomationRuns" + ] + }, + "ListAutomations": { + "methods": [ + "listAutomations" + ] + }, "ListDeliveryPipelines": { "methods": [ "listDeliveryPipelines" @@ -125,11 +160,21 @@ "retryJob" ] }, + "RollbackTarget": { + "methods": [ + "rollbackTarget" + ] + }, "TerminateJobRun": { "methods": [ "terminateJobRun" ] }, + "UpdateAutomation": { + "methods": [ + "updateAutomation" + ] + }, "UpdateDeliveryPipeline": { "methods": [ "updateDeliveryPipeline" diff --git a/Deploy/src/V1/resources/cloud_deploy_client_config.json b/Deploy/src/V1/resources/cloud_deploy_client_config.json index 271aff1addc5..d63f1508627a 100644 --- a/Deploy/src/V1/resources/cloud_deploy_client_config.json +++ b/Deploy/src/V1/resources/cloud_deploy_client_config.json @@ -53,11 +53,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CancelAutomationRun": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CancelRollout": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateAutomation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateDeliveryPipeline": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -78,6 +88,11 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteAutomation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "DeleteDeliveryPipeline": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -88,6 +103,16 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetAutomation": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetAutomationRun": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "GetConfig": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -123,6 +148,16 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListAutomationRuns": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListAutomations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "ListDeliveryPipelines": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", @@ -153,11 +188,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "RollbackTarget": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, "TerminateJobRun": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateAutomation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "UpdateDeliveryPipeline": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php index 3cad10a76835..9dc45b7543a6 100644 --- a/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php +++ b/Deploy/src/V1/resources/cloud_deploy_descriptor_config.php @@ -3,6 +3,25 @@ return [ 'interfaces' => [ 'google.cloud.deploy.v1.CloudDeploy' => [ + 'CreateAutomation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Automation', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateDeliveryPipeline' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeliveryPipeline', @@ -79,6 +98,25 @@ ], ], ], + 'DeleteAutomation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteDeliveryPipeline' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -117,6 +155,26 @@ ], ], ], + 'UpdateAutomation' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Deploy\V1\Automation', + 'metadataReturnType' => '\Google\Cloud\Deploy\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'automation.name', + 'fieldAccessors' => [ + 'getAutomation', + 'getName', + ], + ], + ], + ], 'UpdateDeliveryPipeline' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\Deploy\V1\DeliveryPipeline', @@ -193,6 +251,18 @@ ], ], ], + 'CancelAutomationRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\CancelAutomationRunResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'CancelRollout' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Deploy\V1\CancelRolloutResponse', @@ -205,6 +275,30 @@ ], ], ], + 'GetAutomation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\Automation', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetAutomationRun' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\AutomationRun', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetConfig' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Deploy\V1\Config', @@ -289,6 +383,46 @@ ], ], ], + 'ListAutomationRuns' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAutomationRuns', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\ListAutomationRunsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListAutomations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getAutomations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\ListAutomationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListDeliveryPipelines' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -401,6 +535,18 @@ ], ], ], + 'RollbackTarget' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Deploy\V1\RollbackTargetResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'TerminateJobRun' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Deploy\V1\TerminateJobRunResponse', @@ -487,10 +633,13 @@ 'interfaceOverride' => 'google.iam.v1.IAMPolicy', ], 'templateMap' => [ + 'automation' => 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automations/{automation}', + 'automationRun' => 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}', 'build' => 'projects/{project}/locations/{location}/builds/{build}', 'cluster' => 'projects/{project}/locations/{location}/clusters/{cluster}', 'config' => 'projects/{project}/locations/{location}/config', 'deliveryPipeline' => 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}', + 'job' => 'projects/{project}/locations/{location}/jobs/{job}', 'jobRun' => 'projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/releases/{release}/rollouts/{rollout}/jobRuns/{job_run}', 'location' => 'projects/{project}/locations/{location}', 'membership' => 'projects/{project}/locations/{location}/memberships/{membership}', diff --git a/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php index 2e27a1e28f5d..195a392e0a34 100644 --- a/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php +++ b/Deploy/src/V1/resources/cloud_deploy_rest_client_config.php @@ -39,6 +39,18 @@ ], ], ], + 'CancelAutomationRun' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/automationRuns/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'CancelRollout' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*}:cancel', @@ -51,6 +63,21 @@ ], ], ], + 'CreateAutomation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/automations', + 'body' => 'automation', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'automation_id', + ], + ], 'CreateDeliveryPipeline' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deliveryPipelines', @@ -111,6 +138,17 @@ 'target_id', ], ], + 'DeleteAutomation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/automations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteDeliveryPipeline' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*}', @@ -133,6 +171,28 @@ ], ], ], + 'GetAutomation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/automations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetAutomationRun' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/automationRuns/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetConfig' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/config}', @@ -211,6 +271,28 @@ ], ], ], + 'ListAutomationRuns' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/automationRuns', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListAutomations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/deliveryPipelines/*}/automations', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListDeliveryPipelines' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/deliveryPipelines', @@ -278,6 +360,18 @@ ], ], ], + 'RollbackTarget' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*}:rollbackTarget', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'TerminateJobRun' => [ 'method' => 'post', 'uriTemplate' => '/v1/{name=projects/*/locations/*/deliveryPipelines/*/releases/*/rollouts/*/jobRuns/*}:terminate', @@ -290,6 +384,22 @@ ], ], ], + 'UpdateAutomation' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{automation.name=projects/*/locations/*/deliveryPipelines/*/automations/*}', + 'body' => 'automation', + 'placeholders' => [ + 'automation.name' => [ + 'getters' => [ + 'getAutomation', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], 'UpdateDeliveryPipeline' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{delivery_pipeline.name=projects/*/locations/*/deliveryPipelines/*}', diff --git a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php index 5ac54ab9a28d..4efd5d166478 100644 --- a/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php +++ b/Deploy/tests/Unit/V1/Client/CloudDeployClientTest.php @@ -33,17 +33,26 @@ use Google\Cloud\Deploy\V1\AdvanceRolloutResponse; use Google\Cloud\Deploy\V1\ApproveRolloutRequest; use Google\Cloud\Deploy\V1\ApproveRolloutResponse; +use Google\Cloud\Deploy\V1\Automation; +use Google\Cloud\Deploy\V1\AutomationResourceSelector; +use Google\Cloud\Deploy\V1\AutomationRun; +use Google\Cloud\Deploy\V1\CancelAutomationRunRequest; +use Google\Cloud\Deploy\V1\CancelAutomationRunResponse; use Google\Cloud\Deploy\V1\CancelRolloutRequest; use Google\Cloud\Deploy\V1\CancelRolloutResponse; use Google\Cloud\Deploy\V1\Client\CloudDeployClient; use Google\Cloud\Deploy\V1\Config; +use Google\Cloud\Deploy\V1\CreateAutomationRequest; use Google\Cloud\Deploy\V1\CreateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\CreateReleaseRequest; use Google\Cloud\Deploy\V1\CreateRolloutRequest; use Google\Cloud\Deploy\V1\CreateTargetRequest; +use Google\Cloud\Deploy\V1\DeleteAutomationRequest; use Google\Cloud\Deploy\V1\DeleteDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\DeleteTargetRequest; use Google\Cloud\Deploy\V1\DeliveryPipeline; +use Google\Cloud\Deploy\V1\GetAutomationRequest; +use Google\Cloud\Deploy\V1\GetAutomationRunRequest; use Google\Cloud\Deploy\V1\GetConfigRequest; use Google\Cloud\Deploy\V1\GetDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\GetJobRunRequest; @@ -53,6 +62,10 @@ use Google\Cloud\Deploy\V1\IgnoreJobRequest; use Google\Cloud\Deploy\V1\IgnoreJobResponse; use Google\Cloud\Deploy\V1\JobRun; +use Google\Cloud\Deploy\V1\ListAutomationRunsRequest; +use Google\Cloud\Deploy\V1\ListAutomationRunsResponse; +use Google\Cloud\Deploy\V1\ListAutomationsRequest; +use Google\Cloud\Deploy\V1\ListAutomationsResponse; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesRequest; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse; use Google\Cloud\Deploy\V1\ListJobRunsRequest; @@ -66,10 +79,13 @@ use Google\Cloud\Deploy\V1\Release; use Google\Cloud\Deploy\V1\RetryJobRequest; use Google\Cloud\Deploy\V1\RetryJobResponse; +use Google\Cloud\Deploy\V1\RollbackTargetRequest; +use Google\Cloud\Deploy\V1\RollbackTargetResponse; use Google\Cloud\Deploy\V1\Rollout; use Google\Cloud\Deploy\V1\Target; use Google\Cloud\Deploy\V1\TerminateJobRunRequest; use Google\Cloud\Deploy\V1\TerminateJobRunResponse; +use Google\Cloud\Deploy\V1\UpdateAutomationRequest; use Google\Cloud\Deploy\V1\UpdateDeliveryPipelineRequest; use Google\Cloud\Deploy\V1\UpdateTargetRequest; use Google\Cloud\Iam\V1\GetIamPolicyRequest; @@ -315,6 +331,68 @@ public function approveRolloutExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function cancelAutomationRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CancelAutomationRunResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $request = (new CancelAutomationRunRequest()) + ->setName($formattedName); + $response = $gapicClient->cancelAutomationRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CancelAutomationRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelAutomationRunExceptionTest() + { + $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->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $request = (new CancelAutomationRunRequest()) + ->setName($formattedName); + try { + $gapicClient->cancelAutomationRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function cancelRolloutTest() { @@ -377,6 +455,163 @@ public function cancelRolloutExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createAutomationTest() + { + $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/createAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAutomationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $automationId = 'automationId1989390659'; + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $request = (new CreateAutomationRequest()) + ->setParent($formattedParent) + ->setAutomationId($automationId) + ->setAutomation($automation); + $response = $gapicClient->createAutomation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/CreateAutomation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAutomationId(); + $this->assertProtobufEquals($automationId, $actualValue); + $actualValue = $actualApiRequestObject->getAutomation(); + $this->assertProtobufEquals($automation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAutomationTest'); + $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 createAutomationExceptionTest() + { + $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/createAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $automationId = 'automationId1989390659'; + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $request = (new CreateAutomationRequest()) + ->setParent($formattedParent) + ->setAutomationId($automationId) + ->setAutomation($automation); + $response = $gapicClient->createAutomation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAutomationTest'); + 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 createDeliveryPipelineTest() { @@ -698,6 +933,7 @@ public function createRolloutTest() $deployingBuild = 'deployingBuild931623626'; $etag = 'etag3123477'; $controllerRollout = 'controllerRollout-146558962'; + $rollbackOfRollout = 'rollbackOfRollout-1880699004'; $expectedResponse = new Rollout(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -707,6 +943,7 @@ public function createRolloutTest() $expectedResponse->setDeployingBuild($deployingBuild); $expectedResponse->setEtag($etag); $expectedResponse->setControllerRollout($controllerRollout); + $expectedResponse->setRollbackOfRollout($rollbackOfRollout); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -968,7 +1205,7 @@ public function createTargetExceptionTest() } /** @test */ - public function deleteDeliveryPipelineTest() + public function deleteAutomationTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -985,22 +1222,22 @@ public function deleteDeliveryPipelineTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $incompleteOperation->setName('operations/deleteAutomationTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDeliveryPipelineTest'); + $completeOperation->setName('operations/deleteAutomationTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new DeleteDeliveryPipelineRequest()) + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $request = (new DeleteAutomationRequest()) ->setName($formattedName); - $response = $gapicClient->deleteDeliveryPipeline($request); + $response = $gapicClient->deleteAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1009,11 +1246,11 @@ public function deleteDeliveryPipelineTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteAutomation', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1032,7 +1269,7 @@ public function deleteDeliveryPipelineTest() } /** @test */ - public function deleteDeliveryPipelineExceptionTest() + public function deleteAutomationExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1049,7 +1286,7 @@ public function deleteDeliveryPipelineExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $incompleteOperation->setName('operations/deleteAutomationTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1063,14 +1300,14 @@ public function deleteDeliveryPipelineExceptionTest() ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $request = (new DeleteDeliveryPipelineRequest()) + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $request = (new DeleteAutomationRequest()) ->setName($formattedName); - $response = $gapicClient->deleteDeliveryPipeline($request); + $response = $gapicClient->deleteAutomation($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1089,7 +1326,7 @@ public function deleteDeliveryPipelineExceptionTest() } /** @test */ - public function deleteTargetTest() + public function deleteDeliveryPipelineTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1106,22 +1343,22 @@ public function deleteTargetTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTargetTest'); + $completeOperation->setName('operations/deleteDeliveryPipelineTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new DeleteTargetRequest()) + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new DeleteDeliveryPipelineRequest()) ->setName($formattedName); - $response = $gapicClient->deleteTarget($request); + $response = $gapicClient->deleteDeliveryPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1130,11 +1367,11 @@ public function deleteTargetTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1153,7 +1390,7 @@ public function deleteTargetTest() } /** @test */ - public function deleteTargetExceptionTest() + public function deleteDeliveryPipelineExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1170,7 +1407,7 @@ public function deleteTargetExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1184,14 +1421,14 @@ public function deleteTargetExceptionTest() ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new DeleteTargetRequest()) + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new DeleteDeliveryPipelineRequest()) ->setName($formattedName); - $response = $gapicClient->deleteTarget($request); + $response = $gapicClient->deleteDeliveryPipeline($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1210,36 +1447,307 @@ public function deleteTargetExceptionTest() } /** @test */ - public function getConfigTest() + public function deleteTargetTest() { + $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 - $name2 = 'name2-1052831874'; - $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; - $expectedResponse = new Config(); - $expectedResponse->setName($name2); - $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTargetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - $request = (new GetConfigRequest()) + $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $request = (new DeleteTargetRequest()) ->setName($formattedName); - $response = $gapicClient->getConfig($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - + $response = $gapicClient->deleteTarget($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $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 deleteTargetExceptionTest() + { + $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/deleteTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $request = (new DeleteTargetRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteTarget($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + 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 getAutomationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $request = (new GetAutomationRequest()) + ->setName($formattedName); + $response = $gapicClient->getAutomation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutomationExceptionTest() + { + $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->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $request = (new GetAutomationRequest()) + ->setName($formattedName); + try { + $gapicClient->getAutomation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutomationRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $serviceAccount = 'serviceAccount-1948028253'; + $targetId = 'targetId-815576439'; + $stateDescription = 'stateDescription1692226894'; + $ruleId = 'ruleId1548659006'; + $automationId = 'automationId1989390659'; + $expectedResponse = new AutomationRun(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setStateDescription($stateDescription); + $expectedResponse->setRuleId($ruleId); + $expectedResponse->setAutomationId($automationId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $request = (new GetAutomationRunRequest()) + ->setName($formattedName); + $response = $gapicClient->getAutomationRun($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetAutomationRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutomationRunExceptionTest() + { + $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->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $request = (new GetAutomationRunRequest()) + ->setName($formattedName); + try { + $gapicClient->getAutomationRun($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; + $expectedResponse = new Config(); + $expectedResponse->setName($name2); + $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); + $request = (new GetConfigRequest()) + ->setName($formattedName); + $response = $gapicClient->getConfig($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function getConfigExceptionTest() { @@ -1514,6 +2022,7 @@ public function getRolloutTest() $deployingBuild = 'deployingBuild931623626'; $etag = 'etag3123477'; $controllerRollout = 'controllerRollout-146558962'; + $rollbackOfRollout = 'rollbackOfRollout-1880699004'; $expectedResponse = new Rollout(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); @@ -1523,6 +2032,7 @@ public function getRolloutTest() $expectedResponse->setDeployingBuild($deployingBuild); $expectedResponse->setEtag($etag); $expectedResponse->setControllerRollout($controllerRollout); + $expectedResponse->setRollbackOfRollout($rollbackOfRollout); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); @@ -1599,23 +2109,169 @@ public function getTargetTest() $expectedResponse->setEtag($etag); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new GetTargetRequest()) - ->setName($formattedName); - $response = $gapicClient->getTarget($request); - $this->assertEquals($expectedResponse, $response); + $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $request = (new GetTargetRequest()) + ->setName($formattedName); + $response = $gapicClient->getTarget($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetTarget', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getTargetExceptionTest() + { + $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->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $request = (new GetTargetRequest()) + ->setName($formattedName); + try { + $gapicClient->getTarget($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function ignoreJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new IgnoreJobResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $phaseId = 'phaseId-1676299681'; + $jobId = 'jobId-1154752291'; + $request = (new IgnoreJobRequest()) + ->setRollout($formattedRollout) + ->setPhaseId($phaseId) + ->setJobId($jobId); + $response = $gapicClient->ignoreJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob', $actualFuncCall); + $actualValue = $actualRequestObject->getRollout(); + $this->assertProtobufEquals($formattedRollout, $actualValue); + $actualValue = $actualRequestObject->getPhaseId(); + $this->assertProtobufEquals($phaseId, $actualValue); + $actualValue = $actualRequestObject->getJobId(); + $this->assertProtobufEquals($jobId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function ignoreJobExceptionTest() + { + $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 + $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); + $phaseId = 'phaseId-1676299681'; + $jobId = 'jobId-1154752291'; + $request = (new IgnoreJobRequest()) + ->setRollout($formattedRollout) + ->setPhaseId($phaseId) + ->setJobId($jobId); + try { + $gapicClient->ignoreJob($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAutomationRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $automationRunsElement = new AutomationRun(); + $automationRuns = [ + $automationRunsElement, + ]; + $expectedResponse = new ListAutomationRunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAutomationRuns($automationRuns); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new ListAutomationRunsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAutomationRuns($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAutomationRuns()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/GetTarget', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomationRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getTargetExceptionTest() + public function listAutomationRunsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1633,11 +2289,11 @@ public function getTargetExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $request = (new GetTargetRequest()) - ->setName($formattedName); + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new ListAutomationRunsRequest()) + ->setParent($formattedParent); try { - $gapicClient->getTarget($request); + $gapicClient->listAutomationRuns($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -1650,7 +2306,7 @@ public function getTargetExceptionTest() } /** @test */ - public function ignoreJobTest() + public function listAutomationsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1658,34 +2314,36 @@ public function ignoreJobTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response - $expectedResponse = new IgnoreJobResponse(); + $nextPageToken = ''; + $automationsElement = new Automation(); + $automations = [ + $automationsElement, + ]; + $expectedResponse = new ListAutomationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAutomations($automations); $transport->addResponse($expectedResponse); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - $request = (new IgnoreJobRequest()) - ->setRollout($formattedRollout) - ->setPhaseId($phaseId) - ->setJobId($jobId); - $response = $gapicClient->ignoreJob($request); - $this->assertEquals($expectedResponse, $response); + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new ListAutomationsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listAutomations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAutomations()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/IgnoreJob', $actualFuncCall); - $actualValue = $actualRequestObject->getRollout(); - $this->assertProtobufEquals($formattedRollout, $actualValue); - $actualValue = $actualRequestObject->getPhaseId(); - $this->assertProtobufEquals($phaseId, $actualValue); - $actualValue = $actualRequestObject->getJobId(); - $this->assertProtobufEquals($jobId, $actualValue); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function ignoreJobExceptionTest() + public function listAutomationsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1703,15 +2361,11 @@ public function ignoreJobExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedRollout = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); - $phaseId = 'phaseId-1676299681'; - $jobId = 'jobId-1154752291'; - $request = (new IgnoreJobRequest()) - ->setRollout($formattedRollout) - ->setPhaseId($phaseId) - ->setJobId($jobId); + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $request = (new ListAutomationsRequest()) + ->setParent($formattedParent); try { - $gapicClient->ignoreJob($request); + $gapicClient->listAutomations($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2157,6 +2811,80 @@ public function retryJobExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function rollbackTargetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RollbackTargetResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $targetId = 'targetId-815576439'; + $rolloutId = 'rolloutId-91142551'; + $request = (new RollbackTargetRequest()) + ->setName($formattedName) + ->setTargetId($targetId) + ->setRolloutId($rolloutId); + $response = $gapicClient->rollbackTarget($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RollbackTarget', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getTargetId(); + $this->assertProtobufEquals($targetId, $actualValue); + $actualValue = $actualRequestObject->getRolloutId(); + $this->assertProtobufEquals($rolloutId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTargetExceptionTest() + { + $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->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $targetId = 'targetId-815576439'; + $rolloutId = 'rolloutId-91142551'; + $request = (new RollbackTargetRequest()) + ->setName($formattedName) + ->setTargetId($targetId) + ->setRolloutId($rolloutId); + try { + $gapicClient->rollbackTarget($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + /** @test */ public function terminateJobRunTest() { @@ -2219,6 +2947,157 @@ public function terminateJobRunExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateAutomationTest() + { + $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/updateAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAutomationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $request = (new UpdateAutomationRequest()) + ->setUpdateMask($updateMask) + ->setAutomation($automation); + $response = $gapicClient->updateAutomation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/UpdateAutomation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getAutomation(); + $this->assertProtobufEquals($automation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); + $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 updateAutomationExceptionTest() + { + $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/updateAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $request = (new UpdateAutomationRequest()) + ->setUpdateMask($updateMask) + ->setAutomation($automation); + $response = $gapicClient->updateAutomation($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); + 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 updateDeliveryPipelineTest() { diff --git a/Deploy/tests/Unit/V1/CloudDeployClientTest.php b/Deploy/tests/Unit/V1/CloudDeployClientTest.php index 658269fa3c28..6e6b80b32d6b 100644 --- a/Deploy/tests/Unit/V1/CloudDeployClientTest.php +++ b/Deploy/tests/Unit/V1/CloudDeployClientTest.php @@ -30,12 +30,18 @@ use Google\Cloud\Deploy\V1\AbandonReleaseResponse; use Google\Cloud\Deploy\V1\AdvanceRolloutResponse; use Google\Cloud\Deploy\V1\ApproveRolloutResponse; +use Google\Cloud\Deploy\V1\Automation; +use Google\Cloud\Deploy\V1\AutomationResourceSelector; +use Google\Cloud\Deploy\V1\AutomationRun; +use Google\Cloud\Deploy\V1\CancelAutomationRunResponse; use Google\Cloud\Deploy\V1\CancelRolloutResponse; use Google\Cloud\Deploy\V1\CloudDeployClient; use Google\Cloud\Deploy\V1\Config; use Google\Cloud\Deploy\V1\DeliveryPipeline; use Google\Cloud\Deploy\V1\IgnoreJobResponse; use Google\Cloud\Deploy\V1\JobRun; +use Google\Cloud\Deploy\V1\ListAutomationRunsResponse; +use Google\Cloud\Deploy\V1\ListAutomationsResponse; use Google\Cloud\Deploy\V1\ListDeliveryPipelinesResponse; use Google\Cloud\Deploy\V1\ListJobRunsResponse; use Google\Cloud\Deploy\V1\ListReleasesResponse; @@ -43,6 +49,7 @@ use Google\Cloud\Deploy\V1\ListTargetsResponse; use Google\Cloud\Deploy\V1\Release; use Google\Cloud\Deploy\V1\RetryJobResponse; +use Google\Cloud\Deploy\V1\RollbackTargetResponse; use Google\Cloud\Deploy\V1\Rollout; use Google\Cloud\Deploy\V1\Target; use Google\Cloud\Deploy\V1\TerminateJobRunResponse; @@ -268,6 +275,64 @@ public function approveRolloutExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function cancelAutomationRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new CancelAutomationRunResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $response = $gapicClient->cancelAutomationRun($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.deploy.v1.CloudDeploy/CancelAutomationRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function cancelAutomationRunExceptionTest() + { + $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->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + try { + $gapicClient->cancelAutomationRun($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 cancelRolloutTest() { @@ -326,6 +391,155 @@ public function cancelRolloutExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function createAutomationTest() + { + $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/createAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createAutomationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $automationId = 'automationId1989390659'; + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation); + $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.deploy.v1.CloudDeploy/CreateAutomation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getAutomationId(); + $this->assertProtobufEquals($automationId, $actualValue); + $actualValue = $actualApiRequestObject->getAutomation(); + $this->assertProtobufEquals($automation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAutomationTest'); + $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 createAutomationExceptionTest() + { + $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/createAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $automationId = 'automationId1989390659'; + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $response = $gapicClient->createAutomation($formattedParent, $automationId, $automation); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createAutomationTest'); + 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 createDeliveryPipelineTest() { @@ -631,6 +845,7 @@ public function createRolloutTest() $deployingBuild = 'deployingBuild931623626'; $etag = 'etag3123477'; $controllerRollout = 'controllerRollout-146558962'; + $rollbackOfRollout = 'rollbackOfRollout-1880699004'; $expectedResponse = new Rollout(); $expectedResponse->setName($name); $expectedResponse->setUid($uid); @@ -640,6 +855,7 @@ public function createRolloutTest() $expectedResponse->setDeployingBuild($deployingBuild); $expectedResponse->setEtag($etag); $expectedResponse->setControllerRollout($controllerRollout); + $expectedResponse->setRollbackOfRollout($rollbackOfRollout); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); @@ -885,7 +1101,7 @@ public function createTargetExceptionTest() } /** @test */ - public function deleteDeliveryPipelineTest() + public function deleteAutomationTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -902,20 +1118,20 @@ public function deleteDeliveryPipelineTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $incompleteOperation->setName('operations/deleteAutomationTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteDeliveryPipelineTest'); + $completeOperation->setName('operations/deleteAutomationTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->deleteDeliveryPipeline($formattedName); + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $response = $gapicClient->deleteAutomation($formattedName); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -924,11 +1140,11 @@ public function deleteDeliveryPipelineTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteAutomation', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -947,7 +1163,7 @@ public function deleteDeliveryPipelineTest() } /** @test */ - public function deleteDeliveryPipelineExceptionTest() + public function deleteAutomationExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -964,7 +1180,7 @@ public function deleteDeliveryPipelineExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); + $incompleteOperation->setName('operations/deleteAutomationTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -978,12 +1194,12 @@ public function deleteDeliveryPipelineExceptionTest() ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); - $response = $gapicClient->deleteDeliveryPipeline($formattedName); + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $response = $gapicClient->deleteAutomation($formattedName); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); + $expectedOperationsRequestObject->setName('operations/deleteAutomationTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1002,7 +1218,7 @@ public function deleteDeliveryPipelineExceptionTest() } /** @test */ - public function deleteTargetTest() + public function deleteDeliveryPipelineTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1019,20 +1235,20 @@ public function deleteTargetTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTargetTest'); + $completeOperation->setName('operations/deleteDeliveryPipelineTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $response = $gapicClient->deleteTarget($formattedName); + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $gapicClient->deleteDeliveryPipeline($formattedName); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1041,11 +1257,11 @@ public function deleteTargetTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/DeleteDeliveryPipeline', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1064,7 +1280,7 @@ public function deleteTargetTest() } /** @test */ - public function deleteTargetExceptionTest() + public function deleteDeliveryPipelineExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1081,7 +1297,7 @@ public function deleteTargetExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setName('operations/deleteDeliveryPipelineTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1095,12 +1311,12 @@ public function deleteTargetExceptionTest() ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); - $response = $gapicClient->deleteTarget($formattedName); + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $gapicClient->deleteDeliveryPipeline($formattedName); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $expectedOperationsRequestObject->setName('operations/deleteDeliveryPipelineTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1119,36 +1335,295 @@ public function deleteTargetExceptionTest() } /** @test */ - public function getConfigTest() + public function deleteTargetTest() { + $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 - $name2 = 'name2-1052831874'; - $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; - $expectedResponse = new Config(); - $expectedResponse->setName($name2); - $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTargetTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->getConfig($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.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); + $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $response = $gapicClient->deleteTarget($formattedName); + $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.deploy.v1.CloudDeploy/DeleteTarget', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConfigExceptionTest() + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + $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 deleteTargetExceptionTest() + { + $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/deleteTargetTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->targetName('[PROJECT]', '[LOCATION]', '[TARGET]'); + $response = $gapicClient->deleteTarget($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTargetTest'); + 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 getAutomationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + $response = $gapicClient->getAutomation($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.deploy.v1.CloudDeploy/GetAutomation', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutomationExceptionTest() + { + $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->automationName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION]'); + try { + $gapicClient->getAutomation($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 getAutomationRunTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $etag = 'etag3123477'; + $serviceAccount = 'serviceAccount-1948028253'; + $targetId = 'targetId-815576439'; + $stateDescription = 'stateDescription1692226894'; + $ruleId = 'ruleId1548659006'; + $automationId = 'automationId1989390659'; + $expectedResponse = new AutomationRun(); + $expectedResponse->setName($name2); + $expectedResponse->setEtag($etag); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setTargetId($targetId); + $expectedResponse->setStateDescription($stateDescription); + $expectedResponse->setRuleId($ruleId); + $expectedResponse->setAutomationId($automationId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + $response = $gapicClient->getAutomationRun($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.deploy.v1.CloudDeploy/GetAutomationRun', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getAutomationRunExceptionTest() + { + $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->automationRunName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[AUTOMATION_RUN]'); + try { + $gapicClient->getAutomationRun($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 getConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $defaultSkaffoldVersion = 'defaultSkaffoldVersion1930298837'; + $expectedResponse = new Config(); + $expectedResponse->setName($name2); + $expectedResponse->setDefaultSkaffoldVersion($defaultSkaffoldVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->configName('[PROJECT]', '[LOCATION]'); + $response = $gapicClient->getConfig($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.deploy.v1.CloudDeploy/GetConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConfigExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -1407,6 +1882,7 @@ public function getRolloutTest() $deployingBuild = 'deployingBuild931623626'; $etag = 'etag3123477'; $controllerRollout = 'controllerRollout-146558962'; + $rollbackOfRollout = 'rollbackOfRollout-1880699004'; $expectedResponse = new Rollout(); $expectedResponse->setName($name2); $expectedResponse->setUid($uid); @@ -1416,6 +1892,7 @@ public function getRolloutTest() $expectedResponse->setDeployingBuild($deployingBuild); $expectedResponse->setEtag($etag); $expectedResponse->setControllerRollout($controllerRollout); + $expectedResponse->setRollbackOfRollout($rollbackOfRollout); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->rolloutName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]', '[RELEASE]', '[ROLLOUT]'); @@ -1600,6 +2077,142 @@ public function ignoreJobExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function listAutomationRunsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $automationRunsElement = new AutomationRun(); + $automationRuns = [ + $automationRunsElement, + ]; + $expectedResponse = new ListAutomationRunsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAutomationRuns($automationRuns); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $gapicClient->listAutomationRuns($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAutomationRuns()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomationRuns', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAutomationRunsExceptionTest() + { + $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->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + try { + $gapicClient->listAutomationRuns($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 listAutomationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $automationsElement = new Automation(); + $automations = [ + $automationsElement, + ]; + $expectedResponse = new ListAutomationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setAutomations($automations); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $response = $gapicClient->listAutomations($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getAutomations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/ListAutomations', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listAutomationsExceptionTest() + { + $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->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + try { + $gapicClient->listAutomations($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 listDeliveryPipelinesTest() { @@ -2006,6 +2619,72 @@ public function retryJobExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function rollbackTargetTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RollbackTargetResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $targetId = 'targetId-815576439'; + $rolloutId = 'rolloutId-91142551'; + $response = $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.deploy.v1.CloudDeploy/RollbackTarget', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualRequestObject->getTargetId(); + $this->assertProtobufEquals($targetId, $actualValue); + $actualValue = $actualRequestObject->getRolloutId(); + $this->assertProtobufEquals($rolloutId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTargetExceptionTest() + { + $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->deliveryPipelineName('[PROJECT]', '[LOCATION]', '[DELIVERY_PIPELINE]'); + $targetId = 'targetId-815576439'; + $rolloutId = 'rolloutId-91142551'; + try { + $gapicClient->rollbackTarget($formattedName, $targetId, $rolloutId); + // 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 terminateJobRunTest() { @@ -2064,6 +2743,151 @@ public function terminateJobRunExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function updateAutomationTest() + { + $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/updateAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $description = 'description-1724546052'; + $etag = 'etag3123477'; + $suspended = false; + $serviceAccount = 'serviceAccount-1948028253'; + $expectedResponse = new Automation(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setDescription($description); + $expectedResponse->setEtag($etag); + $expectedResponse->setSuspended($suspended); + $expectedResponse->setServiceAccount($serviceAccount); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateAutomationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $updateMask = new FieldMask(); + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $response = $gapicClient->updateAutomation($updateMask, $automation); + $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.deploy.v1.CloudDeploy/UpdateAutomation', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $actualValue = $actualApiRequestObject->getAutomation(); + $this->assertProtobufEquals($automation, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); + $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 updateAutomationExceptionTest() + { + $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/updateAutomationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $updateMask = new FieldMask(); + $automation = new Automation(); + $automationServiceAccount = 'automationServiceAccount-192216401'; + $automation->setServiceAccount($automationServiceAccount); + $automationSelector = new AutomationResourceSelector(); + $automation->setSelector($automationSelector); + $automationRules = []; + $automation->setRules($automationRules); + $response = $gapicClient->updateAutomation($updateMask, $automation); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateAutomationTest'); + 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 updateDeliveryPipelineTest() {