From ed5264f3eb835104d2e827a0f9078844896e12be Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Thu, 13 Jun 2024 15:06:51 -0700 Subject: [PATCH] chore!: promote CloudBuild to V1 (#7393) --- .repo-metadata-full.json | 2 +- Build/.OwlBot.yaml | 2 +- Build/README.md | 5 +- Build/metadata/V1/Cloudbuild.php | Bin 27111 -> 0 bytes Build/owlbot.py | 49 +- Build/src/V1/ApprovalConfig.php | 75 - Build/src/V1/ApprovalResult.php | 230 -- Build/src/V1/ApprovalResult/Decision.php | 63 - Build/src/V1/ApproveBuildRequest.php | 115 - Build/src/V1/ArtifactResult.php | 110 - Build/src/V1/Artifacts.php | 314 --- Build/src/V1/Artifacts/ArtifactObjects.php | 163 -- Build/src/V1/Artifacts/MavenArtifact.php | 249 -- Build/src/V1/Artifacts/NpmPackage.php | 119 - Build/src/V1/Artifacts/PythonPackage.php | 124 - Build/src/V1/Build.php | 1316 ---------- Build/src/V1/Build/FailureInfo.php | 102 - .../src/V1/Build/FailureInfo/FailureType.php | 91 - Build/src/V1/Build/Status.php | 112 - Build/src/V1/Build/Warning.php | 102 - Build/src/V1/Build/Warning/Priority.php | 69 - Build/src/V1/BuildApproval.php | 156 -- Build/src/V1/BuildApproval/State.php | 76 - Build/src/V1/BuildOperationMetadata.php | 77 - Build/src/V1/BuildOptions.php | 678 ------ .../DefaultLogsBucketBehavior.php | 57 - .../V1/BuildOptions/LogStreamingOption.php | 63 - Build/src/V1/BuildOptions/LoggingMode.php | 86 - Build/src/V1/BuildOptions/MachineType.php | 85 - Build/src/V1/BuildOptions/PoolOption.php | 83 - .../V1/BuildOptions/SubstitutionOption.php | 56 - Build/src/V1/BuildOptions/VerifyOption.php | 61 - Build/src/V1/BuildStep.php | 893 ------- Build/src/V1/BuildTrigger.php | 1026 -------- Build/src/V1/BuiltImage.php | 149 -- Build/src/V1/CancelBuildRequest.php | 139 -- Build/src/V1/CloudBuildClient.php | 34 - Build/src/V1/CreateBuildRequest.php | 149 -- Build/src/V1/CreateBuildTriggerRequest.php | 149 -- .../V1/CreateWorkerPoolOperationMetadata.php | 163 -- Build/src/V1/CreateWorkerPoolRequest.php | 199 -- Build/src/V1/DeleteBuildTriggerRequest.php | 139 -- .../V1/DeleteWorkerPoolOperationMetadata.php | 163 -- Build/src/V1/DeleteWorkerPoolRequest.php | 189 -- Build/src/V1/FileHashes.php | 68 - Build/src/V1/Gapic/CloudBuildGapicClient.php | 2136 ----------------- Build/src/V1/GetBuildRequest.php | 139 -- Build/src/V1/GetBuildTriggerRequest.php | 139 -- Build/src/V1/GetWorkerPoolRequest.php | 71 - Build/src/V1/GitFileSource.php | 303 --- Build/src/V1/GitFileSource/RepoType.php | 79 - Build/src/V1/GitHubEnterpriseConfig.php | 409 ---- Build/src/V1/GitHubEnterpriseSecrets.php | 171 -- Build/src/V1/GitHubEventsConfig.php | 228 -- Build/src/V1/GitRepoSource.php | 238 -- Build/src/V1/GitSource.php | 179 -- Build/src/V1/Hash.php | 101 - Build/src/V1/Hash/HashType.php | 69 - Build/src/V1/InlineSecret.php | 122 - Build/src/V1/ListBuildTriggersRequest.php | 173 -- Build/src/V1/ListBuildTriggersResponse.php | 101 - Build/src/V1/ListBuildsRequest.php | 227 -- Build/src/V1/ListBuildsResponse.php | 105 - Build/src/V1/ListWorkerPoolsRequest.php | 147 -- Build/src/V1/ListWorkerPoolsResponse.php | 109 - Build/src/V1/PrivatePoolV1Config.php | 121 - .../V1/PrivatePoolV1Config/NetworkConfig.php | 192 -- .../NetworkConfig/EgressOption.php | 64 - .../V1/PrivatePoolV1Config/WorkerConfig.php | 131 - Build/src/V1/PubsubConfig.php | 182 -- Build/src/V1/PubsubConfig/State.php | 77 - Build/src/V1/PullRequestFilter.php | 154 -- .../V1/PullRequestFilter/CommentControl.php | 64 - Build/src/V1/PushFilter.php | 158 -- Build/src/V1/ReceiveTriggerWebhookRequest.php | 218 -- .../src/V1/ReceiveTriggerWebhookResponse.php | 34 - Build/src/V1/RepoSource.php | 343 --- Build/src/V1/RepositoryEventConfig.php | 177 -- .../RepositoryEventConfig/RepositoryType.php | 69 - Build/src/V1/Results.php | 377 --- Build/src/V1/RetryBuildRequest.php | 139 -- Build/src/V1/RunBuildTriggerRequest.php | 187 -- Build/src/V1/Secret.php | 121 - Build/src/V1/SecretManagerSecret.php | 113 - Build/src/V1/Secrets.php | 105 - Build/src/V1/Source.php | 183 -- Build/src/V1/SourceProvenance.php | 244 -- Build/src/V1/StorageSource.php | 189 -- Build/src/V1/StorageSource/SourceFetcher.php | 62 - Build/src/V1/StorageSourceManifest.php | 153 -- Build/src/V1/TimeSpan.php | 121 - Build/src/V1/UpdateBuildTriggerRequest.php | 197 -- .../V1/UpdateWorkerPoolOperationMetadata.php | 163 -- Build/src/V1/UpdateWorkerPoolRequest.php | 167 -- Build/src/V1/UploadedMavenArtifact.php | 155 -- Build/src/V1/UploadedNpmPackage.php | 156 -- Build/src/V1/UploadedPythonPackage.php | 155 -- Build/src/V1/Volume.php | 118 - Build/src/V1/WebhookConfig.php | 114 - Build/src/V1/WebhookConfig/State.php | 63 - Build/src/V1/WorkerPool.php | 465 ---- Build/src/V1/WorkerPool/State.php | 83 - Build/src/V1/gapic_metadata.json | 108 - .../resources/cloud_build_client_config.json | 135 -- .../cloud_build_descriptor_config.php | 128 - .../cloud_build_rest_client_config.php | 465 ---- .../src/V2/BatchCreateRepositoriesRequest.php | 2 +- Build/src/V2/BitbucketCloudConfig.php | 8 +- Build/src/V2/BitbucketDataCenterConfig.php | 14 +- .../src/V2/Client/RepositoryManagerClient.php | 63 +- Build/src/V2/Connection.php | 14 +- Build/src/V2/CreateConnectionRequest.php | 6 +- Build/src/V2/CreateRepositoryRequest.php | 6 +- Build/src/V2/DeleteConnectionRequest.php | 6 +- Build/src/V2/DeleteRepositoryRequest.php | 6 +- Build/src/V2/FetchGitRefsRequest.php | 4 +- .../V2/FetchLinkableRepositoriesRequest.php | 6 +- .../V2/FetchLinkableRepositoriesResponse.php | 2 +- Build/src/V2/FetchReadTokenRequest.php | 2 +- Build/src/V2/FetchReadTokenResponse.php | 4 +- Build/src/V2/FetchReadWriteTokenRequest.php | 2 +- Build/src/V2/FetchReadWriteTokenResponse.php | 4 +- .../V2/Gapic/RepositoryManagerGapicClient.php | 1516 ------------ Build/src/V2/GetConnectionRequest.php | 2 +- Build/src/V2/GetRepositoryRequest.php | 2 +- Build/src/V2/GitHubConfig.php | 4 +- Build/src/V2/GitHubEnterpriseConfig.php | 20 +- Build/src/V2/GitLabConfig.php | 14 +- Build/src/V2/InstallationState.php | 6 +- Build/src/V2/ListConnectionsRequest.php | 6 +- Build/src/V2/ListConnectionsResponse.php | 2 +- Build/src/V2/ListRepositoriesRequest.php | 8 +- Build/src/V2/ListRepositoriesResponse.php | 2 +- Build/src/V2/OAuthCredential.php | 4 +- Build/src/V2/OperationMetadata.php | 14 +- Build/src/V2/ProcessWebhookRequest.php | 6 +- Build/src/V2/Repository.php | 12 +- Build/src/V2/RepositoryManagerClient.php | 34 - .../V2/RunWorkflowCustomOperationMetadata.php | 14 +- Build/src/V2/ServiceDirectoryConfig.php | 2 +- Build/src/V2/UpdateConnectionRequest.php | 8 +- Build/src/V2/UserCredential.php | 4 +- Build/tests/Unit/V1/CloudBuildClientTest.php | 1768 -------------- .../V2/Client/RepositoryManagerClientTest.php | 390 +-- .../Unit/V2/RepositoryManagerClientTest.php | 1530 ------------ 145 files changed, 378 insertions(+), 25385 deletions(-) delete mode 100644 Build/metadata/V1/Cloudbuild.php delete mode 100644 Build/src/V1/ApprovalConfig.php delete mode 100644 Build/src/V1/ApprovalResult.php delete mode 100644 Build/src/V1/ApprovalResult/Decision.php delete mode 100644 Build/src/V1/ApproveBuildRequest.php delete mode 100644 Build/src/V1/ArtifactResult.php delete mode 100644 Build/src/V1/Artifacts.php delete mode 100644 Build/src/V1/Artifacts/ArtifactObjects.php delete mode 100644 Build/src/V1/Artifacts/MavenArtifact.php delete mode 100644 Build/src/V1/Artifacts/NpmPackage.php delete mode 100644 Build/src/V1/Artifacts/PythonPackage.php delete mode 100644 Build/src/V1/Build.php delete mode 100644 Build/src/V1/Build/FailureInfo.php delete mode 100644 Build/src/V1/Build/FailureInfo/FailureType.php delete mode 100644 Build/src/V1/Build/Status.php delete mode 100644 Build/src/V1/Build/Warning.php delete mode 100644 Build/src/V1/Build/Warning/Priority.php delete mode 100644 Build/src/V1/BuildApproval.php delete mode 100644 Build/src/V1/BuildApproval/State.php delete mode 100644 Build/src/V1/BuildOperationMetadata.php delete mode 100644 Build/src/V1/BuildOptions.php delete mode 100644 Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php delete mode 100644 Build/src/V1/BuildOptions/LogStreamingOption.php delete mode 100644 Build/src/V1/BuildOptions/LoggingMode.php delete mode 100644 Build/src/V1/BuildOptions/MachineType.php delete mode 100644 Build/src/V1/BuildOptions/PoolOption.php delete mode 100644 Build/src/V1/BuildOptions/SubstitutionOption.php delete mode 100644 Build/src/V1/BuildOptions/VerifyOption.php delete mode 100644 Build/src/V1/BuildStep.php delete mode 100644 Build/src/V1/BuildTrigger.php delete mode 100644 Build/src/V1/BuiltImage.php delete mode 100644 Build/src/V1/CancelBuildRequest.php delete mode 100644 Build/src/V1/CloudBuildClient.php delete mode 100644 Build/src/V1/CreateBuildRequest.php delete mode 100644 Build/src/V1/CreateBuildTriggerRequest.php delete mode 100644 Build/src/V1/CreateWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/CreateWorkerPoolRequest.php delete mode 100644 Build/src/V1/DeleteBuildTriggerRequest.php delete mode 100644 Build/src/V1/DeleteWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/DeleteWorkerPoolRequest.php delete mode 100644 Build/src/V1/FileHashes.php delete mode 100644 Build/src/V1/Gapic/CloudBuildGapicClient.php delete mode 100644 Build/src/V1/GetBuildRequest.php delete mode 100644 Build/src/V1/GetBuildTriggerRequest.php delete mode 100644 Build/src/V1/GetWorkerPoolRequest.php delete mode 100644 Build/src/V1/GitFileSource.php delete mode 100644 Build/src/V1/GitFileSource/RepoType.php delete mode 100644 Build/src/V1/GitHubEnterpriseConfig.php delete mode 100644 Build/src/V1/GitHubEnterpriseSecrets.php delete mode 100644 Build/src/V1/GitHubEventsConfig.php delete mode 100644 Build/src/V1/GitRepoSource.php delete mode 100644 Build/src/V1/GitSource.php delete mode 100644 Build/src/V1/Hash.php delete mode 100644 Build/src/V1/Hash/HashType.php delete mode 100644 Build/src/V1/InlineSecret.php delete mode 100644 Build/src/V1/ListBuildTriggersRequest.php delete mode 100644 Build/src/V1/ListBuildTriggersResponse.php delete mode 100644 Build/src/V1/ListBuildsRequest.php delete mode 100644 Build/src/V1/ListBuildsResponse.php delete mode 100644 Build/src/V1/ListWorkerPoolsRequest.php delete mode 100644 Build/src/V1/ListWorkerPoolsResponse.php delete mode 100644 Build/src/V1/PrivatePoolV1Config.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/NetworkConfig.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php delete mode 100644 Build/src/V1/PrivatePoolV1Config/WorkerConfig.php delete mode 100644 Build/src/V1/PubsubConfig.php delete mode 100644 Build/src/V1/PubsubConfig/State.php delete mode 100644 Build/src/V1/PullRequestFilter.php delete mode 100644 Build/src/V1/PullRequestFilter/CommentControl.php delete mode 100644 Build/src/V1/PushFilter.php delete mode 100644 Build/src/V1/ReceiveTriggerWebhookRequest.php delete mode 100644 Build/src/V1/ReceiveTriggerWebhookResponse.php delete mode 100644 Build/src/V1/RepoSource.php delete mode 100644 Build/src/V1/RepositoryEventConfig.php delete mode 100644 Build/src/V1/RepositoryEventConfig/RepositoryType.php delete mode 100644 Build/src/V1/Results.php delete mode 100644 Build/src/V1/RetryBuildRequest.php delete mode 100644 Build/src/V1/RunBuildTriggerRequest.php delete mode 100644 Build/src/V1/Secret.php delete mode 100644 Build/src/V1/SecretManagerSecret.php delete mode 100644 Build/src/V1/Secrets.php delete mode 100644 Build/src/V1/Source.php delete mode 100644 Build/src/V1/SourceProvenance.php delete mode 100644 Build/src/V1/StorageSource.php delete mode 100644 Build/src/V1/StorageSource/SourceFetcher.php delete mode 100644 Build/src/V1/StorageSourceManifest.php delete mode 100644 Build/src/V1/TimeSpan.php delete mode 100644 Build/src/V1/UpdateBuildTriggerRequest.php delete mode 100644 Build/src/V1/UpdateWorkerPoolOperationMetadata.php delete mode 100644 Build/src/V1/UpdateWorkerPoolRequest.php delete mode 100644 Build/src/V1/UploadedMavenArtifact.php delete mode 100644 Build/src/V1/UploadedNpmPackage.php delete mode 100644 Build/src/V1/UploadedPythonPackage.php delete mode 100644 Build/src/V1/Volume.php delete mode 100644 Build/src/V1/WebhookConfig.php delete mode 100644 Build/src/V1/WebhookConfig/State.php delete mode 100644 Build/src/V1/WorkerPool.php delete mode 100644 Build/src/V1/WorkerPool/State.php delete mode 100644 Build/src/V1/gapic_metadata.json delete mode 100644 Build/src/V1/resources/cloud_build_client_config.json delete mode 100644 Build/src/V1/resources/cloud_build_descriptor_config.php delete mode 100644 Build/src/V1/resources/cloud_build_rest_client_config.php delete mode 100644 Build/src/V2/Gapic/RepositoryManagerGapicClient.php delete mode 100644 Build/src/V2/RepositoryManagerClient.php delete mode 100644 Build/tests/Unit/V1/CloudBuildClientTest.php delete mode 100644 Build/tests/Unit/V2/RepositoryManagerClientTest.php diff --git a/.repo-metadata-full.json b/.repo-metadata-full.json index 5f118c9523cb..b6647af51d98 100644 --- a/.repo-metadata-full.json +++ b/.repo-metadata-full.json @@ -342,7 +342,7 @@ "Build": { "language": "php", "distribution_name": "google/cloud-build", - "release_level": "preview", + "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-build/latest", "library_type": "GAPIC_AUTO", "api_shortname": "cloudbuild" diff --git a/Build/.OwlBot.yaml b/Build/.OwlBot.yaml index 8d979b80a8f0..bc7eeb8c4ad0 100644 --- a/Build/.OwlBot.yaml +++ b/Build/.OwlBot.yaml @@ -1,4 +1,4 @@ deep-copy-regex: - - source: /google/devtools/cloudbuild/(v1|v2)/.*-php/(.*) + - source: /google/devtools/cloudbuild/(v2)/.*-php/(.*) dest: /owl-bot-staging/Build/$1/$2 api-name: Build diff --git a/Build/README.md b/Build/README.md index 6644f633363a..4388a0c81f1c 100644 --- a/Build/README.md +++ b/Build/README.md @@ -30,9 +30,8 @@ on authenticating your client. Once authenticated, you'll be ready to start maki ### Version -This component is considered beta. As such, it should be expected to be mostly -stable and we're working towards a release candidate. We will address issues -and requests with a higher priority. +This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in +any minor or patch releases. We will address issues and requests with the highest priority. ### Next Steps diff --git a/Build/metadata/V1/Cloudbuild.php b/Build/metadata/V1/Cloudbuild.php deleted file mode 100644 index 0207fb8ecb26187d616d410057064b97e98afc3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27111 zcmdU2YiwJ|bq*;@mWGlnU%zPWdRM;t@_N10nqGSo?vs>giEBwz_^{)x5tgE^B-Rwk z@RD+zjnE=!fu#T1v?&@iL7JvX(H}*dCN0wTM}s0LuxNoI0Sa`{0x4P`zyj^RKHxv? zch1b*2TA#oau6i@V@+PpoS8Xu<~+W0=IXUKn>$VM)ZCI)w_4@4wK=zOf3Ce_%{5z% zcB9g$&24nHwyf4%rLo(r)~r@+Zf-FhNwrke>rnT2@ zG-~#IrPk&z&&{>0cBfT;mFGkZ;Uqi!b>?wVW@2X$PiRjqn^xIWjbR&6t7?UeVbjn;5om)q^;Mq~5-aJ_Pt z61Sn2mTPp{)%y0}L#;IG+pSK$j!t*7O*$FF@zW8L#g6Pd_|Q&Q>~DIv*&c#HPFLQR z)v|r}5W^O#IF{}5ZnJ-1J`gXyQB~rf+}w1e{W|o+1xG$fTAvet{9Z`JhSLnjIoUp@ zHA&3XB(c5Avu6~!a`h^F{ z3*y;;ffa>=$H&Clauk}FI}hU{VoYiaUS}l!ypqHNBrBG)nvFbLGxLLxn94(^m$xnX z#F!Ri8=cBst1XvK-y0jm4LPD=2(c}VC{zUxIAYuq({ci(EvsGGv0Bkltb0112$+a( z0GI}mS0aVWUgn@i!&d>wC5!k7``Eo-l8)B46}|I9xM z3*j=2SkNsY#&I#x0$WQgZoD_fDG}LdmFtxq`H*FB`9tVE-Y##;XDl9gb`l1^vAbJs zm+YM~Gj9S<)vS)v9MEL4THmu;?NZCywmumh$J22mFQ)9yhTX2Vq4{A7qZ4x@7b5Z3 z0vPWuCYJYhPuFpRW?vRY?^Bx1UF*JL*pwLEE7v-f6pBRn!=aRL*=F7lr+j<6TCP{O z=s+Gqy3B8f#hBW(>ku?4ttFe~g2#`cvGvy0PhOe&4U z3XS$*v$~BPk*d*1ib%6#@06fb;R{4bE+g?f&jrkZY-qk&uG3*1F~1QKr;5#5qr7Qt zuHSF(H0tZ+%3T_p&stT9&Kn}K1q)i*Dcd`itu`=7Ws%KY<__Icm3#LHQ(Z0ZS@mSA zUEL~I+CP0${aQ#EnyYKg-Je>Pe(#8wU`v>9Tg@(M!~R?KJ#6&|6d44u+}gGwc=S!_ zI97zvt7Kv6FtHZCSH=n3YP6t*sVRPj6V$rjY``mvO09@zwpBs&P@)0Gx!pB!bgxnC zz`ax2@RyAI{t!g+TWjy@#e(x+=UM;4AfM)R%_fVZI!FFPRoi;gV4BfT1;4<1m`P_ zO)ENsN29WNRLscc&aZaV0LMp3o5J;{#dR1Ta*sMWZhDtJ;t&uRchNDHrJ#F-oFrLxIpy z2=Ymo4Xmbs3&Av?+Q5ZDPrZ2|C+-ioE%rNCYu)k^v@5`Tzlg+5c7UNhE~ywy>eH+^E*;Gh7>N^$pu&otV#@QH#Rq78 zDHZEZH_7*NVn!+|Pe6GZ^ps#j6dFw#Pn_XV2C^+#*#(ixQ7oZE(bZX(=2~~8a*pNm zm4NxPeD(=a$c;c4Wk;Xn9fHl5et;dFW4eK-g}nwN?b!VD-0h`-rUNO4m(0PEgT zm(7#1H9U~x%&5n7VPS9D-GdpYp3%OTr5guqqFEd95T1f1c>?9X*Lrf}< z0_gNsBYK6WFc@pEOIIX=eoSok4?^OoqRxA6eNrP6OJcm)0v=m!-)Em-I(~Ja-BZ+J z>#DPPU5x9`MpT?!&tWc`5SLTMDI5(Hd)hwF}ajT)I@a zy`JuxJD`yDVt%?m=Y5U z$+d;_3hl{J`Yrvj^-K<5CKA8+LGshVSmk->9Kz=8`FGW){drdGc)5tw0%-mXiIizCxQ&#pjvb}C7`QMTFwSh_c9Z?YM zc9TbkBA7kkTi|w`C=<_LdrVwK|s#PB{|{S$O|Ay+GKoa0s!k#0FsQ8a?Cy(7gK)D^&85+ zy4h<&xcs3Qzh`bhK2^Mf;KGUjcEmV2lLS8*F`pYruKPoMPxy1=R((@Coup15+S*(d zr&%{U2{N6;HLi$JK4q-oBk`vLB!a1!e={Oxy1g=lc4y#xH)?wpMWT$yYiv<&dXO3R z!GXq-IO&k{0-XeB2ZzTwCqH0(Tp%^ucV2EtJi$bRf=1s2HC}1l_Je^(_+-5qz{hUx z#oW-&^~q-M+!4pRet?Sg*p3hTZATDj;L>8_u_%Q5#JJ{-M@dCS;!g#vg5XT^vmtSW zJ{Sp~uMo7`)Fnp$W83co<0s9lV%+%&PRm+$EiE%6`Q>E%>NQyZqhe%r@hXfxtQsC( zy&Ru8V*WZDE$s%r4V+!VYCxp{G_)Y$w5E8#nq+_MF7=ULj8_p%)oax{AYM(oz*C`tc?$CY1*Du4ev0@{+h{^9CsXcP~j2 zyD7CVjZW~V^bEg9UX6@ypgDV)1txegQ)z1hPcIXUNxE3LWWr1En)nC(B#;kZ0-C+R zH~}j|oi2S@j5W(G3lR_FYn-Vy4xg#T$(DLqD))i(GDRC?RV7mVv!u=Gsap48&c;1jp(K-C)5n4>_n5*A@hV@Qm6|km*fvLWbU! zZ%_>eI@n*>xDM1-1?kAU5<15Gi^N|H(1bd)&v7U7&%Yk!#&C;c8s<$gO0krMtio{$rMg29Zhj@~ww9bX z0CmaMR?C4^Sn}l3uOSDbiM0v2lpF|z6IaFfrd5$e0;CzHgToayjGR|&QT3*2gb6dF z0szv0>`K$q5L|AqQQ#s3eqz2Q#&t)E;TKW)kk4e-y25=gdzsk|d&5-AFoi_4$H#;9 z=(Kcp_D!DyE=PX;LGoGg^ugsTL`y~!NNj^z%i5B*2&P6>MKBCPoDIfkFgNn6q>sm? zD(vIj7E$EecRCwL^g%-b_^~Zys95l&X1@9$85b`dJWCKpcNi|!TT0V%$jz9iPKe_@ z)Xi^U>-`TJ1h^)O&noJ z0dEyfx(lM56K5AzvPED+vTP@pUeD$;1)xglJUmf2pi7y;axn!pa8k^qGKExe;YPYp z0;qH|or5}%Emo4LnIl0v_5BGk$$CnftyJ_w z=?~6Rb1@I$?EH=4<`eK?CjgVqXym+&I<^|=ahbgciXuGcE-A*ONJnL^I4D&H0bYgx z1OIQ^N)@KW6e@y|W7S9D93~s=Vy|-_MPpG+-?KJ$8jZV}$dgPYC-ve7$Bn?N~GY3AkP7P%&rKYEs0~`R*9bL$e5C4!L>hNn|pRa zs4G)Ng8$I?U)l+rrp>BN$oeL#3Mfrp>`rLNgxebdj)7M|`{gwtv(@c-12&DwxPeS564>D*% zqDZKQwhbkVBv;GWo#%K$L2(DoMw%9udns&(!;uqT4SkUOa%kW>%xC%lr|QrHH&vhZ zjYOYj8dUY+tG#_Mj_YUfqv}&?MojaDm9$n?0ROwc{IYc&fdnWnfyX_?RsVj zskcP{cK?RjZNCv-M9B!_F^U0kgcd_$NjPdrKRbdVQ{NO6KN17-gVJv4g&h1nhZCtO zBp*8Mozkv_64FicH^Sn0k3v9XG$w1SrL17q9}~w^1VtvM-D=c0lA4YOp~*eOV+%48 zgRvnpJ(brK6pfoLG2PV;8et*3x(Y3kFD+*B$rPpasJ45?d7NI8PeVu@%y&OU3N}|t ze@tZzvDJlKCRK#1oG)e9R&LLPQxoDS`9O%T%rzlgCD(@?Q(^@Es+0q8r@MNbBz@dV z?^_`_>Mk%>@Ly*DhO6*7d9vt2gYn208j`4Xl;iL&2K%jE--!%N*!&e-!O(zR*PQhg z40px@oBjjgyMwM^n7`P)%q1OiW>Uuj4L)+yRZ| z1)=laEjSp|Lt5kPqE$mM;BBwb&7bJbd>2zGHgV^&?^K4~X=q1BXi2gTA+)e_kq*xY zi3s~HtEqkwh;zHm{82;&wz|Y>MVwX+KDw-}NVARxaXuQ|C}uIwQDQ(^~`ST-FG%DVXIt;+uFxIv8} z3cJfdc4>Qq-J}uY=fnwbnX#U`wB`fFV|wm+xFh;5jatDuacc8Eys&DetCsmVsZhX+ z2b4NfIo-H{B;-jdhO^tytyDCoCr7T=bbP4Etu(gtnv9y<84zgz5)_D=B>ZrpvsNJVTC@Gs6nDF?X&>A9D9FY3jNPWI(5>s4$qT`K7PImHV>J z(o?xVjYg4pP!*r56K{&gH?6HQ(D@Rks*5L`YmrE7#=75O3#xkak!djl#Y8EjZ!1e6Ex!5Bs^Nh<@e(1%u(c&eOJPi z_)QD3TFe(pt4Z9&gR6u2Bv)3lw@NG7EP|wvxr7W-uhep}RW6-eh1YjISzIZgD{7(g z1%8%Y!?ZzJf4zPkSNA?GB3?;Cg_*8J^D_W}+e&&Vxo{gaz&g7BCw(WN9>RSGLqe3AB=;CKbng6!StV=6^3^L3C?>g}mVsq2ebi28ZVHoK>-^dzNw|lz**_r;Z63u*FS_BXqf( zgRMyXq?T}`zGHOpJcZvl)#qMll{hs@ca-6mE+Svykf8(nDCU#m+yT>&u7mlxBk;T= zBH0D0J4N*p{#Kcc@tua<=AvMB$bh+yA@QP%iALC+>&E6}xk_Lz2Jr1Ygy!?@B1ghHgyC*J``3gHpbh5N>G zpH6*|s~}3|e}u)EgO>kM5k<0Q5B?VyZNR;tf-wolvka$(E_W!1$Mk+H6XK&PlU74h z&55%O4m|tOl%hN|&7yc*(v%nYA?@T}xeQ=Y9hw2=7siBet%!5pJQG|!PJugg%<~owWY${uyHBu0m;z5QFnQ$>a}IXEbB|t| z9Apf2ePlty8^rwS`266D<@~nfTS1)GQcZqVY45TIw&mrLAkYN$=5!>;3AlM#qS}bk zQGkFNZ|P^rs~9M$oax~)GLCKqw6EA`f{Tqd0?-#2Mqn<<0u?ZGHG8hOrmETT6C*M7 z6PGhRw)8hJ~>@}MB98?u-)kCtvu9O(bK{XBOX^USl13e|buxGn}QTe&VFgq^X zb~#)n1m-Grn)z2pP`%#ETH~geQq*KaWiJDvpVn)@0Jx3rXhmQVu2f zrL4qN{Z1hexV3C)y_i}7zA76^&)EMcZ2m(?oRJ`ywvA|UXEij z6(^js!xeR95!qs2lqN+a2z7U7AYG#;kfvqP;{!o{lLWTL|E-}3v)SGf@K`!PJ3&BH+JX{jy7r-Wo?zj(s40Ij!M+{P#Osq=YIo_?> zHie+H=<$OV`*loAVm-YR>)HfbcW@=NOGa)&7jh$ave&vf$jw0${ggOOpqxwI!3rNi z%mxMo&-9F~;J`P<6Wpd-Ia77h!BL#*4-a+FTj# z9Wie==i=Av7x#_Nh5?nRvS%ZvmwtfvuN!Js4OIVY{(k8F1zBMUiIYUOKc-3yY4pC>*UZa&at0C?x8EZO&Ug47VfqDhfr8WXuDT$V^G^e*oIXcv+k9a#?%^#ut^35h ztL95XFi&@T1m1lYwIoR{kCsU~BPe|KHr65*ptApEApV^sfw|;Vgd^TTQh`t6rul4N zrm$kSp@tK(mqi?W#f`~i}%JFu51Rj1f?7LZ`z+)pQb?32ts*C353jub3ZLR8K zehVkp@Tf2aE;Hx0O!Hs?R1NKf#-qVIKJ7t9uczZ-G~1tsg>&CWEyW0WiGa3$s{NtZ z^_O7Rsa|%$1z?Vqjrm}XIW>snIJ^@xB-b9M@HERHtjw%yKZ3HECdwOWj1&L^%j>>R;5p49lijjF&Fb0q|hg|_SQ!n~3vh_6_$le-=zysOa zMf2&jK9JZfemQfD-lh3Vo?PMH21Y?ASmSD^&5ske(}(@=Wre<4BV`X0nf zYVTR7emN8$mWi%HTaLfZ#y}B_`K}}!xphLl9CskM#>;l<8@l*Nn({ZpRJ+|L zn`^wP5Ay+0R^MKl-@&hU?K5N!Z=t6PoaQfun46z6Umk*+`w5kDOK`&Zo!4aVcL%gL z{@woA>3*f|02Aljo&nxa7g3yq~qDe#2zF5ag^# zDxADXcpf8*{=`MHGuQKN+LHEMO<*=kMLSr)-&%`Jyrk`Ik^$q`Q%Lh3{_a^W!24tX-Qu59Phf z>!Ej&{J{AYZ{y!?c>b8mJZJ+6-HUskH8);$sWdmf8Xj3%Nc~}Wc8UMAN^F4uVflad zEMqq>zZX6wf4n3A-pZXj{L3Bu$(0YnQTbCM!5tF`{wa~bPsz2wY9Tj(a$m%?U2ANV zYx62WjD)uOwEsc!_8_nGd)W!fT$<{-i+bZ9Xm;Iy0qwWNQ?i2Pp|1`xp6W}z0yKxI z(gzUR9O^wJ{oXYu=i<_wR|PP5qCR1mEit!!*Fw2cw-RG$gEc#4DO z?$7T!eJ}>DOyYH@Ev`4hKuvL;W#*x8iMcW8NT|ZdAt{Mr@TrAQ`|}n3t{M3dLly_S z`_yMl?{zAW^L_>0w;p~s%7y)1>EYW|pv3=z#AhB_z~Nq+Gv4VlyS}_fc|{!;fKlOv zVcakK^Uh7fs)b*iZ};~%#z4E>xbmFy7ga9FzYpa3b3#bg;m;lQ`BOsNQvS)GeX%dZ F{{vS8pSS=3 diff --git a/Build/owlbot.py b/Build/owlbot.py index 88e8de7294a3..51aabb022dc9 100644 --- a/Build/owlbot.py +++ b/Build/owlbot.py @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -30,14 +30,7 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -php.owlbot_main( - src=src, - dest=dest, - copy_excludes=[ - src / "**/[A-Z]*_*.php", - src / "**/*GrpcClient.php", - ] -) +php.owlbot_main(src=src, dest=dest) # remove class_alias code s.replace( @@ -48,28 +41,16 @@ + "\n", '') -### [START] protoc backwards compatibility fixes - -# roll back to private properties. -s.replace( - "src/**/V*/**/*.php", - r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$", - r"""Generated from protobuf field \1 - */ - private $""") - -# Replace "Unwrapped" with "Value" for method names. -s.replace( - "src/**/V*/**/*.php", - r"public function ([s|g]\w{3,})Unwrapped", - r"public function \1Value" -) - -### [END] protoc backwards compatibility fixes - -# fix relative cloud.google.com links -s.replace( - "src/**/V*/**/*.php", - r"(.{0,})\]\((/.{0,})\)", - r"\1](https://cloud.google.com\2)" -) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.16', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/Build/src/V1/ApprovalConfig.php b/Build/src/V1/ApprovalConfig.php deleted file mode 100644 index aaf7390e1e4d..000000000000 --- a/Build/src/V1/ApprovalConfig.php +++ /dev/null @@ -1,75 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalConfig - */ -class ApprovalConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - */ - private $approval_required = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $approval_required - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - * @return bool - */ - public function getApprovalRequired() - { - return $this->approval_required; - } - - /** - * Whether or not approval is needed. If this is set on a build, it will - * become pending when created, and will need to be explicitly approved - * to start. - * - * Generated from protobuf field bool approval_required = 1; - * @param bool $var - * @return $this - */ - public function setApprovalRequired($var) - { - GPBUtil::checkBool($var); - $this->approval_required = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ApprovalResult.php b/Build/src/V1/ApprovalResult.php deleted file mode 100644 index 0addccd1b0b3..000000000000 --- a/Build/src/V1/ApprovalResult.php +++ /dev/null @@ -1,230 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalResult - */ -class ApprovalResult extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approver_account = ''; - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approval_time = null; - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $decision = 0; - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $comment = ''; - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $approver_account - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * @type \Google\Protobuf\Timestamp $approval_time - * Output only. The time when the approval decision was made. - * @type int $decision - * Required. The decision of this manual approval. - * @type string $comment - * Optional. An optional comment for this manual approval result. - * @type string $url - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApproverAccount() - { - return $this->approver_account; - } - - /** - * Output only. Email of the user that called the ApproveBuild API to - * approve or reject a build at the time that the API was called. - * - * Generated from protobuf field string approver_account = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApproverAccount($var) - { - GPBUtil::checkString($var, True); - $this->approver_account = $var; - - return $this; - } - - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getApprovalTime() - { - return $this->approval_time; - } - - public function hasApprovalTime() - { - return isset($this->approval_time); - } - - public function clearApprovalTime() - { - unset($this->approval_time); - } - - /** - * Output only. The time when the approval decision was made. - * - * Generated from protobuf field .google.protobuf.Timestamp approval_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setApprovalTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->approval_time = $var; - - return $this; - } - - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDecision() - { - return $this->decision; - } - - /** - * Required. The decision of this manual approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult.Decision decision = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDecision($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\ApprovalResult\Decision::class); - $this->decision = $var; - - return $this; - } - - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getComment() - { - return $this->comment; - } - - /** - * Optional. An optional comment for this manual approval result. - * - * Generated from protobuf field string comment = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setComment($var) - { - GPBUtil::checkString($var, True); - $this->comment = $var; - - return $this; - } - - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Optional. An optional URL tied to this manual approval result. This field - * is essentially the same as comment, except that it will be rendered by the - * UI differently. An example use case is a link to an external job that - * approved this Build. - * - * Generated from protobuf field string url = 6 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ApprovalResult/Decision.php b/Build/src/V1/ApprovalResult/Decision.php deleted file mode 100644 index 51d66ca94131..000000000000 --- a/Build/src/V1/ApprovalResult/Decision.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.ApprovalResult.Decision - */ -class Decision -{ - /** - * Default enum type. This should not be used. - * - * Generated from protobuf enum DECISION_UNSPECIFIED = 0; - */ - const DECISION_UNSPECIFIED = 0; - /** - * Build is approved. - * - * Generated from protobuf enum APPROVED = 1; - */ - const APPROVED = 1; - /** - * Build is rejected. - * - * Generated from protobuf enum REJECTED = 2; - */ - const REJECTED = 2; - - private static $valueToName = [ - self::DECISION_UNSPECIFIED => 'DECISION_UNSPECIFIED', - self::APPROVED => 'APPROVED', - self::REJECTED => 'REJECTED', - ]; - - 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/Build/src/V1/ApproveBuildRequest.php b/Build/src/V1/ApproveBuildRequest.php deleted file mode 100644 index 35a51341dcfd..000000000000 --- a/Build/src/V1/ApproveBuildRequest.php +++ /dev/null @@ -1,115 +0,0 @@ -google.devtools.cloudbuild.v1.ApproveBuildRequest - */ -class ApproveBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $name = ''; - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - */ - private $approval_result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * @type \Google\Cloud\Build\V1\ApprovalResult $approval_result - * Approval decision and metadata. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - * @return \Google\Cloud\Build\V1\ApprovalResult|null - */ - public function getApprovalResult() - { - return $this->approval_result; - } - - public function hasApprovalResult() - { - return isset($this->approval_result); - } - - public function clearApprovalResult() - { - unset($this->approval_result); - } - - /** - * Approval decision and metadata. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult approval_result = 2; - * @param \Google\Cloud\Build\V1\ApprovalResult $var - * @return $this - */ - public function setApprovalResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalResult::class); - $this->approval_result = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ArtifactResult.php b/Build/src/V1/ArtifactResult.php deleted file mode 100644 index 98a3180c76b9..000000000000 --- a/Build/src/V1/ArtifactResult.php +++ /dev/null @@ -1,110 +0,0 @@ -google.devtools.cloudbuild.v1.ArtifactResult - */ -class ArtifactResult extends \Google\Protobuf\Internal\Message -{ - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - */ - private $location = ''; - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - */ - private $file_hash; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * @type array<\Google\Cloud\Build\V1\FileHashes>|\Google\Protobuf\Internal\RepeatedField $file_hash - * The file hash of the artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * The path of an artifact in a Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - * - * Generated from protobuf field string location = 1; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFileHash() - { - return $this->file_hash; - } - - /** - * The file hash of the artifact. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.FileHashes file_hash = 2; - * @param array<\Google\Cloud\Build\V1\FileHashes>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFileHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hash = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Artifacts.php b/Build/src/V1/Artifacts.php deleted file mode 100644 index 223f22f97f4c..000000000000 --- a/Build/src/V1/Artifacts.php +++ /dev/null @@ -1,314 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts - */ -class Artifacts extends \Google\Protobuf\Internal\Message -{ - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - */ - private $images; - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - */ - private $objects = null; - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - */ - private $maven_artifacts; - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - */ - private $python_packages; - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - */ - private $npm_packages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $images - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * @type \Google\Cloud\Build\V1\Artifacts\ArtifactObjects $objects - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\MavenArtifact>|\Google\Protobuf\Internal\RepeatedField $maven_artifacts - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\PythonPackage>|\Google\Protobuf\Internal\RepeatedField $python_packages - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * @type array<\Google\Cloud\Build\V1\Artifacts\NpmPackage>|\Google\Protobuf\Internal\RepeatedField $npm_packages - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images will be pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the Build resource's - * results field. - * If any of the images fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated string images = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->images = $arr; - - return $this; - } - - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - * @return \Google\Cloud\Build\V1\Artifacts\ArtifactObjects|null - */ - public function getObjects() - { - return $this->objects; - } - - public function hasObjects() - { - return isset($this->objects); - } - - public function clearObjects() - { - unset($this->objects); - } - - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. - * Files in the workspace matching specified paths globs will be uploaded to - * the specified Cloud Storage location using the builder service account's - * credentials. - * The location and generation of the uploaded objects will be stored in the - * Build resource's results field. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects objects = 2; - * @param \Google\Cloud\Build\V1\Artifacts\ArtifactObjects $var - * @return $this - */ - public function setObjects($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Artifacts\ArtifactObjects::class); - $this->objects = $var; - - return $this; - } - - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMavenArtifacts() - { - return $this->maven_artifacts; - } - - /** - * A list of Maven artifacts to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Artifacts in the workspace matching specified paths globs will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any artifacts fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.MavenArtifact maven_artifacts = 3; - * @param array<\Google\Cloud\Build\V1\Artifacts\MavenArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMavenArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\MavenArtifact::class); - $this->maven_artifacts = $arr; - - return $this; - } - - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPythonPackages() - { - return $this->python_packages; - } - - /** - * A list of Python packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * The build service account credentials will be used to perform the upload. - * If any objects fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.PythonPackage python_packages = 5; - * @param array<\Google\Cloud\Build\V1\Artifacts\PythonPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPythonPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\PythonPackage::class); - $this->python_packages = $arr; - - return $this; - } - - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNpmPackages() - { - return $this->npm_packages; - } - - /** - * A list of npm packages to be uploaded to Artifact Registry upon - * successful completion of all build steps. - * Npm packages in the specified paths will be uploaded - * to the specified Artifact Registry repository using the builder service - * account's credentials. - * If any packages fail to be pushed, the build is marked FAILURE. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Artifacts.NpmPackage npm_packages = 6; - * @param array<\Google\Cloud\Build\V1\Artifacts\NpmPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNpmPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Artifacts\NpmPackage::class); - $this->npm_packages = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Artifacts/ArtifactObjects.php b/Build/src/V1/Artifacts/ArtifactObjects.php deleted file mode 100644 index a5516b008805..000000000000 --- a/Build/src/V1/Artifacts/ArtifactObjects.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects - */ -class ArtifactObjects extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - */ - private $location = ''; - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - */ - private $paths; - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $location - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * @type array|\Google\Protobuf\Internal\RepeatedField $paths - * Path globs used to match files in the build's workspace. - * @type \Google\Cloud\Build\V1\TimeSpan $timing - * Output only. Stores timing information for pushing all artifact objects. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to - * Cloud Storage with this location as a prefix. - * - * Generated from protobuf field string location = 1; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Path globs used to match files in the build's workspace. - * - * Generated from protobuf field repeated string paths = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->paths = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getTiming() - { - return $this->timing; - } - - public function hasTiming() - { - return isset($this->timing); - } - - public function clearTiming() - { - unset($this->timing); - } - - /** - * Output only. Stores timing information for pushing all artifact objects. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/MavenArtifact.php b/Build/src/V1/Artifacts/MavenArtifact.php deleted file mode 100644 index b4508ad7b346..000000000000 --- a/Build/src/V1/Artifacts/MavenArtifact.php +++ /dev/null @@ -1,249 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.MavenArtifact - */ -class MavenArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - */ - private $path = ''; - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - */ - private $artifact_id = ''; - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - */ - private $group_id = ''; - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - */ - private $version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * @type string $path - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * @type string $artifact_id - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * @type string $group_id - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * @type string $version - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" - * Artifact in the workspace specified by path will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path to an artifact in the build's workspace to be uploaded to - * Artifact Registry. - * This can be either an absolute path, - * e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar - * or a relative path from /workspace, - * e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - * @return string - */ - public function getArtifactId() - { - return $this->artifact_id; - } - - /** - * Maven `artifactId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string artifact_id = 3; - * @param string $var - * @return $this - */ - public function setArtifactId($var) - { - GPBUtil::checkString($var, True); - $this->artifact_id = $var; - - return $this; - } - - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - * @return string - */ - public function getGroupId() - { - return $this->group_id; - } - - /** - * Maven `groupId` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string group_id = 4; - * @param string $var - * @return $this - */ - public function setGroupId($var) - { - GPBUtil::checkString($var, True); - $this->group_id = $var; - - return $this; - } - - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Maven `version` value used when uploading the artifact to Artifact - * Registry. - * - * Generated from protobuf field string version = 5; - * @param string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkString($var, True); - $this->version = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/NpmPackage.php b/Build/src/V1/Artifacts/NpmPackage.php deleted file mode 100644 index 650dbc018b24..000000000000 --- a/Build/src/V1/Artifacts/NpmPackage.php +++ /dev/null @@ -1,119 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.NpmPackage - */ -class NpmPackage extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - */ - private $package_path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * @type string $package_path - * Path to the package.json. - * e.g. workspace/path/to/package - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY" - * Npm package in the workspace specified by path will be zipped and - * uploaded to Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - * @return string - */ - public function getPackagePath() - { - return $this->package_path; - } - - /** - * Path to the package.json. - * e.g. workspace/path/to/package - * - * Generated from protobuf field string package_path = 2; - * @param string $var - * @return $this - */ - public function setPackagePath($var) - { - GPBUtil::checkString($var, True); - $this->package_path = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Artifacts/PythonPackage.php b/Build/src/V1/Artifacts/PythonPackage.php deleted file mode 100644 index 7f5c0cebb993..000000000000 --- a/Build/src/V1/Artifacts/PythonPackage.php +++ /dev/null @@ -1,124 +0,0 @@ -google.devtools.cloudbuild.v1.Artifacts.PythonPackage - */ -class PythonPackage extends \Google\Protobuf\Internal\Message -{ - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - */ - private $repository = ''; - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - */ - private $paths; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * @type array|\Google\Protobuf\Internal\RepeatedField $paths - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * Artifact Registry repository, in the form - * "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" - * Files in the workspace matching any path pattern will be uploaded to - * Artifact Registry with this location as a prefix. - * - * Generated from protobuf field string repository = 1; - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPaths() - { - return $this->paths; - } - - /** - * Path globs used to match files in the build's workspace. For Python/ - * Twine, this is usually `dist/*`, and sometimes additionally an `.asc` - * file. - * - * Generated from protobuf field repeated string paths = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->paths = $arr; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build.php b/Build/src/V1/Build.php deleted file mode 100644 index b85782191e74..000000000000 --- a/Build/src/V1/Build.php +++ /dev/null @@ -1,1316 +0,0 @@ -google.devtools.cloudbuild.v1.Build - */ -class Build extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * Output only. Unique identifier of the build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $id = ''; - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $project_id = ''; - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status = 0; - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status_detail = ''; - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - */ - private $source = null; - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - */ - private $steps; - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $results = null; - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $start_time = null; - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $finish_time = null; - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - */ - private $timeout = null; - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - */ - private $images; - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - */ - private $queue_ttl = null; - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - */ - private $artifacts = null; - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - */ - private $logs_bucket = ''; - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $source_provenance = null; - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $build_trigger_id = ''; - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - */ - private $options = null; - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $log_url = ''; - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - */ - private $substitutions; - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - */ - private $tags; - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - */ - private $secrets; - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing; - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $approval = null; - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - */ - private $service_account = ''; - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - */ - private $available_secrets = null; - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $warnings; - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $failure_info = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * @type string $id - * Output only. Unique identifier of the build. - * @type string $project_id - * Output only. ID of the project. - * @type int $status - * Output only. Status of the build. - * @type string $status_detail - * Output only. Customer-readable message about the current status. - * @type \Google\Cloud\Build\V1\Source $source - * The location of the source files to build. - * @type array<\Google\Cloud\Build\V1\BuildStep>|\Google\Protobuf\Internal\RepeatedField $steps - * Required. The operations to be performed on the workspace. - * @type \Google\Cloud\Build\V1\Results $results - * Output only. Results of the build. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time at which the request to create the build was received. - * @type \Google\Protobuf\Timestamp $start_time - * Output only. Time at which execution of the build was started. - * @type \Google\Protobuf\Timestamp $finish_time - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * @type \Google\Protobuf\Duration $timeout - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * @type array|\Google\Protobuf\Internal\RepeatedField $images - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * @type \Google\Protobuf\Duration $queue_ttl - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * @type \Google\Cloud\Build\V1\Artifacts $artifacts - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * @type string $logs_bucket - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * @type \Google\Cloud\Build\V1\SourceProvenance $source_provenance - * Output only. A permanent fixed identifier for source. - * @type string $build_trigger_id - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * @type \Google\Cloud\Build\V1\BuildOptions $options - * Special options for this build. - * @type string $log_url - * Output only. URL to logs for this build in Google Cloud Console. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions data for `Build` resource. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Tags for annotation of a `Build`. These are not docker tags. - * @type array<\Google\Cloud\Build\V1\Secret>|\Google\Protobuf\Internal\RepeatedField $secrets - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * @type array|\Google\Protobuf\Internal\MapField $timing - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * @type \Google\Cloud\Build\V1\BuildApproval $approval - * Output only. Describes this build's approval configuration, status, - * and result. - * @type string $service_account - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * @type \Google\Cloud\Build\V1\Secrets $available_secrets - * Secrets and secret environment variables. - * @type array<\Google\Cloud\Build\V1\Build\Warning>|\Google\Protobuf\Internal\RepeatedField $warnings - * Output only. Non-fatal problems encountered during the execution of the - * build. - * @type \Google\Cloud\Build\V1\Build\FailureInfo $failure_info - * Output only. Contains information about the build when status=FAILURE. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The 'Build' name with format: - * `projects/{project}/locations/{location}/builds/{build}`, where {build} - * is a unique identifier generated by the service. - * - * Generated from protobuf field string name = 45 [(.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 build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Unique identifier of the build. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Output only. ID of the project. - * - * Generated from protobuf field string project_id = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStatus() - { - return $this->status; - } - - /** - * Output only. Status of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusDetail() - { - return $this->status_detail; - } - - /** - * Output only. Customer-readable message about the current status. - * - * Generated from protobuf field string status_detail = 24 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusDetail($var) - { - GPBUtil::checkString($var, True); - $this->status_detail = $var; - - return $this; - } - - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - * @return \Google\Cloud\Build\V1\Source|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * The location of the source files to build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Source source = 3; - * @param \Google\Cloud\Build\V1\Source $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Source::class); - $this->source = $var; - - return $this; - } - - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSteps() - { - return $this->steps; - } - - /** - * Required. The operations to be performed on the workspace. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildStep steps = 11; - * @param array<\Google\Cloud\Build\V1\BuildStep>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSteps($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuildStep::class); - $this->steps = $arr; - - return $this; - } - - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\Results|null - */ - public function getResults() - { - return $this->results; - } - - public function hasResults() - { - return isset($this->results); - } - - public function clearResults() - { - unset($this->results); - } - - /** - * Output only. Results of the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Results results = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\Results $var - * @return $this - */ - public function setResults($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Results::class); - $this->results = $var; - - return $this; - } - - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time at which the request to create the build was received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Output only. Time at which execution of the build was started. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getFinishTime() - { - return $this->finish_time; - } - - public function hasFinishTime() - { - return isset($this->finish_time); - } - - public function clearFinishTime() - { - unset($this->finish_time); - } - - /** - * Output only. Time at which execution of the build was finished. - * The difference between finish_time and start_time is the duration of the - * build's execution. - * - * Generated from protobuf field .google.protobuf.Timestamp finish_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setFinishTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->finish_time = $var; - - return $this; - } - - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. - * `timeout` starts ticking from `startTime`. - * Default time is 60 minutes. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 12; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * A list of images to be pushed upon the successful completion of all build - * steps. - * The images are pushed using the builder service account's credentials. - * The digests of the pushed images will be stored in the `Build` resource's - * results field. - * If any of the images fail to be pushed, the build status is marked - * `FAILURE`. - * - * Generated from protobuf field repeated string images = 13; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->images = $arr; - - return $this; - } - - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - * @return \Google\Protobuf\Duration|null - */ - public function getQueueTtl() - { - return $this->queue_ttl; - } - - public function hasQueueTtl() - { - return isset($this->queue_ttl); - } - - public function clearQueueTtl() - { - unset($this->queue_ttl); - } - - /** - * TTL in queue for this build. If provided and the build is enqueued longer - * than this value, the build will expire and the build status will be - * `EXPIRED`. - * The TTL starts ticking from create_time. - * - * Generated from protobuf field .google.protobuf.Duration queue_ttl = 40; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setQueueTtl($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->queue_ttl = $var; - - return $this; - } - - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - * @return \Google\Cloud\Build\V1\Artifacts|null - */ - public function getArtifacts() - { - return $this->artifacts; - } - - public function hasArtifacts() - { - return isset($this->artifacts); - } - - public function clearArtifacts() - { - unset($this->artifacts); - } - - /** - * Artifacts produced by the build that should be uploaded upon - * successful completion of all build steps. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Artifacts artifacts = 37; - * @param \Google\Cloud\Build\V1\Artifacts $var - * @return $this - */ - public function setArtifacts($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Artifacts::class); - $this->artifacts = $var; - - return $this; - } - - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - * @return string - */ - public function getLogsBucket() - { - return $this->logs_bucket; - } - - /** - * Cloud Storage bucket where logs should be written (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - * - * Generated from protobuf field string logs_bucket = 19; - * @param string $var - * @return $this - */ - public function setLogsBucket($var) - { - GPBUtil::checkString($var, True); - $this->logs_bucket = $var; - - return $this; - } - - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\SourceProvenance|null - */ - public function getSourceProvenance() - { - return $this->source_provenance; - } - - public function hasSourceProvenance() - { - return isset($this->source_provenance); - } - - public function clearSourceProvenance() - { - unset($this->source_provenance); - } - - /** - * Output only. A permanent fixed identifier for source. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.SourceProvenance source_provenance = 21 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\SourceProvenance $var - * @return $this - */ - public function setSourceProvenance($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\SourceProvenance::class); - $this->source_provenance = $var; - - return $this; - } - - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getBuildTriggerId() - { - return $this->build_trigger_id; - } - - /** - * Output only. The ID of the `BuildTrigger` that triggered this build, if it - * was triggered automatically. - * - * Generated from protobuf field string build_trigger_id = 22 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setBuildTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->build_trigger_id = $var; - - return $this; - } - - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - * @return \Google\Cloud\Build\V1\BuildOptions|null - */ - public function getOptions() - { - return $this->options; - } - - public function hasOptions() - { - return isset($this->options); - } - - public function clearOptions() - { - unset($this->options); - } - - /** - * Special options for this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions options = 23; - * @param \Google\Cloud\Build\V1\BuildOptions $var - * @return $this - */ - public function setOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildOptions::class); - $this->options = $var; - - return $this; - } - - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getLogUrl() - { - return $this->log_url; - } - - /** - * Output only. URL to logs for this build in Google Cloud Console. - * - * Generated from protobuf field string log_url = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setLogUrl($var) - { - GPBUtil::checkString($var, True); - $this->log_url = $var; - - return $this; - } - - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions data for `Build` resource. - * - * Generated from protobuf field map substitutions = 29; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Tags for annotation of a `Build`. These are not docker tags. - * - * Generated from protobuf field repeated string tags = 31; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->tags = $arr; - - return $this; - } - - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecrets() - { - return $this->secrets; - } - - /** - * Secrets to decrypt using Cloud Key Management Service. - * Note: Secret Manager is the recommended technique - * for managing sensitive data with Cloud Build. Use `available_secrets` to - * configure builds to access secrets from Secret Manager. For instructions, - * see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Secret secrets = 32; - * @param array<\Google\Cloud\Build\V1\Secret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecrets($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Secret::class); - $this->secrets = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getTiming() - { - return $this->timing; - } - - /** - * Output only. Stores timing information for phases of the build. Valid keys - * are: - * * BUILD: time to execute all build steps. - * * PUSH: time to push all artifacts including docker images and non docker - * artifacts. - * * FETCHSOURCE: time to fetch source. - * * SETUPBUILD: time to set up build. - * If the build does not specify source or images, - * these keys will not be included. - * - * Generated from protobuf field map timing = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setTiming($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $arr; - - return $this; - } - - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\BuildApproval|null - */ - public function getApproval() - { - return $this->approval; - } - - public function hasApproval() - { - return isset($this->approval); - } - - public function clearApproval() - { - unset($this->approval); - } - - /** - * Output only. Describes this build's approval configuration, status, - * and result. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval approval = 44 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\BuildApproval $var - * @return $this - */ - public function setApproval($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildApproval::class); - $this->approval = $var; - - return $this; - } - - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * IAM service account whose credentials will be used at build runtime. - * Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * ACCOUNT can be email address or uniqueId of the service account. - * - * Generated from protobuf field string service_account = 42 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - * @return \Google\Cloud\Build\V1\Secrets|null - */ - public function getAvailableSecrets() - { - return $this->available_secrets; - } - - public function hasAvailableSecrets() - { - return isset($this->available_secrets); - } - - public function clearAvailableSecrets() - { - unset($this->available_secrets); - } - - /** - * Secrets and secret environment variables. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Secrets available_secrets = 47; - * @param \Google\Cloud\Build\V1\Secrets $var - * @return $this - */ - public function setAvailableSecrets($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Secrets::class); - $this->available_secrets = $var; - - return $this; - } - - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWarnings() - { - return $this->warnings; - } - - /** - * Output only. Non-fatal problems encountered during the execution of the - * build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build.Warning warnings = 49 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array<\Google\Cloud\Build\V1\Build\Warning>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWarnings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Build\Warning::class); - $this->warnings = $arr; - - return $this; - } - - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\Build\FailureInfo|null - */ - public function getFailureInfo() - { - return $this->failure_info; - } - - public function hasFailureInfo() - { - return isset($this->failure_info); - } - - public function clearFailureInfo() - { - unset($this->failure_info); - } - - /** - * Output only. Contains information about the build when status=FAILURE. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo failure_info = 51 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\Build\FailureInfo $var - * @return $this - */ - public function setFailureInfo($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build\FailureInfo::class); - $this->failure_info = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Build/FailureInfo.php b/Build/src/V1/Build/FailureInfo.php deleted file mode 100644 index e2ad8511dea7..000000000000 --- a/Build/src/V1/Build/FailureInfo.php +++ /dev/null @@ -1,102 +0,0 @@ -google.devtools.cloudbuild.v1.Build.FailureInfo - */ -class FailureInfo extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - */ - private $type = 0; - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - */ - private $detail = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The name of the failure. - * @type string $detail - * Explains the failure issue in more detail using hard-coded text. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The name of the failure. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\FailureInfo\FailureType::class); - $this->type = $var; - - return $this; - } - - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - * @return string - */ - public function getDetail() - { - return $this->detail; - } - - /** - * Explains the failure issue in more detail using hard-coded text. - * - * Generated from protobuf field string detail = 2; - * @param string $var - * @return $this - */ - public function setDetail($var) - { - GPBUtil::checkString($var, True); - $this->detail = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build/FailureInfo/FailureType.php b/Build/src/V1/Build/FailureInfo/FailureType.php deleted file mode 100644 index 0916da414ae6..000000000000 --- a/Build/src/V1/Build/FailureInfo/FailureType.php +++ /dev/null @@ -1,91 +0,0 @@ -google.devtools.cloudbuild.v1.Build.FailureInfo.FailureType - */ -class FailureType -{ - /** - * Type unspecified - * - * Generated from protobuf enum FAILURE_TYPE_UNSPECIFIED = 0; - */ - const FAILURE_TYPE_UNSPECIFIED = 0; - /** - * Unable to push the image to the repository. - * - * Generated from protobuf enum PUSH_FAILED = 1; - */ - const PUSH_FAILED = 1; - /** - * Final image not found. - * - * Generated from protobuf enum PUSH_IMAGE_NOT_FOUND = 2; - */ - const PUSH_IMAGE_NOT_FOUND = 2; - /** - * Unauthorized push of the final image. - * - * Generated from protobuf enum PUSH_NOT_AUTHORIZED = 3; - */ - const PUSH_NOT_AUTHORIZED = 3; - /** - * Backend logging failures. Should retry. - * - * Generated from protobuf enum LOGGING_FAILURE = 4; - */ - const LOGGING_FAILURE = 4; - /** - * A build step has failed. - * - * Generated from protobuf enum USER_BUILD_STEP = 5; - */ - const USER_BUILD_STEP = 5; - /** - * The source fetching has failed. - * - * Generated from protobuf enum FETCH_SOURCE_FAILED = 6; - */ - const FETCH_SOURCE_FAILED = 6; - - private static $valueToName = [ - self::FAILURE_TYPE_UNSPECIFIED => 'FAILURE_TYPE_UNSPECIFIED', - self::PUSH_FAILED => 'PUSH_FAILED', - self::PUSH_IMAGE_NOT_FOUND => 'PUSH_IMAGE_NOT_FOUND', - self::PUSH_NOT_AUTHORIZED => 'PUSH_NOT_AUTHORIZED', - self::LOGGING_FAILURE => 'LOGGING_FAILURE', - self::USER_BUILD_STEP => 'USER_BUILD_STEP', - self::FETCH_SOURCE_FAILED => 'FETCH_SOURCE_FAILED', - ]; - - 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/Build/src/V1/Build/Status.php b/Build/src/V1/Build/Status.php deleted file mode 100644 index 66a1fe3deeb1..000000000000 --- a/Build/src/V1/Build/Status.php +++ /dev/null @@ -1,112 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Status - */ -class Status -{ - /** - * Status of the build is unknown. - * - * Generated from protobuf enum STATUS_UNKNOWN = 0; - */ - const STATUS_UNKNOWN = 0; - /** - * Build has been created and is pending execution and queuing. It has not - * been queued. - * - * Generated from protobuf enum PENDING = 10; - */ - const PENDING = 10; - /** - * Build or step is queued; work has not yet begun. - * - * Generated from protobuf enum QUEUED = 1; - */ - const QUEUED = 1; - /** - * Build or step is being executed. - * - * Generated from protobuf enum WORKING = 2; - */ - const WORKING = 2; - /** - * Build or step finished successfully. - * - * Generated from protobuf enum SUCCESS = 3; - */ - const SUCCESS = 3; - /** - * Build or step failed to complete successfully. - * - * Generated from protobuf enum FAILURE = 4; - */ - const FAILURE = 4; - /** - * Build or step failed due to an internal cause. - * - * Generated from protobuf enum INTERNAL_ERROR = 5; - */ - const INTERNAL_ERROR = 5; - /** - * Build or step took longer than was allowed. - * - * Generated from protobuf enum TIMEOUT = 6; - */ - const TIMEOUT = 6; - /** - * Build or step was canceled by a user. - * - * Generated from protobuf enum CANCELLED = 7; - */ - const CANCELLED = 7; - /** - * Build was enqueued for longer than the value of `queue_ttl`. - * - * Generated from protobuf enum EXPIRED = 9; - */ - const EXPIRED = 9; - - private static $valueToName = [ - self::STATUS_UNKNOWN => 'STATUS_UNKNOWN', - self::PENDING => 'PENDING', - self::QUEUED => 'QUEUED', - self::WORKING => 'WORKING', - self::SUCCESS => 'SUCCESS', - self::FAILURE => 'FAILURE', - self::INTERNAL_ERROR => 'INTERNAL_ERROR', - self::TIMEOUT => 'TIMEOUT', - self::CANCELLED => 'CANCELLED', - self::EXPIRED => 'EXPIRED', - ]; - - 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/Build/src/V1/Build/Warning.php b/Build/src/V1/Build/Warning.php deleted file mode 100644 index 055fbba3d104..000000000000 --- a/Build/src/V1/Build/Warning.php +++ /dev/null @@ -1,102 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Warning - */ -class Warning extends \Google\Protobuf\Internal\Message -{ - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - */ - private $text = ''; - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - */ - private $priority = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $text - * Explanation of the warning generated. - * @type int $priority - * The priority for this warning. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - * @return string - */ - public function getText() - { - return $this->text; - } - - /** - * Explanation of the warning generated. - * - * Generated from protobuf field string text = 1; - * @param string $var - * @return $this - */ - public function setText($var) - { - GPBUtil::checkString($var, True); - $this->text = $var; - - return $this; - } - - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - * @return int - */ - public function getPriority() - { - return $this->priority; - } - - /** - * The priority for this warning. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Warning.Priority priority = 2; - * @param int $var - * @return $this - */ - public function setPriority($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Warning\Priority::class); - $this->priority = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/Build/Warning/Priority.php b/Build/src/V1/Build/Warning/Priority.php deleted file mode 100644 index 597add0d8783..000000000000 --- a/Build/src/V1/Build/Warning/Priority.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.Build.Warning.Priority - */ -class Priority -{ - /** - * Should not be used. - * - * Generated from protobuf enum PRIORITY_UNSPECIFIED = 0; - */ - const PRIORITY_UNSPECIFIED = 0; - /** - * e.g. deprecation warnings and alternative feature highlights. - * - * Generated from protobuf enum INFO = 1; - */ - const INFO = 1; - /** - * e.g. automated detection of possible issues with the build. - * - * Generated from protobuf enum WARNING = 2; - */ - const WARNING = 2; - /** - * e.g. alerts that a feature used in the build is pending removal - * - * Generated from protobuf enum ALERT = 3; - */ - const ALERT = 3; - - private static $valueToName = [ - self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED', - self::INFO => 'INFO', - self::WARNING => 'WARNING', - self::ALERT => 'ALERT', - ]; - - 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/Build/src/V1/BuildApproval.php b/Build/src/V1/BuildApproval.php deleted file mode 100644 index e7cca0b668dd..000000000000 --- a/Build/src/V1/BuildApproval.php +++ /dev/null @@ -1,156 +0,0 @@ -google.devtools.cloudbuild.v1.BuildApproval - */ -class BuildApproval extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $config = null; - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $result = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * Output only. The state of this build's approval. - * @type \Google\Cloud\Build\V1\ApprovalConfig $config - * Output only. Configuration for manual approval of this build. - * @type \Google\Cloud\Build\V1\ApprovalResult $result - * Output only. Result of manual approval for this Build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of this build's approval. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildApproval.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildApproval\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\ApprovalConfig|null - */ - public function getConfig() - { - return $this->config; - } - - public function hasConfig() - { - return isset($this->config); - } - - public function clearConfig() - { - unset($this->config); - } - - /** - * Output only. Configuration for manual approval of this build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalConfig config = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\ApprovalConfig $var - * @return $this - */ - public function setConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalConfig::class); - $this->config = $var; - - return $this; - } - - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\ApprovalResult|null - */ - public function getResult() - { - return $this->result; - } - - public function hasResult() - { - return isset($this->result); - } - - public function clearResult() - { - unset($this->result); - } - - /** - * Output only. Result of manual approval for this Build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.ApprovalResult result = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\ApprovalResult $var - * @return $this - */ - public function setResult($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\ApprovalResult::class); - $this->result = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildApproval/State.php b/Build/src/V1/BuildApproval/State.php deleted file mode 100644 index 1719145811fc..000000000000 --- a/Build/src/V1/BuildApproval/State.php +++ /dev/null @@ -1,76 +0,0 @@ -google.devtools.cloudbuild.v1.BuildApproval.State - */ -class State -{ - /** - * Default enum type. This should not be used. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Build approval is pending. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * Build approval has been approved. - * - * Generated from protobuf enum APPROVED = 2; - */ - const APPROVED = 2; - /** - * Build approval has been rejected. - * - * Generated from protobuf enum REJECTED = 3; - */ - const REJECTED = 3; - /** - * Build was cancelled while it was still pending approval. - * - * Generated from protobuf enum CANCELLED = 5; - */ - const CANCELLED = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::APPROVED => 'APPROVED', - self::REJECTED => 'REJECTED', - self::CANCELLED => 'CANCELLED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOperationMetadata.php b/Build/src/V1/BuildOperationMetadata.php deleted file mode 100644 index 4ba9a7381cbc..000000000000 --- a/Build/src/V1/BuildOperationMetadata.php +++ /dev/null @@ -1,77 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOperationMetadata - */ -class BuildOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - */ - private $build = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\Build $build - * The build that the operation is tracking. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->build; - } - - public function hasBuild() - { - return isset($this->build); - } - - public function clearBuild() - { - unset($this->build); - } - - /** - * The build that the operation is tracking. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 1; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->build = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildOptions.php b/Build/src/V1/BuildOptions.php deleted file mode 100644 index ab0f0a38452c..000000000000 --- a/Build/src/V1/BuildOptions.php +++ /dev/null @@ -1,678 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions - */ -class BuildOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - */ - private $source_provenance_hash; - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - */ - private $requested_verify_option = 0; - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - */ - private $machine_type = 0; - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - */ - private $disk_size_gb = 0; - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - */ - private $substitution_option = 0; - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - */ - private $dynamic_substitutions = false; - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - */ - private $automap_substitutions = false; - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - */ - private $log_streaming_option = 0; - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @deprecated - */ - protected $worker_pool = ''; - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $pool = null; - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - */ - private $logging = 0; - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - */ - private $env; - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - */ - private $secret_env; - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - */ - private $volumes; - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $default_logs_bucket_behavior = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $source_provenance_hash - * Requested hash for SourceProvenance. - * @type int $requested_verify_option - * Requested verifiability options. - * @type int $machine_type - * Compute Engine machine type on which to run the build. - * @type int|string $disk_size_gb - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * @type int $substitution_option - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * @type bool $dynamic_substitutions - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * @type bool $automap_substitutions - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * @type int $log_streaming_option - * Option to define build log streaming behavior to Cloud - * Storage. - * @type string $worker_pool - * This field deprecated; please use `pool.name` instead. - * @type \Google\Cloud\Build\V1\BuildOptions\PoolOption $pool - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * @type int $logging - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * @type array|\Google\Protobuf\Internal\RepeatedField $env - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * @type array|\Google\Protobuf\Internal\RepeatedField $secret_env - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * @type array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * @type int $default_logs_bucket_behavior - * Optional. Option to specify how default logs buckets are setup. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSourceProvenanceHash() - { - return $this->source_provenance_hash; - } - - /** - * Requested hash for SourceProvenance. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash.HashType source_provenance_hash = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSourceProvenanceHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\Build\V1\Hash\HashType::class); - $this->source_provenance_hash = $arr; - - return $this; - } - - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - * @return int - */ - public function getRequestedVerifyOption() - { - return $this->requested_verify_option; - } - - /** - * Requested verifiability options. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2; - * @param int $var - * @return $this - */ - public function setRequestedVerifyOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\VerifyOption::class); - $this->requested_verify_option = $var; - - return $this; - } - - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - * @return int - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Compute Engine machine type on which to run the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.MachineType machine_type = 3; - * @param int $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\MachineType::class); - $this->machine_type = $var; - - return $this; - } - - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - * @return int|string - */ - public function getDiskSizeGb() - { - return $this->disk_size_gb; - } - - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating system and - * build utilities. Also note that this is the minimum disk size that will be - * allocated for the build -- the build may run with a larger disk than - * requested. At present, the maximum disk size is 2000GB; builds that request - * more than the maximum are rejected with an error. - * - * Generated from protobuf field int64 disk_size_gb = 6; - * @param int|string $var - * @return $this - */ - public function setDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->disk_size_gb = $var; - - return $this; - } - - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - * @return int - */ - public function getSubstitutionOption() - { - return $this->substitution_option; - } - - /** - * Option to specify behavior when there is an error in the substitution - * checks. - * NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot - * be overridden in the build configuration file. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4; - * @param int $var - * @return $this - */ - public function setSubstitutionOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\SubstitutionOption::class); - $this->substitution_option = $var; - - return $this; - } - - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - * @return bool - */ - public function getDynamicSubstitutions() - { - return $this->dynamic_substitutions; - } - - /** - * Option to specify whether or not to apply bash style string - * operations to the substitutions. - * NOTE: this is always enabled for triggered builds and cannot be - * overridden in the build configuration file. - * - * Generated from protobuf field bool dynamic_substitutions = 17; - * @param bool $var - * @return $this - */ - public function setDynamicSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->dynamic_substitutions = $var; - - return $this; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - * @return bool - */ - public function getAutomapSubstitutions() - { - return $this->automap_substitutions; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for all build steps. - * - * Generated from protobuf field bool automap_substitutions = 22; - * @param bool $var - * @return $this - */ - public function setAutomapSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->automap_substitutions = $var; - - return $this; - } - - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - * @return int - */ - public function getLogStreamingOption() - { - return $this->log_streaming_option; - } - - /** - * Option to define build log streaming behavior to Cloud - * Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5; - * @param int $var - * @return $this - */ - public function setLogStreamingOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\LogStreamingOption::class); - $this->log_streaming_option = $var; - - return $this; - } - - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @return string - * @deprecated - */ - public function getWorkerPool() - { - @trigger_error('worker_pool is deprecated.', E_USER_DEPRECATED); - return $this->worker_pool; - } - - /** - * This field deprecated; please use `pool.name` instead. - * - * Generated from protobuf field string worker_pool = 7 [deprecated = true]; - * @param string $var - * @return $this - * @deprecated - */ - public function setWorkerPool($var) - { - @trigger_error('worker_pool is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Build\V1\BuildOptions\PoolOption|null - */ - public function getPool() - { - return $this->pool; - } - - public function hasPool() - { - return isset($this->pool); - } - - public function clearPool() - { - unset($this->pool); - } - - /** - * Optional. Specification for execution on a `WorkerPool`. - * See [running builds in a private - * pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) - * for more information. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.PoolOption pool = 19 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Build\V1\BuildOptions\PoolOption $var - * @return $this - */ - public function setPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildOptions\PoolOption::class); - $this->pool = $var; - - return $this; - } - - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - * @return int - */ - public function getLogging() - { - return $this->logging; - } - - /** - * Option to specify the logging mode, which determines if and where build - * logs are stored. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.LoggingMode logging = 11; - * @param int $var - * @return $this - */ - public function setLogging($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\LoggingMode::class); - $this->logging = $var; - - return $this; - } - - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * A list of global environment variable definitions that will exist for all - * build steps in this build. If a variable is defined in both globally and in - * a build step, the variable will use the build step value. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 12; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->env = $arr; - - return $this; - } - - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * A list of global environment variables, which are encrypted using a Cloud - * Key Management Service crypto key. These values must be specified in the - * build's `Secret`. These variables will be available to all build steps - * in this build. - * - * Generated from protobuf field repeated string secret_env = 13; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secret_env = $arr; - - return $this; - } - - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * Global list of volumes to mount for ALL build steps - * Each volume is created as an empty volume prior to starting the build - * process. Upon completion of the build, volumes and their contents are - * discarded. Global volume names and paths cannot conflict with the volumes - * defined a build step. - * Using a global volume in a build with only one step is not valid as - * it is indicative of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 14; - * @param array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getDefaultLogsBucketBehavior() - { - return $this->default_logs_bucket_behavior; - } - - /** - * Optional. Option to specify how default logs buckets are setup. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior default_logs_bucket_behavior = 21 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setDefaultLogsBucketBehavior($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\BuildOptions\DefaultLogsBucketBehavior::class); - $this->default_logs_bucket_behavior = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php b/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php deleted file mode 100644 index 5287656a30fe..000000000000 --- a/Build/src/V1/BuildOptions/DefaultLogsBucketBehavior.php +++ /dev/null @@ -1,57 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.DefaultLogsBucketBehavior - */ -class DefaultLogsBucketBehavior -{ - /** - * Unspecified. - * - * Generated from protobuf enum DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED = 0; - */ - const DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED = 0; - /** - * Bucket is located in user-owned project in the same region as the - * build. The builder service account must have access to create and write - * to GCS buckets in the build project. - * - * Generated from protobuf enum REGIONAL_USER_OWNED_BUCKET = 1; - */ - const REGIONAL_USER_OWNED_BUCKET = 1; - - private static $valueToName = [ - self::DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED => 'DEFAULT_LOGS_BUCKET_BEHAVIOR_UNSPECIFIED', - self::REGIONAL_USER_OWNED_BUCKET => 'REGIONAL_USER_OWNED_BUCKET', - ]; - - 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/Build/src/V1/BuildOptions/LogStreamingOption.php b/Build/src/V1/BuildOptions/LogStreamingOption.php deleted file mode 100644 index bdc75a019a42..000000000000 --- a/Build/src/V1/BuildOptions/LogStreamingOption.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption - */ -class LogStreamingOption -{ - /** - * Service may automatically determine build log streaming behavior. - * - * Generated from protobuf enum STREAM_DEFAULT = 0; - */ - const STREAM_DEFAULT = 0; - /** - * Build logs should be streamed to Cloud Storage. - * - * Generated from protobuf enum STREAM_ON = 1; - */ - const STREAM_ON = 1; - /** - * Build logs should not be streamed to Cloud Storage; they will be - * written when the build is completed. - * - * Generated from protobuf enum STREAM_OFF = 2; - */ - const STREAM_OFF = 2; - - private static $valueToName = [ - self::STREAM_DEFAULT => 'STREAM_DEFAULT', - self::STREAM_ON => 'STREAM_ON', - self::STREAM_OFF => 'STREAM_OFF', - ]; - - 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/Build/src/V1/BuildOptions/LoggingMode.php b/Build/src/V1/BuildOptions/LoggingMode.php deleted file mode 100644 index 410395592eab..000000000000 --- a/Build/src/V1/BuildOptions/LoggingMode.php +++ /dev/null @@ -1,86 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.LoggingMode - */ -class LoggingMode -{ - /** - * The service determines the logging mode. The default is `LEGACY`. Do not - * rely on the default logging behavior as it may change in the future. - * - * Generated from protobuf enum LOGGING_UNSPECIFIED = 0; - */ - const LOGGING_UNSPECIFIED = 0; - /** - * Build logs are stored in Cloud Logging and Cloud Storage. - * - * Generated from protobuf enum LEGACY = 1; - */ - const LEGACY = 1; - /** - * Build logs are stored in Cloud Storage. - * - * Generated from protobuf enum GCS_ONLY = 2; - */ - const GCS_ONLY = 2; - /** - * This option is the same as CLOUD_LOGGING_ONLY. - * - * Generated from protobuf enum STACKDRIVER_ONLY = 3 [deprecated = true]; - */ - const STACKDRIVER_ONLY = 3; - /** - * Build logs are stored in Cloud Logging. Selecting this option will not - * allow [logs - * streaming](https://cloud.google.com/sdk/gcloud/reference/builds/log). - * - * Generated from protobuf enum CLOUD_LOGGING_ONLY = 5; - */ - const CLOUD_LOGGING_ONLY = 5; - /** - * Turn off all logging. No build logs will be captured. - * - * Generated from protobuf enum NONE = 4; - */ - const NONE = 4; - - private static $valueToName = [ - self::LOGGING_UNSPECIFIED => 'LOGGING_UNSPECIFIED', - self::LEGACY => 'LEGACY', - self::GCS_ONLY => 'GCS_ONLY', - self::STACKDRIVER_ONLY => 'STACKDRIVER_ONLY', - self::CLOUD_LOGGING_ONLY => 'CLOUD_LOGGING_ONLY', - self::NONE => 'NONE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/BuildOptions/MachineType.php b/Build/src/V1/BuildOptions/MachineType.php deleted file mode 100644 index 95db95eb6ae8..000000000000 --- a/Build/src/V1/BuildOptions/MachineType.php +++ /dev/null @@ -1,85 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.MachineType - */ -class MachineType -{ - /** - * Standard machine type. - * - * Generated from protobuf enum UNSPECIFIED = 0; - */ - const UNSPECIFIED = 0; - /** - * Highcpu machine with 8 CPUs. - * - * Generated from protobuf enum N1_HIGHCPU_8 = 1; - */ - const N1_HIGHCPU_8 = 1; - /** - * Highcpu machine with 32 CPUs. - * - * Generated from protobuf enum N1_HIGHCPU_32 = 2; - */ - const N1_HIGHCPU_32 = 2; - /** - * Highcpu e2 machine with 8 CPUs. - * - * Generated from protobuf enum E2_HIGHCPU_8 = 5; - */ - const E2_HIGHCPU_8 = 5; - /** - * Highcpu e2 machine with 32 CPUs. - * - * Generated from protobuf enum E2_HIGHCPU_32 = 6; - */ - const E2_HIGHCPU_32 = 6; - /** - * E2 machine with 1 CPU. - * - * Generated from protobuf enum E2_MEDIUM = 7; - */ - const E2_MEDIUM = 7; - - private static $valueToName = [ - self::UNSPECIFIED => 'UNSPECIFIED', - self::N1_HIGHCPU_8 => 'N1_HIGHCPU_8', - self::N1_HIGHCPU_32 => 'N1_HIGHCPU_32', - self::E2_HIGHCPU_8 => 'E2_HIGHCPU_8', - self::E2_HIGHCPU_32 => 'E2_HIGHCPU_32', - self::E2_MEDIUM => 'E2_MEDIUM', - ]; - - 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/Build/src/V1/BuildOptions/PoolOption.php b/Build/src/V1/BuildOptions/PoolOption.php deleted file mode 100644 index 53e03fbf90b2..000000000000 --- a/Build/src/V1/BuildOptions/PoolOption.php +++ /dev/null @@ -1,83 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.PoolOption - */ -class PoolOption extends \Google\Protobuf\Internal\Message -{ - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The `WorkerPool` resource to execute the build on. - * You must have `cloudbuild.workerpools.use` on the project hosting the - * WorkerPool. - * Format projects/{project}/locations/{location}/workerPools/{workerPoolId} - * - * Generated from protobuf field string name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/BuildOptions/SubstitutionOption.php b/Build/src/V1/BuildOptions/SubstitutionOption.php deleted file mode 100644 index c1746a028fde..000000000000 --- a/Build/src/V1/BuildOptions/SubstitutionOption.php +++ /dev/null @@ -1,56 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.SubstitutionOption - */ -class SubstitutionOption -{ - /** - * Fails the build if error in substitutions checks, like missing - * a substitution in the template or in the map. - * - * Generated from protobuf enum MUST_MATCH = 0; - */ - const MUST_MATCH = 0; - /** - * Do not fail the build if error in substitutions checks. - * - * Generated from protobuf enum ALLOW_LOOSE = 1; - */ - const ALLOW_LOOSE = 1; - - private static $valueToName = [ - self::MUST_MATCH => 'MUST_MATCH', - self::ALLOW_LOOSE => 'ALLOW_LOOSE', - ]; - - 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/Build/src/V1/BuildOptions/VerifyOption.php b/Build/src/V1/BuildOptions/VerifyOption.php deleted file mode 100644 index 322bf3106320..000000000000 --- a/Build/src/V1/BuildOptions/VerifyOption.php +++ /dev/null @@ -1,61 +0,0 @@ -google.devtools.cloudbuild.v1.BuildOptions.VerifyOption - */ -class VerifyOption -{ - /** - * Not a verifiable build (the default). - * - * Generated from protobuf enum NOT_VERIFIED = 0; - */ - const NOT_VERIFIED = 0; - /** - * Build must be verified. - * - * Generated from protobuf enum VERIFIED = 1; - */ - const VERIFIED = 1; - - private static $valueToName = [ - self::NOT_VERIFIED => 'NOT_VERIFIED', - self::VERIFIED => 'VERIFIED', - ]; - - 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/Build/src/V1/BuildStep.php b/Build/src/V1/BuildStep.php deleted file mode 100644 index 8f1fede51bc7..000000000000 --- a/Build/src/V1/BuildStep.php +++ /dev/null @@ -1,893 +0,0 @@ -google.devtools.cloudbuild.v1.BuildStep - */ -class BuildStep extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - */ - private $env; - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - */ - private $args; - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - */ - private $dir = ''; - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - */ - private $id = ''; - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - */ - private $wait_for; - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - */ - private $entrypoint = ''; - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - */ - private $secret_env; - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - */ - private $volumes; - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $timing = null; - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $pull_timing = null; - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - */ - private $timeout = null; - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $status = 0; - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - */ - private $allow_failure = false; - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $exit_code = 0; - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - */ - private $allow_exit_codes; - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - */ - private $script = ''; - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - */ - private $automap_substitutions = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * @type array|\Google\Protobuf\Internal\RepeatedField $env - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * @type array|\Google\Protobuf\Internal\RepeatedField $args - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * @type string $dir - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * @type string $id - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * @type array|\Google\Protobuf\Internal\RepeatedField $wait_for - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * @type string $entrypoint - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * @type array|\Google\Protobuf\Internal\RepeatedField $secret_env - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * @type array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $volumes - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * @type \Google\Cloud\Build\V1\TimeSpan $timing - * Output only. Stores timing information for executing this build step. - * @type \Google\Cloud\Build\V1\TimeSpan $pull_timing - * Output only. Stores timing information for pulling this build step's - * builder image only. - * @type \Google\Protobuf\Duration $timeout - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * @type int $status - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * @type bool $allow_failure - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * @type int $exit_code - * Output only. Return code from running the step. - * @type array|\Google\Protobuf\Internal\RepeatedField $allow_exit_codes - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * @type string $script - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * @type bool $automap_substitutions - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the container image that will run this particular - * build step. - * If the image is available in the host's Docker daemon's cache, it - * will be run directly. If not, the host will attempt to pull the image - * first, using the builder service account's credentials if necessary. - * The Docker daemon's cache will already have the latest versions of all of - * the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be refreshed at the time you - * attempt to use them. - * If you built an image in a previous build step, it will be stored in the - * host's Docker daemon's cache and is available to use as the name for a - * later build step. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEnv() - { - return $this->env; - } - - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment variable "KEY" - * being given the value "VALUE". - * - * Generated from protobuf field repeated string env = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->env = $arr; - - return $this; - } - - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getArgs() - { - return $this->args; - } - - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the `args` - * are used as arguments to that entrypoint. If the image does not define - * an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - * - * Generated from protobuf field repeated string args = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setArgs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->args = $arr; - - return $this; - } - - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Working directory to use when running this step's container. - * If this value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's working - * directory, in which case the contents of the path may not be persisted - * across build step executions, unless a `volume` for that path is specified. - * If the build specifies a `RepoSource` with `dir` and a step with a `dir`, - * which specifies an absolute path, the `RepoSource` `dir` is ignored for - * the step's execution. - * - * Generated from protobuf field string dir = 4; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Unique identifier for this build step, used in `wait_for` to - * reference this build step as a dependency. - * - * Generated from protobuf field string id = 5; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWaitFor() - { - return $this->wait_for; - } - - /** - * The ID(s) of the step(s) that this build step depends on. - * This build step will not start until all the build steps in `wait_for` - * have completed successfully. If `wait_for` is empty, this build step will - * start when all previous build steps in the `Build.Steps` list have - * completed successfully. - * - * Generated from protobuf field repeated string wait_for = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWaitFor($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->wait_for = $arr; - - return $this; - } - - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - * @return string - */ - public function getEntrypoint() - { - return $this->entrypoint; - } - - /** - * Entrypoint to be used instead of the build step image's default entrypoint. - * If unset, the image's default entrypoint is used. - * - * Generated from protobuf field string entrypoint = 7; - * @param string $var - * @return $this - */ - public function setEntrypoint($var) - { - GPBUtil::checkString($var, True); - $this->entrypoint = $var; - - return $this; - } - - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - * - * Generated from protobuf field repeated string secret_env = 8; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->secret_env = $arr; - - return $this; - } - - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getVolumes() - { - return $this->volumes; - } - - /** - * List of volumes to mount into the build step. - * Each volume is created as an empty volume prior to execution of the - * build step. Upon completion of the build, volumes and their contents are - * discarded. - * Using a named volume in only one step is not valid as it is indicative - * of a build request with an incorrect configuration. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Volume volumes = 9; - * @param array<\Google\Cloud\Build\V1\Volume>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setVolumes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Volume::class); - $this->volumes = $arr; - - return $this; - } - - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getTiming() - { - return $this->timing; - } - - public function hasTiming() - { - return isset($this->timing); - } - - public function clearTiming() - { - unset($this->timing); - } - - /** - * Output only. Stores timing information for executing this build step. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan timing = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->timing = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPullTiming() - { - return $this->pull_timing; - } - - public function hasPullTiming() - { - return isset($this->pull_timing); - } - - public function clearPullTiming() - { - unset($this->pull_timing); - } - - /** - * Output only. Stores timing information for pulling this build step's - * builder image only. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan pull_timing = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPullTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->pull_timing = $var; - - return $this; - } - - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - * @return \Google\Protobuf\Duration|null - */ - public function getTimeout() - { - return $this->timeout; - } - - public function hasTimeout() - { - return isset($this->timeout); - } - - public function clearTimeout() - { - unset($this->timeout); - } - - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - * - * Generated from protobuf field .google.protobuf.Duration timeout = 11; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setTimeout($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->timeout = $var; - - return $this; - } - - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getStatus() - { - return $this->status; - } - - /** - * Output only. Status of the build step. At this time, build step status is - * only updated on build completion; step status is not updated in real-time - * as the build progresses. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build.Status status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setStatus($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Build\Status::class); - $this->status = $var; - - return $this; - } - - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - * @return bool - */ - public function getAllowFailure() - { - return $this->allow_failure; - } - - /** - * Allow this build step to fail without failing the entire build. - * If false, the entire build will fail if this step fails. Otherwise, the - * build will succeed, but this step will still have a failure status. - * Error information will be reported in the failure_detail field. - * - * Generated from protobuf field bool allow_failure = 14; - * @param bool $var - * @return $this - */ - public function setAllowFailure($var) - { - GPBUtil::checkBool($var); - $this->allow_failure = $var; - - return $this; - } - - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getExitCode() - { - return $this->exit_code; - } - - /** - * Output only. Return code from running the step. - * - * Generated from protobuf field int32 exit_code = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setExitCode($var) - { - GPBUtil::checkInt32($var); - $this->exit_code = $var; - - return $this; - } - - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAllowExitCodes() - { - return $this->allow_exit_codes; - } - - /** - * Allow this build step to fail without failing the entire build if and - * only if the exit code is one of the specified codes. If allow_failure - * is also specified, this field will take precedence. - * - * Generated from protobuf field repeated int32 allow_exit_codes = 18; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAllowExitCodes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); - $this->allow_exit_codes = $arr; - - return $this; - } - - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - * @return string - */ - public function getScript() - { - return $this->script; - } - - /** - * A shell script to be executed in the step. - * When script is provided, the user cannot specify the entrypoint or args. - * - * Generated from protobuf field string script = 19; - * @param string $var - * @return $this - */ - public function setScript($var) - { - GPBUtil::checkString($var, True); - $this->script = $var; - - return $this; - } - - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - * @return bool - */ - public function getAutomapSubstitutions() - { - return isset($this->automap_substitutions) ? $this->automap_substitutions : false; - } - - public function hasAutomapSubstitutions() - { - return isset($this->automap_substitutions); - } - - public function clearAutomapSubstitutions() - { - unset($this->automap_substitutions); - } - - /** - * Option to include built-in and custom substitutions as env variables - * for this build step. This option will override the global option - * in BuildOption. - * - * Generated from protobuf field optional bool automap_substitutions = 20; - * @param bool $var - * @return $this - */ - public function setAutomapSubstitutions($var) - { - GPBUtil::checkBool($var); - $this->automap_substitutions = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/BuildTrigger.php b/Build/src/V1/BuildTrigger.php deleted file mode 100644 index 88d9556e4ddb..000000000000 --- a/Build/src/V1/BuildTrigger.php +++ /dev/null @@ -1,1026 +0,0 @@ -google.devtools.cloudbuild.v1.BuildTrigger - */ -class BuildTrigger extends \Google\Protobuf\Internal\Message -{ - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - */ - private $resource_name = ''; - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $id = ''; - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - */ - private $description = ''; - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - */ - private $name = ''; - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - */ - private $tags; - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - */ - private $trigger_template = null; - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - */ - private $github = null; - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - */ - private $pubsub_config = null; - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - */ - private $webhook_config = null; - /** - * Output only. Time when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - */ - private $disabled = false; - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - */ - private $substitutions; - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - */ - private $ignored_files; - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - */ - private $included_files; - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $filter = ''; - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - */ - private $source_to_build = null; - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - */ - private $service_account = ''; - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - */ - private $repository_event_config = null; - protected $build_template; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $resource_name - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * @type string $id - * Output only. Unique identifier of the trigger. - * @type string $description - * Human-readable description of this trigger. - * @type string $name - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * @type array|\Google\Protobuf\Internal\RepeatedField $tags - * Tags for annotation of a `BuildTrigger` - * @type \Google\Cloud\Build\V1\RepoSource $trigger_template - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * @type \Google\Cloud\Build\V1\GitHubEventsConfig $github - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * @type \Google\Cloud\Build\V1\PubsubConfig $pubsub_config - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * @type \Google\Cloud\Build\V1\WebhookConfig $webhook_config - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * @type bool $autodetect - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * @type \Google\Cloud\Build\V1\Build $build - * Contents of the build template. - * @type string $filename - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * @type \Google\Cloud\Build\V1\GitFileSource $git_file_source - * The file source describing the local or remote Build template. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time when the trigger was created. - * @type bool $disabled - * If true, the trigger will never automatically execute a build. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * @type array|\Google\Protobuf\Internal\RepeatedField $ignored_files - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * @type array|\Google\Protobuf\Internal\RepeatedField $included_files - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * @type string $filter - * Optional. A Common Expression Language string. - * @type \Google\Cloud\Build\V1\GitRepoSource $source_to_build - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * @type string $service_account - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * @type \Google\Cloud\Build\V1\RepositoryEventConfig $repository_event_config - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - * @return string - */ - public function getResourceName() - { - return $this->resource_name; - } - - /** - * The `Trigger` name with format: - * `projects/{project}/locations/{location}/triggers/{trigger}`, where - * {trigger} is a unique identifier generated by the service. - * - * Generated from protobuf field string resource_name = 34; - * @param string $var - * @return $this - */ - public function setResourceName($var) - { - GPBUtil::checkString($var, True); - $this->resource_name = $var; - - return $this; - } - - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Output only. Unique identifier of the trigger. - * - * Generated from protobuf field string id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Human-readable description of this trigger. - * - * Generated from protobuf field string description = 10; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * User-assigned name of the trigger. Must be unique within the project. - * Trigger names must meet the following requirements: - * + They must contain only alphanumeric characters and dashes. - * + They can be 1-64 characters long. - * + They must begin and end with an alphanumeric character. - * - * Generated from protobuf field string name = 21; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTags() - { - return $this->tags; - } - - /** - * Tags for annotation of a `BuildTrigger` - * - * Generated from protobuf field repeated string tags = 19; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTags($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->tags = $arr; - - return $this; - } - - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getTriggerTemplate() - { - return $this->trigger_template; - } - - public function hasTriggerTemplate() - { - return isset($this->trigger_template); - } - - public function clearTriggerTemplate() - { - unset($this->trigger_template); - } - - /** - * Template describing the types of source changes to trigger a build. - * Branch and tag names in trigger templates are interpreted as regular - * expressions. Any branch or tag change that matches that regular expression - * will trigger a build. - * Mutually exclusive with `github`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource trigger_template = 7; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setTriggerTemplate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->trigger_template = $var; - - return $this; - } - - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - * @return \Google\Cloud\Build\V1\GitHubEventsConfig|null - */ - public function getGithub() - { - return $this->github; - } - - public function hasGithub() - { - return isset($this->github); - } - - public function clearGithub() - { - unset($this->github); - } - - /** - * GitHubEventsConfig describes the configuration of a trigger that creates - * a build whenever a GitHub event is received. - * Mutually exclusive with `trigger_template`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEventsConfig github = 13; - * @param \Google\Cloud\Build\V1\GitHubEventsConfig $var - * @return $this - */ - public function setGithub($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitHubEventsConfig::class); - $this->github = $var; - - return $this; - } - - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - * @return \Google\Cloud\Build\V1\PubsubConfig|null - */ - public function getPubsubConfig() - { - return $this->pubsub_config; - } - - public function hasPubsubConfig() - { - return isset($this->pubsub_config); - } - - public function clearPubsubConfig() - { - unset($this->pubsub_config); - } - - /** - * PubsubConfig describes the configuration of a trigger that - * creates a build whenever a Pub/Sub message is published. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig pubsub_config = 29; - * @param \Google\Cloud\Build\V1\PubsubConfig $var - * @return $this - */ - public function setPubsubConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PubsubConfig::class); - $this->pubsub_config = $var; - - return $this; - } - - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - * @return \Google\Cloud\Build\V1\WebhookConfig|null - */ - public function getWebhookConfig() - { - return $this->webhook_config; - } - - public function hasWebhookConfig() - { - return isset($this->webhook_config); - } - - public function clearWebhookConfig() - { - unset($this->webhook_config); - } - - /** - * WebhookConfig describes the configuration of a trigger that - * creates a build whenever a webhook is sent to a trigger's webhook URL. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig webhook_config = 31; - * @param \Google\Cloud\Build\V1\WebhookConfig $var - * @return $this - */ - public function setWebhookConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WebhookConfig::class); - $this->webhook_config = $var; - - return $this; - } - - /** - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * - * Generated from protobuf field bool autodetect = 18; - * @return bool - */ - public function getAutodetect() - { - return $this->readOneof(18); - } - - public function hasAutodetect() - { - return $this->hasOneof(18); - } - - /** - * Autodetect build configuration. The following precedence is used (case - * insensitive): - * 1. cloudbuild.yaml - * 2. cloudbuild.yml - * 3. cloudbuild.json - * 4. Dockerfile - * Currently only available for GitHub App Triggers. - * - * Generated from protobuf field bool autodetect = 18; - * @param bool $var - * @return $this - */ - public function setAutodetect($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(18, $var); - - return $this; - } - - /** - * Contents of the build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 4; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->readOneof(4); - } - - public function hasBuild() - { - return $this->hasOneof(4); - } - - /** - * Contents of the build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 4; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * - * Generated from protobuf field string filename = 8; - * @return string - */ - public function getFilename() - { - return $this->readOneof(8); - } - - public function hasFilename() - { - return $this->hasOneof(8); - } - - /** - * Path, from the source root, to the build configuration file - * (i.e. cloudbuild.yaml). - * - * Generated from protobuf field string filename = 8; - * @param string $var - * @return $this - */ - public function setFilename($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The file source describing the local or remote Build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource git_file_source = 24; - * @return \Google\Cloud\Build\V1\GitFileSource|null - */ - public function getGitFileSource() - { - return $this->readOneof(24); - } - - public function hasGitFileSource() - { - return $this->hasOneof(24); - } - - /** - * The file source describing the local or remote Build template. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource git_file_source = 24; - * @param \Google\Cloud\Build\V1\GitFileSource $var - * @return $this - */ - public function setGitFileSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitFileSource::class); - $this->writeOneof(24, $var); - - return $this; - } - - /** - * Output only. Time when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 when the trigger was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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; - } - - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - * @return bool - */ - public function getDisabled() - { - return $this->disabled; - } - - /** - * If true, the trigger will never automatically execute a build. - * - * Generated from protobuf field bool disabled = 9; - * @param bool $var - * @return $this - */ - public function setDisabled($var) - { - GPBUtil::checkBool($var); - $this->disabled = $var; - - return $this; - } - - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions for Build resource. The keys must match the following - * regular expression: `^_[A-Z0-9_]+$`. - * - * Generated from protobuf field map substitutions = 11; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIgnoredFiles() - { - return $this->ignored_files; - } - - /** - * ignored_files and included_files are file glob matches using - * https://golang.org/pkg/path/filepath/#Match extended with support for "**". - * If ignored_files and changed files are both empty, then they are - * not used to determine whether or not to trigger a build. - * If ignored_files is not empty, then we ignore any files that match - * any of the ignored_file globs. If the change has no files that are - * outside of the ignored_files globs, then we do not trigger a build. - * - * Generated from protobuf field repeated string ignored_files = 15; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIgnoredFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->ignored_files = $arr; - - return $this; - } - - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIncludedFiles() - { - return $this->included_files; - } - - /** - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is empty, then as far as this filter is - * concerned, we should trigger the build. - * If any of the files altered in the commit pass the ignored_files - * filter and included_files is not empty, then we make sure that at - * least one of those files matches a included_files glob. If not, - * then we do not trigger a build. - * - * Generated from protobuf field repeated string included_files = 16; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIncludedFiles($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->included_files = $arr; - - return $this; - } - - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Optional. A Common Expression Language string. - * - * Generated from protobuf field string filter = 30 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - * @return \Google\Cloud\Build\V1\GitRepoSource|null - */ - public function getSourceToBuild() - { - return $this->source_to_build; - } - - public function hasSourceToBuild() - { - return isset($this->source_to_build); - } - - public function clearSourceToBuild() - { - unset($this->source_to_build); - } - - /** - * The repo and ref of the repository from which to build. This field - * is used only for those triggers that do not respond to SCM events. - * Triggers that respond to such events build source at whatever commit - * caused the event. - * This field is currently only used by Webhook, Pub/Sub, Manual, and Cron - * triggers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitRepoSource source_to_build = 26; - * @param \Google\Cloud\Build\V1\GitRepoSource $var - * @return $this - */ - public function setSourceToBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitRepoSource::class); - $this->source_to_build = $var; - - return $this; - } - - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * The service account used for all user-controlled operations including - * UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. - * If no service account is set, then the standard Cloud Build service account - * ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. - * Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` - * - * Generated from protobuf field string service_account = 33 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - * @return \Google\Cloud\Build\V1\RepositoryEventConfig|null - */ - public function getRepositoryEventConfig() - { - return $this->repository_event_config; - } - - public function hasRepositoryEventConfig() - { - return isset($this->repository_event_config); - } - - public function clearRepositoryEventConfig() - { - unset($this->repository_event_config); - } - - /** - * The configuration of a trigger that creates a build whenever an event from - * Repo API is received. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig repository_event_config = 39; - * @param \Google\Cloud\Build\V1\RepositoryEventConfig $var - * @return $this - */ - public function setRepositoryEventConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepositoryEventConfig::class); - $this->repository_event_config = $var; - - return $this; - } - - /** - * @return string - */ - public function getBuildTemplate() - { - return $this->whichOneof("build_template"); - } - -} - diff --git a/Build/src/V1/BuiltImage.php b/Build/src/V1/BuiltImage.php deleted file mode 100644 index 31607e2e6e78..000000000000 --- a/Build/src/V1/BuiltImage.php +++ /dev/null @@ -1,149 +0,0 @@ -google.devtools.cloudbuild.v1.BuiltImage - */ -class BuiltImage extends \Google\Protobuf\Internal\Message -{ - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - */ - private $digest = ''; - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * @type string $digest - * Docker Registry 2.0 digest. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified image. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - * @return string - */ - public function getDigest() - { - return $this->digest; - } - - /** - * Docker Registry 2.0 digest. - * - * Generated from protobuf field string digest = 3; - * @param string $var - * @return $this - */ - public function setDigest($var) - { - GPBUtil::checkString($var, True); - $this->digest = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified image. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CancelBuildRequest.php b/Build/src/V1/CancelBuildRequest.php deleted file mode 100644 index 60a55c83b240..000000000000 --- a/Build/src/V1/CancelBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.CancelBuildRequest - */ -class CancelBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. ID of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CloudBuildClient.php b/Build/src/V1/CloudBuildClient.php deleted file mode 100644 index f5ea759ea154..000000000000 --- a/Build/src/V1/CloudBuildClient.php +++ /dev/null @@ -1,34 +0,0 @@ -google.devtools.cloudbuild.v1.CreateBuildRequest - */ -class CreateBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $build = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project. - * @type \Google\Cloud\Build\V1\Build $build - * Required. Build resource to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\Build|null - */ - public function getBuild() - { - return $this->build; - } - - public function hasBuild() - { - return isset($this->build); - } - - public function clearBuild() - { - unset($this->build); - } - - /** - * Required. Build resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Build build = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\Build $var - * @return $this - */ - public function setBuild($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\Build::class); - $this->build = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateBuildTriggerRequest.php b/Build/src/V1/CreateBuildTriggerRequest.php deleted file mode 100644 index 15fed4962d3d..000000000000 --- a/Build/src/V1/CreateBuildTriggerRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -google.devtools.cloudbuild.v1.CreateBuildTriggerRequest - */ -class CreateBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project for which to configure automatic builds. - * @type \Google\Cloud\Build\V1\BuildTrigger $trigger - * Required. `BuildTrigger` to create. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 3 [(.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 project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project for which to configure automatic builds. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\BuildTrigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * Required. `BuildTrigger` to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\BuildTrigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->trigger = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateWorkerPoolOperationMetadata.php b/Build/src/V1/CreateWorkerPoolOperationMetadata.php deleted file mode 100644 index aa01956699e4..000000000000 --- a/Build/src/V1/CreateWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata - */ -class CreateWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` to create. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/CreateWorkerPoolRequest.php b/Build/src/V1/CreateWorkerPoolRequest.php deleted file mode 100644 index 3f7f3326373c..000000000000 --- a/Build/src/V1/CreateWorkerPoolRequest.php +++ /dev/null @@ -1,199 +0,0 @@ -google.devtools.cloudbuild.v1.CreateWorkerPoolRequest - */ -class CreateWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool = null; - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool_id = ''; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * @type \Google\Cloud\Build\V1\WorkerPool $worker_pool - * Required. `WorkerPool` resource to create. - * @type string $worker_pool_id - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\WorkerPool|null - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - public function hasWorkerPool() - { - return isset($this->worker_pool); - } - - public function clearWorkerPool() - { - unset($this->worker_pool); - } - - /** - * Required. `WorkerPool` resource to create. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\WorkerPool $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pool = $var; - - return $this; - } - - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getWorkerPoolId() - { - return $this->worker_pool_id; - } - - /** - * Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * - * Generated from protobuf field string worker_pool_id = 3 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setWorkerPoolId($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool_id = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteBuildTriggerRequest.php b/Build/src/V1/DeleteBuildTriggerRequest.php deleted file mode 100644 index 2fb63fedc9bc..000000000000 --- a/Build/src/V1/DeleteBuildTriggerRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteBuildTriggerRequest - */ -class DeleteBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. ID of the `BuildTrigger` to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.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 project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the `BuildTrigger` to delete. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteWorkerPoolOperationMetadata.php b/Build/src/V1/DeleteWorkerPoolOperationMetadata.php deleted file mode 100644 index 88c128334bd7..000000000000 --- a/Build/src/V1/DeleteWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata - */ -class DeleteWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` being deleted. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/DeleteWorkerPoolRequest.php b/Build/src/V1/DeleteWorkerPoolRequest.php deleted file mode 100644 index 053ab7401b92..000000000000 --- a/Build/src/V1/DeleteWorkerPoolRequest.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest - */ -class DeleteWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $etag = ''; - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - */ - private $allow_missing = false; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @type string $etag - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * @type bool $allow_missing - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * 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 `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * 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. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * - * Generated from protobuf field string etag = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/FileHashes.php b/Build/src/V1/FileHashes.php deleted file mode 100644 index 044ed6721551..000000000000 --- a/Build/src/V1/FileHashes.php +++ /dev/null @@ -1,68 +0,0 @@ -google.devtools.cloudbuild.v1.FileHashes - */ -class FileHashes extends \Google\Protobuf\Internal\Message -{ - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - */ - private $file_hash; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\Hash>|\Google\Protobuf\Internal\RepeatedField $file_hash - * Collection of file hashes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFileHash() - { - return $this->file_hash; - } - - /** - * Collection of file hashes. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Hash file_hash = 1; - * @param array<\Google\Cloud\Build\V1\Hash>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFileHash($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Hash::class); - $this->file_hash = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Gapic/CloudBuildGapicClient.php b/Build/src/V1/Gapic/CloudBuildGapicClient.php deleted file mode 100644 index c1c1bbf135a8..000000000000 --- a/Build/src/V1/Gapic/CloudBuildGapicClient.php +++ /dev/null @@ -1,2136 +0,0 @@ -approveBuild($name); - * $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 = $cloudBuildClient->approveBuild($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'approveBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated This class will be removed in the next major version update. - */ -class CloudBuildGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.cloudbuild.v1.CloudBuild'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudbuild.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudbuild.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $buildNameTemplate; - - private static $buildTriggerNameTemplate; - - private static $cryptoKeyNameTemplate; - - private static $githubEnterpriseConfigNameTemplate; - - private static $locationNameTemplate; - - private static $networkNameTemplate; - - private static $projectNameTemplate; - - private static $projectBuildNameTemplate; - - private static $projectConfigNameTemplate; - - private static $projectLocationBuildNameTemplate; - - private static $projectLocationConfigNameTemplate; - - private static $projectLocationTriggerNameTemplate; - - private static $projectTriggerNameTemplate; - - private static $repositoryNameTemplate; - - private static $secretVersionNameTemplate; - - private static $serviceAccountNameTemplate; - - private static $subscriptionNameTemplate; - - private static $topicNameTemplate; - - private static $workerPoolNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/cloud_build_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/cloud_build_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/cloud_build_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/cloud_build_rest_client_config.php', - ], - ], - ]; - } - - private static function getBuildNameTemplate() - { - if (self::$buildNameTemplate == null) { - self::$buildNameTemplate = new PathTemplate('projects/{project}/builds/{build}'); - } - - return self::$buildNameTemplate; - } - - private static function getBuildTriggerNameTemplate() - { - if (self::$buildTriggerNameTemplate == null) { - self::$buildTriggerNameTemplate = new PathTemplate('projects/{project}/triggers/{trigger}'); - } - - return self::$buildTriggerNameTemplate; - } - - private static function getCryptoKeyNameTemplate() - { - if (self::$cryptoKeyNameTemplate == null) { - self::$cryptoKeyNameTemplate = new PathTemplate('projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}'); - } - - return self::$cryptoKeyNameTemplate; - } - - private static function getGithubEnterpriseConfigNameTemplate() - { - if (self::$githubEnterpriseConfigNameTemplate == null) { - self::$githubEnterpriseConfigNameTemplate = new PathTemplate('projects/{project}/githubEnterpriseConfigs/{config}'); - } - - return self::$githubEnterpriseConfigNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getNetworkNameTemplate() - { - if (self::$networkNameTemplate == null) { - self::$networkNameTemplate = new PathTemplate('projects/{project}/global/networks/{network}'); - } - - return self::$networkNameTemplate; - } - - private static function getProjectNameTemplate() - { - if (self::$projectNameTemplate == null) { - self::$projectNameTemplate = new PathTemplate('projects/{project}'); - } - - return self::$projectNameTemplate; - } - - private static function getProjectBuildNameTemplate() - { - if (self::$projectBuildNameTemplate == null) { - self::$projectBuildNameTemplate = new PathTemplate('projects/{project}/builds/{build}'); - } - - return self::$projectBuildNameTemplate; - } - - private static function getProjectConfigNameTemplate() - { - if (self::$projectConfigNameTemplate == null) { - self::$projectConfigNameTemplate = new PathTemplate('projects/{project}/githubEnterpriseConfigs/{config}'); - } - - return self::$projectConfigNameTemplate; - } - - private static function getProjectLocationBuildNameTemplate() - { - if (self::$projectLocationBuildNameTemplate == null) { - self::$projectLocationBuildNameTemplate = new PathTemplate('projects/{project}/locations/{location}/builds/{build}'); - } - - return self::$projectLocationBuildNameTemplate; - } - - private static function getProjectLocationConfigNameTemplate() - { - if (self::$projectLocationConfigNameTemplate == null) { - self::$projectLocationConfigNameTemplate = new PathTemplate('projects/{project}/locations/{location}/githubEnterpriseConfigs/{config}'); - } - - return self::$projectLocationConfigNameTemplate; - } - - private static function getProjectLocationTriggerNameTemplate() - { - if (self::$projectLocationTriggerNameTemplate == null) { - self::$projectLocationTriggerNameTemplate = new PathTemplate('projects/{project}/locations/{location}/triggers/{trigger}'); - } - - return self::$projectLocationTriggerNameTemplate; - } - - private static function getProjectTriggerNameTemplate() - { - if (self::$projectTriggerNameTemplate == null) { - self::$projectTriggerNameTemplate = new PathTemplate('projects/{project}/triggers/{trigger}'); - } - - return self::$projectTriggerNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getSecretVersionNameTemplate() - { - if (self::$secretVersionNameTemplate == null) { - self::$secretVersionNameTemplate = new PathTemplate('projects/{project}/secrets/{secret}/versions/{version}'); - } - - return self::$secretVersionNameTemplate; - } - - private static function getServiceAccountNameTemplate() - { - if (self::$serviceAccountNameTemplate == null) { - self::$serviceAccountNameTemplate = new PathTemplate('projects/{project}/serviceAccounts/{service_account}'); - } - - return self::$serviceAccountNameTemplate; - } - - private static function getSubscriptionNameTemplate() - { - if (self::$subscriptionNameTemplate == null) { - self::$subscriptionNameTemplate = new PathTemplate('projects/{project}/subscriptions/{subscription}'); - } - - return self::$subscriptionNameTemplate; - } - - private static function getTopicNameTemplate() - { - if (self::$topicNameTemplate == null) { - self::$topicNameTemplate = new PathTemplate('projects/{project}/topics/{topic}'); - } - - return self::$topicNameTemplate; - } - - private static function getWorkerPoolNameTemplate() - { - if (self::$workerPoolNameTemplate == null) { - self::$workerPoolNameTemplate = new PathTemplate('projects/{project}/locations/{location}/workerPools/{worker_pool}'); - } - - return self::$workerPoolNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'build' => self::getBuildNameTemplate(), - 'buildTrigger' => self::getBuildTriggerNameTemplate(), - 'cryptoKey' => self::getCryptoKeyNameTemplate(), - 'githubEnterpriseConfig' => self::getGithubEnterpriseConfigNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'network' => self::getNetworkNameTemplate(), - 'project' => self::getProjectNameTemplate(), - 'projectBuild' => self::getProjectBuildNameTemplate(), - 'projectConfig' => self::getProjectConfigNameTemplate(), - 'projectLocationBuild' => self::getProjectLocationBuildNameTemplate(), - 'projectLocationConfig' => self::getProjectLocationConfigNameTemplate(), - 'projectLocationTrigger' => self::getProjectLocationTriggerNameTemplate(), - 'projectTrigger' => self::getProjectTriggerNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'secretVersion' => self::getSecretVersionNameTemplate(), - 'serviceAccount' => self::getServiceAccountNameTemplate(), - 'subscription' => self::getSubscriptionNameTemplate(), - 'topic' => self::getTopicNameTemplate(), - 'workerPool' => self::getWorkerPoolNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a build - * resource. - * - * @param string $project - * @param string $build - * - * @return string The formatted build resource. - */ - public static function buildName($project, $build) - { - return self::getBuildNameTemplate()->render([ - 'project' => $project, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * build_trigger resource. - * - * @param string $project - * @param string $trigger - * - * @return string The formatted build_trigger resource. - */ - public static function buildTriggerName($project, $trigger) - { - return self::getBuildTriggerNameTemplate()->render([ - 'project' => $project, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a crypto_key - * resource. - * - * @param string $project - * @param string $location - * @param string $keyring - * @param string $key - * - * @return string The formatted crypto_key resource. - */ - public static function cryptoKeyName($project, $location, $keyring, $key) - { - return self::getCryptoKeyNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'keyring' => $keyring, - 'key' => $key, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * github_enterprise_config resource. - * - * @param string $project - * @param string $config - * - * @return string The formatted github_enterprise_config resource. - */ - public static function githubEnterpriseConfigName($project, $config) - { - return self::getGithubEnterpriseConfigNameTemplate()->render([ - 'project' => $project, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a network - * resource. - * - * @param string $project - * @param string $network - * - * @return string The formatted network resource. - */ - public static function networkName($project, $network) - { - return self::getNetworkNameTemplate()->render([ - 'project' => $project, - 'network' => $network, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a project - * resource. - * - * @param string $project - * - * @return string The formatted project resource. - */ - public static function projectName($project) - { - return self::getProjectNameTemplate()->render([ - 'project' => $project, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_build resource. - * - * @param string $project - * @param string $build - * - * @return string The formatted project_build resource. - */ - public static function projectBuildName($project, $build) - { - return self::getProjectBuildNameTemplate()->render([ - 'project' => $project, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_config resource. - * - * @param string $project - * @param string $config - * - * @return string The formatted project_config resource. - */ - public static function projectConfigName($project, $config) - { - return self::getProjectConfigNameTemplate()->render([ - 'project' => $project, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_build resource. - * - * @param string $project - * @param string $location - * @param string $build - * - * @return string The formatted project_location_build resource. - */ - public static function projectLocationBuildName($project, $location, $build) - { - return self::getProjectLocationBuildNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'build' => $build, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_config resource. - * - * @param string $project - * @param string $location - * @param string $config - * - * @return string The formatted project_location_config resource. - */ - public static function projectLocationConfigName($project, $location, $config) - { - return self::getProjectLocationConfigNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'config' => $config, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_location_trigger resource. - * - * @param string $project - * @param string $location - * @param string $trigger - * - * @return string The formatted project_location_trigger resource. - */ - public static function projectLocationTriggerName($project, $location, $trigger) - { - return self::getProjectLocationTriggerNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * project_trigger resource. - * - * @param string $project - * @param string $trigger - * - * @return string The formatted project_trigger resource. - */ - public static function projectTriggerName($project, $trigger) - { - return self::getProjectTriggerNameTemplate()->render([ - 'project' => $project, - 'trigger' => $trigger, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * @param string $repository - * - * @return string The formatted repository resource. - */ - public static function repositoryName($project, $location, $connection, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName($project, $secret, $version) - { - return self::getSecretVersionNameTemplate()->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_account resource. - * - * @param string $project - * @param string $serviceAccount - * - * @return string The formatted service_account resource. - */ - public static function serviceAccountName($project, $serviceAccount) - { - return self::getServiceAccountNameTemplate()->render([ - 'project' => $project, - 'service_account' => $serviceAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a subscription - * resource. - * - * @param string $project - * @param string $subscription - * - * @return string The formatted subscription resource. - */ - public static function subscriptionName($project, $subscription) - { - return self::getSubscriptionNameTemplate()->render([ - 'project' => $project, - 'subscription' => $subscription, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a topic - * resource. - * - * @param string $project - * @param string $topic - * - * @return string The formatted topic resource. - */ - public static function topicName($project, $topic) - { - return self::getTopicNameTemplate()->render([ - 'project' => $project, - 'topic' => $topic, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a worker_pool - * resource. - * - * @param string $project - * @param string $location - * @param string $workerPool - * - * @return string The formatted worker_pool resource. - */ - public static function workerPoolName($project, $location, $workerPool) - { - return self::getWorkerPoolNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'worker_pool' => $workerPool, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - build: projects/{project}/builds/{build} - * - buildTrigger: projects/{project}/triggers/{trigger} - * - cryptoKey: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key} - * - githubEnterpriseConfig: projects/{project}/githubEnterpriseConfigs/{config} - * - location: projects/{project}/locations/{location} - * - network: projects/{project}/global/networks/{network} - * - project: projects/{project} - * - projectBuild: projects/{project}/builds/{build} - * - projectConfig: projects/{project}/githubEnterpriseConfigs/{config} - * - projectLocationBuild: projects/{project}/locations/{location}/builds/{build} - * - projectLocationConfig: projects/{project}/locations/{location}/githubEnterpriseConfigs/{config} - * - projectLocationTrigger: projects/{project}/locations/{location}/triggers/{trigger} - * - projectTrigger: projects/{project}/triggers/{trigger} - * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - serviceAccount: projects/{project}/serviceAccounts/{service_account} - * - subscription: projects/{project}/subscriptions/{subscription} - * - topic: projects/{project}/topics/{topic} - * - workerPool: projects/{project}/locations/{location}/workerPools/{worker_pool} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudbuild.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Approves or rejects a pending build. - * - * If approved, the returned LRO will be analogous to the LRO returned from - * a CreateBuild call. - * - * If rejected, the returned LRO will be immediately done. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $name = 'name'; - * $operationResponse = $cloudBuildClient->approveBuild($name); - * $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 = $cloudBuildClient->approveBuild($name); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'approveBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the target build. - * For example: "projects/{$project_id}/builds/{$build_id}" - * @param array $optionalArgs { - * Optional. - * - * @type ApprovalResult $approvalResult - * Approval decision and metadata. - * @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 approveBuild($name, array $optionalArgs = []) - { - $request = new ApproveBuildRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - if (isset($optionalArgs['approvalResult'])) { - $request->setApprovalResult($optionalArgs['approvalResult']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ApproveBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Cancels a build in progress. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $response = $cloudBuildClient->cancelBuild($projectId, $id); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. ID of the build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to cancel. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @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\Build\V1\Build - * - * @throws ApiException if the remote call fails - */ - public function cancelBuild($projectId, $id, array $optionalArgs = []) - { - $request = new CancelBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CancelBuild', Build::class, $optionalArgs, $request)->wait(); - } - - /** - * Starts a build with the specified configuration. - * - * This method returns a long-running `Operation`, which includes the build - * ID. Pass the build ID to `GetBuild` to determine the build status (such as - * `SUCCESS` or `FAILURE`). - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $build = new Build(); - * $operationResponse = $cloudBuildClient->createBuild($projectId, $build); - * $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 = $cloudBuildClient->createBuild($projectId, $build); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'createBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param Build $build Required. Build resource to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createBuild($projectId, $build, array $optionalArgs = []) - { - $request = new CreateBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setBuild($build); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a new `BuildTrigger`. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $trigger = new BuildTrigger(); - * $response = $cloudBuildClient->createBuildTrigger($projectId, $trigger); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project for which to configure automatic builds. - * @param BuildTrigger $trigger Required. `BuildTrigger` to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent resource where this trigger will be created. - * Format: `projects/{project}/locations/{location}` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function createBuildTrigger($projectId, $trigger, array $optionalArgs = []) - { - $request = new CreateBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTrigger($trigger); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedParent = $cloudBuildClient->locationName('[PROJECT]', '[LOCATION]'); - * $workerPool = new WorkerPool(); - * $workerPoolId = 'worker_pool_id'; - * $operationResponse = $cloudBuildClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - * $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 = $cloudBuildClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'createWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent resource where this worker pool will be created. - * Format: `projects/{project}/locations/{location}`. - * @param WorkerPool $workerPool Required. `WorkerPool` resource to create. - * @param string $workerPoolId Required. Immutable. The ID to use for the `WorkerPool`, which will become - * the final component of the resource name. - * - * This value should be 1-63 characters, and valid characters - * are /[a-z][0-9]-/. - * @param array $optionalArgs { - * Optional. - * - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @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 createWorkerPool($parent, $workerPool, $workerPoolId, array $optionalArgs = []) - { - $request = new CreateWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setWorkerPool($workerPool); - $request->setWorkerPoolId($workerPoolId); - $requestParamHeaders['location'] = $parent; - 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('CreateWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a `BuildTrigger` by its project ID and trigger ID. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $cloudBuildClient->deleteBuildTrigger($projectId, $triggerId); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. ID of the `BuildTrigger` to delete. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to delete. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @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. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new DeleteBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('DeleteBuildTrigger', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedName = $cloudBuildClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - * $operationResponse = $cloudBuildClient->deleteWorkerPool($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 = $cloudBuildClient->deleteWorkerPool($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'deleteWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `WorkerPool` to delete. - * Format: - * `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * Optional. If provided, it must match the server's etag on the workerpool - * for the request to be processed. - * @type bool $allowMissing - * If set to true, and the `WorkerPool` is not found, the request will succeed - * but no action will be taken on the server. - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @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 deleteWorkerPool($name, array $optionalArgs = []) - { - $request = new DeleteWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - 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('DeleteWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Returns information about a previously requested build. - * - * The `Build` that is returned includes its status (such as `SUCCESS`, - * `FAILURE`, or `WORKING`), and timing information. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $response = $cloudBuildClient->getBuild($projectId, $id); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. ID of the build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @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\Build\V1\Build - * - * @throws ApiException if the remote call fails - */ - public function getBuild($projectId, $id, array $optionalArgs = []) - { - $request = new GetBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBuild', Build::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns information about a `BuildTrigger`. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $response = $cloudBuildClient->getBuildTrigger($projectId, $triggerId); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @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\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function getBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new GetBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns details of a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedName = $cloudBuildClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - * $response = $cloudBuildClient->getWorkerPool($formattedName); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @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\Build\V1\WorkerPool - * - * @throws ApiException if the remote call fails - */ - public function getWorkerPool($name, array $optionalArgs = []) - { - $request = new GetWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['location'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetWorkerPool', WorkerPool::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists existing `BuildTrigger`s. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listBuildTriggers($projectId); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listBuildTriggers($projectId); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project for which to list BuildTriggers. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listBuildTriggers($projectId, array $optionalArgs = []) - { - $request = new ListBuildTriggersRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['parent']; - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBuildTriggers', $optionalArgs, ListBuildTriggersResponse::class, $request); - } - - /** - * Lists previously requested builds. - * - * Previously requested builds may still be in-progress, or may have finished - * successfully or unsuccessfully. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listBuilds($projectId); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listBuilds($projectId); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param array $optionalArgs { - * Optional. - * - * @type string $parent - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * @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 - * The raw filter text to constrain the results. - * @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 listBuilds($projectId, array $optionalArgs = []) - { - $request = new ListBuildsRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - if (isset($optionalArgs['parent'])) { - $request->setParent($optionalArgs['parent']); - $requestParamHeaders['location'] = $optionalArgs['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']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListBuilds', $optionalArgs, ListBuildsResponse::class, $request); - } - - /** - * Lists `WorkerPool`s. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $formattedParent = $cloudBuildClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $cloudBuildClient->listWorkerPools($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $cloudBuildClient->listWorkerPools($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * @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 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 listWorkerPools($parent, array $optionalArgs = []) - { - $request = new ListWorkerPoolsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['location'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListWorkerPools', $optionalArgs, ListWorkerPoolsResponse::class, $request); - } - - /** - * ReceiveTriggerWebhook [Experimental] is called when the API receives a - * webhook request targeted at a specific trigger. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $response = $cloudBuildClient->receiveTriggerWebhook(); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type HttpBody $body - * HTTP request body. - * @type string $projectId - * Project in which the specified trigger lives - * @type string $trigger - * Name of the trigger to run the payload against - * @type string $secret - * Secret token used for authorization if an OAuth token isn't provided. - * @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\Build\V1\ReceiveTriggerWebhookResponse - * - * @throws ApiException if the remote call fails - */ - public function receiveTriggerWebhook(array $optionalArgs = []) - { - $request = new ReceiveTriggerWebhookRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['name'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['body'])) { - $request->setBody($optionalArgs['body']); - } - - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['trigger'])) { - $request->setTrigger($optionalArgs['trigger']); - $requestParamHeaders['trigger'] = $optionalArgs['trigger']; - } - - if (isset($optionalArgs['secret'])) { - $request->setSecret($optionalArgs['secret']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReceiveTriggerWebhook', ReceiveTriggerWebhookResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Creates a new build based on the specified build. - * - * This method creates a new build using the original build request, which may - * or may not result in an identical build. - * - * For triggered builds: - * - * * Triggered builds resolve to a precise revision; therefore a retry of a - * triggered build will result in a build that uses the same revision. - * - * For non-triggered builds that specify `RepoSource`: - * - * * If the original build built from the tip of a branch, the retried build - * will build from the tip of that branch, which may not be the same revision - * as the original build. - * * If the original build specified a commit sha or revision ID, the retried - * build will use the identical source. - * - * For builds that specify `StorageSource`: - * - * * If the original build pulled source from Cloud Storage without - * specifying the generation of the object, the new build will use the current - * object, which may be different from the original build source. - * * If the original build pulled source from Cloud Storage and specified the - * generation of the object, the new build will attempt to use the same - * object, which may or may not be available depending on the bucket's - * lifecycle management settings. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $id = 'id'; - * $operationResponse = $cloudBuildClient->retryBuild($projectId, $id); - * $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 = $cloudBuildClient->retryBuild($projectId, $id); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'retryBuild'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $id Required. Build ID of the original build. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @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 retryBuild($projectId, $id, array $optionalArgs = []) - { - $request = new RetryBuildRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setId($id); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RetryBuild', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Runs a `BuildTrigger` at a particular source revision. - * - * To run a regional or global trigger, use the POST request - * that includes the location endpoint in the path (ex. - * v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The - * POST request that does not include the location endpoint in the path can - * only be used when running global triggers. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $operationResponse = $cloudBuildClient->runBuildTrigger($projectId, $triggerId); - * $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 = $cloudBuildClient->runBuildTrigger($projectId, $triggerId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'runBuildTrigger'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project. - * @param string $triggerId Required. ID of the trigger. - * @param array $optionalArgs { - * Optional. - * - * @type string $name - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type RepoSource $source - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * @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 runBuildTrigger($projectId, $triggerId, array $optionalArgs = []) - { - $request = new RunBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - if (isset($optionalArgs['name'])) { - $request->setName($optionalArgs['name']); - $requestParamHeaders['location'] = $optionalArgs['name']; - } - - if (isset($optionalArgs['source'])) { - $request->setSource($optionalArgs['source']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('RunBuildTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Updates a `BuildTrigger` by its project ID and trigger ID. - * - * This API is experimental. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $projectId = 'project_id'; - * $triggerId = 'trigger_id'; - * $trigger = new BuildTrigger(); - * $response = $cloudBuildClient->updateBuildTrigger($projectId, $triggerId, $trigger); - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param string $projectId Required. ID of the project that owns the trigger. - * @param string $triggerId Required. ID of the `BuildTrigger` to update. - * @param BuildTrigger $trigger Required. `BuildTrigger` to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * @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\Build\V1\BuildTrigger - * - * @throws ApiException if the remote call fails - */ - public function updateBuildTrigger($projectId, $triggerId, $trigger, array $optionalArgs = []) - { - $request = new UpdateBuildTriggerRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTriggerId($triggerId); - $request->setTrigger($trigger); - $requestParamHeaders['location'] = $trigger->getResourceName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateBuildTrigger', BuildTrigger::class, $optionalArgs, $request)->wait(); - } - - /** - * Updates a `WorkerPool`. - * - * Sample code: - * ``` - * $cloudBuildClient = new CloudBuildClient(); - * try { - * $workerPool = new WorkerPool(); - * $operationResponse = $cloudBuildClient->updateWorkerPool($workerPool); - * $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 = $cloudBuildClient->updateWorkerPool($workerPool); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $cloudBuildClient->resumeOperation($operationName, 'updateWorkerPool'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $cloudBuildClient->close(); - * } - * ``` - * - * @param WorkerPool $workerPool Required. The `WorkerPool` to update. - * - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * A mask specifying which fields in `worker_pool` to update. - * @type bool $validateOnly - * If set, validate the request and preview the response, but do not actually - * post it. - * @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 updateWorkerPool($workerPool, array $optionalArgs = []) - { - $request = new UpdateWorkerPoolRequest(); - $requestParamHeaders = []; - $request->setWorkerPool($workerPool); - $requestParamHeaders['location'] = $workerPool->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - 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('UpdateWorkerPool', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/Build/src/V1/GetBuildRequest.php b/Build/src/V1/GetBuildRequest.php deleted file mode 100644 index 40a1220b31dc..000000000000 --- a/Build/src/V1/GetBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.GetBuildRequest - */ -class GetBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. ID of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to retrieve. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 4 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. ID of the build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GetBuildTriggerRequest.php b/Build/src/V1/GetBuildTriggerRequest.php deleted file mode 100644 index 6074f3599fe7..000000000000 --- a/Build/src/V1/GetBuildTriggerRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.GetBuildTriggerRequest - */ -class GetBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 3 [(.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 project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. Identifier (`id` or `name`) of the `BuildTrigger` to get. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GetWorkerPoolRequest.php b/Build/src/V1/GetWorkerPoolRequest.php deleted file mode 100644 index 73a874b21db7..000000000000 --- a/Build/src/V1/GetWorkerPoolRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -google.devtools.cloudbuild.v1.GetWorkerPoolRequest - */ -class GetWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * 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 `WorkerPool` to retrieve. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * 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/Build/src/V1/GitFileSource.php b/Build/src/V1/GitFileSource.php deleted file mode 100644 index c4d7280413df..000000000000 --- a/Build/src/V1/GitFileSource.php +++ /dev/null @@ -1,303 +0,0 @@ -google.devtools.cloudbuild.v1.GitFileSource - */ -class GitFileSource extends \Google\Protobuf\Internal\Message -{ - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - */ - private $path = ''; - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - */ - private $uri = ''; - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - */ - private $repo_type = 0; - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - */ - private $revision = ''; - protected $source; - protected $enterprise_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $path - * The path of the file, with the repo root as the root of the path. - * @type string $uri - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * @type string $repository - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * @type int $repo_type - * See RepoType above. - * @type string $revision - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * @type string $github_enterprise_config - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * The path of the file, with the repo root as the root of the path. - * - * Generated from protobuf field string path = 1; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URI of the repo. - * Either uri or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string uri = 2; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string repository = 7 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->readOneof(7); - } - - public function hasRepository() - { - return $this->hasOneof(7); - } - - /** - * The fully qualified resource name of the Repos API repository. - * Either URI or repository can be specified. - * If unspecified, the repo from which the trigger invocation originated is - * assumed to be the repo from which to read the specified path. - * - * Generated from protobuf field string repository = 7 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @return int - */ - public function getRepoType() - { - return $this->repo_type; - } - - /** - * See RepoType above. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @param int $var - * @return $this - */ - public function setRepoType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\GitFileSource\RepoType::class); - $this->repo_type = $var; - - return $this; - } - - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * The branch, tag, arbitrary ref, or SHA version of the repo to use when - * resolving the filename (optional). - * This field respects the same syntax/resolution as described here: - * https://git-scm.com/docs/gitrevisions - * If unspecified, the revision from which the trigger invocation originated - * is assumed to be the revision from which to read the specified path. - * - * Generated from protobuf field string revision = 4; - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 5 [(.google.api.resource_reference) = { - * @return string - */ - public function getGithubEnterpriseConfig() - { - return $this->readOneof(5); - } - - public function hasGithubEnterpriseConfig() - { - return $this->hasOneof(5); - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 5 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setGithubEnterpriseConfig($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getEnterpriseConfig() - { - return $this->whichOneof("enterprise_config"); - } - -} - diff --git a/Build/src/V1/GitFileSource/RepoType.php b/Build/src/V1/GitFileSource/RepoType.php deleted file mode 100644 index 9c286c49cb38..000000000000 --- a/Build/src/V1/GitFileSource/RepoType.php +++ /dev/null @@ -1,79 +0,0 @@ -google.devtools.cloudbuild.v1.GitFileSource.RepoType - */ -class RepoType -{ - /** - * The default, unknown repo type. Don't use it, instead use one of - * the other repo types. - * - * Generated from protobuf enum UNKNOWN = 0; - */ - const UNKNOWN = 0; - /** - * A Google Cloud Source Repositories-hosted repo. - * - * Generated from protobuf enum CLOUD_SOURCE_REPOSITORIES = 1; - */ - const CLOUD_SOURCE_REPOSITORIES = 1; - /** - * A GitHub-hosted repo not necessarily on "github.com" (i.e. GitHub - * Enterprise). - * - * Generated from protobuf enum GITHUB = 2; - */ - const GITHUB = 2; - /** - * A Bitbucket Server-hosted repo. - * - * Generated from protobuf enum BITBUCKET_SERVER = 3; - */ - const BITBUCKET_SERVER = 3; - /** - * A GitLab-hosted repo. - * - * Generated from protobuf enum GITLAB = 4; - */ - const GITLAB = 4; - - private static $valueToName = [ - self::UNKNOWN => 'UNKNOWN', - self::CLOUD_SOURCE_REPOSITORIES => 'CLOUD_SOURCE_REPOSITORIES', - self::GITHUB => 'GITHUB', - self::BITBUCKET_SERVER => 'BITBUCKET_SERVER', - self::GITLAB => 'GITLAB', - ]; - - 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/Build/src/V1/GitHubEnterpriseConfig.php b/Build/src/V1/GitHubEnterpriseConfig.php deleted file mode 100644 index 6c9eda79123c..000000000000 --- a/Build/src/V1/GitHubEnterpriseConfig.php +++ /dev/null @@ -1,409 +0,0 @@ -google.devtools.cloudbuild.v1.GitHubEnterpriseConfig - */ -class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $name = ''; - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - */ - private $host_url = ''; - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - private $app_id = 0; - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - */ - private $webhook_key = ''; - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - private $peered_network = ''; - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - */ - private $secrets = null; - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - */ - private $display_name = ''; - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $ssl_ca = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * @type string $host_url - * The URL of the github enterprise host the configuration is for. - * @type int|string $app_id - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time when the installation was associated with the project. - * @type string $webhook_key - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * @type string $peered_network - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * @type \Google\Cloud\Build\V1\GitHubEnterpriseSecrets $secrets - * Names of secrets in Secret Manager. - * @type string $display_name - * Name to display for this config. - * @type string $ssl_ca - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Optional. The full resource name for the GitHubEnterpriseConfig - * For example: - * "projects/{$project_id}/locations/{$location_id}/githubEnterpriseConfigs/{$config_id}" - * - * Generated from protobuf field string name = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - * @return string - */ - public function getHostUrl() - { - return $this->host_url; - } - - /** - * The URL of the github enterprise host the configuration is for. - * - * Generated from protobuf field string host_url = 3; - * @param string $var - * @return $this - */ - public function setHostUrl($var) - { - GPBUtil::checkString($var, True); - $this->host_url = $var; - - return $this; - } - - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return int|string - */ - public function getAppId() - { - return $this->app_id; - } - - /** - * Required. The GitHub app id of the Cloud Build app on the GitHub Enterprise - * server. - * - * Generated from protobuf field int64 app_id = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param int|string $var - * @return $this - */ - public function setAppId($var) - { - GPBUtil::checkInt64($var); - $this->app_id = $var; - - return $this; - } - - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. Time when the installation was associated with the project. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - * @return string - */ - public function getWebhookKey() - { - return $this->webhook_key; - } - - /** - * The key that should be attached to webhook calls to the ReceiveWebhook - * endpoint. - * - * Generated from protobuf field string webhook_key = 8; - * @param string $var - * @return $this - */ - public function setWebhookKey($var) - { - GPBUtil::checkString($var, True); - $this->webhook_key = $var; - - return $this; - } - - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getPeeredNetwork() - { - return $this->peered_network; - } - - /** - * Optional. The network to be used when reaching out to the GitHub - * Enterprise server. The VPC network must be enabled for private - * service connection. This should be set if the GitHub Enterprise server is - * hosted on-premises and not reachable by public internet. - * If this field is left empty, no network peering will occur and calls to - * the GitHub Enterprise server will be made over the public internet. - * Must be in the format - * `projects/{project}/global/networks/{network}`, where {project} - * is a project number or id and {network} is the name of a - * VPC network in the project. - * - * Generated from protobuf field string peered_network = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPeeredNetwork($var) - { - GPBUtil::checkString($var, True); - $this->peered_network = $var; - - return $this; - } - - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - * @return \Google\Cloud\Build\V1\GitHubEnterpriseSecrets|null - */ - public function getSecrets() - { - return $this->secrets; - } - - public function hasSecrets() - { - return isset($this->secrets); - } - - public function clearSecrets() - { - unset($this->secrets); - } - - /** - * Names of secrets in Secret Manager. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets secrets = 10; - * @param \Google\Cloud\Build\V1\GitHubEnterpriseSecrets $var - * @return $this - */ - public function setSecrets($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitHubEnterpriseSecrets::class); - $this->secrets = $var; - - return $this; - } - - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * Name to display for this config. - * - * Generated from protobuf field string display_name = 11; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getSslCa() - { - return $this->ssl_ca; - } - - /** - * Optional. SSL certificate to use for requests to GitHub Enterprise. - * - * Generated from protobuf field string ssl_ca = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setSslCa($var) - { - GPBUtil::checkString($var, True); - $this->ssl_ca = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GitHubEnterpriseSecrets.php b/Build/src/V1/GitHubEnterpriseSecrets.php deleted file mode 100644 index 125f001df97f..000000000000 --- a/Build/src/V1/GitHubEnterpriseSecrets.php +++ /dev/null @@ -1,171 +0,0 @@ -/secrets/. - * - * Generated from protobuf message google.devtools.cloudbuild.v1.GitHubEnterpriseSecrets - */ -class GitHubEnterpriseSecrets extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - */ - private $private_key_version_name = ''; - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - */ - private $webhook_secret_version_name = ''; - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - */ - private $oauth_secret_version_name = ''; - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - */ - private $oauth_client_id_version_name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $private_key_version_name - * The resource name for the private key secret version. - * @type string $webhook_secret_version_name - * The resource name for the webhook secret secret version in Secret Manager. - * @type string $oauth_secret_version_name - * The resource name for the OAuth secret secret version in Secret Manager. - * @type string $oauth_client_id_version_name - * The resource name for the OAuth client ID secret version in Secret Manager. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - * @return string - */ - public function getPrivateKeyVersionName() - { - return $this->private_key_version_name; - } - - /** - * The resource name for the private key secret version. - * - * Generated from protobuf field string private_key_version_name = 5 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPrivateKeyVersionName($var) - { - GPBUtil::checkString($var, True); - $this->private_key_version_name = $var; - - return $this; - } - - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - * @return string - */ - public function getWebhookSecretVersionName() - { - return $this->webhook_secret_version_name; - } - - /** - * The resource name for the webhook secret secret version in Secret Manager. - * - * Generated from protobuf field string webhook_secret_version_name = 6 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWebhookSecretVersionName($var) - { - GPBUtil::checkString($var, True); - $this->webhook_secret_version_name = $var; - - return $this; - } - - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - * @return string - */ - public function getOauthSecretVersionName() - { - return $this->oauth_secret_version_name; - } - - /** - * The resource name for the OAuth secret secret version in Secret Manager. - * - * Generated from protobuf field string oauth_secret_version_name = 7 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setOauthSecretVersionName($var) - { - GPBUtil::checkString($var, True); - $this->oauth_secret_version_name = $var; - - return $this; - } - - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - * @return string - */ - public function getOauthClientIdVersionName() - { - return $this->oauth_client_id_version_name; - } - - /** - * The resource name for the OAuth client ID secret version in Secret Manager. - * - * Generated from protobuf field string oauth_client_id_version_name = 8 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setOauthClientIdVersionName($var) - { - GPBUtil::checkString($var, True); - $this->oauth_client_id_version_name = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/GitHubEventsConfig.php b/Build/src/V1/GitHubEventsConfig.php deleted file mode 100644 index 3400ef253089..000000000000 --- a/Build/src/V1/GitHubEventsConfig.php +++ /dev/null @@ -1,228 +0,0 @@ -google.devtools.cloudbuild.v1.GitHubEventsConfig - */ -class GitHubEventsConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @deprecated - */ - protected $installation_id = 0; - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - */ - private $owner = ''; - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - */ - private $name = ''; - protected $event; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $installation_id - * The installationID that emits the GitHub event. - * @type string $owner - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * @type string $name - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * @type \Google\Cloud\Build\V1\PullRequestFilter $pull_request - * filter to match changes in pull requests. - * @type \Google\Cloud\Build\V1\PushFilter $push - * filter to match changes in refs like branches, tags. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @return int|string - * @deprecated - */ - public function getInstallationId() - { - @trigger_error('installation_id is deprecated.', E_USER_DEPRECATED); - return $this->installation_id; - } - - /** - * The installationID that emits the GitHub event. - * - * Generated from protobuf field int64 installation_id = 1 [deprecated = true]; - * @param int|string $var - * @return $this - * @deprecated - */ - public function setInstallationId($var) - { - @trigger_error('installation_id is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkInt64($var); - $this->installation_id = $var; - - return $this; - } - - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - * @return string - */ - public function getOwner() - { - return $this->owner; - } - - /** - * Owner of the repository. For example: The owner for - * https://github.com/googlecloudplatform/cloud-builders is - * "googlecloudplatform". - * - * Generated from protobuf field string owner = 6; - * @param string $var - * @return $this - */ - public function setOwner($var) - { - GPBUtil::checkString($var, True); - $this->owner = $var; - - return $this; - } - - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the repository. For example: The name for - * https://github.com/googlecloudplatform/cloud-builders is "cloud-builders". - * - * Generated from protobuf field string name = 7; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 4; - * @return \Google\Cloud\Build\V1\PullRequestFilter|null - */ - public function getPullRequest() - { - return $this->readOneof(4); - } - - public function hasPullRequest() - { - return $this->hasOneof(4); - } - - /** - * filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 4; - * @param \Google\Cloud\Build\V1\PullRequestFilter $var - * @return $this - */ - public function setPullRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PullRequestFilter::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 5; - * @return \Google\Cloud\Build\V1\PushFilter|null - */ - public function getPush() - { - return $this->readOneof(5); - } - - public function hasPush() - { - return $this->hasOneof(5); - } - - /** - * filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 5; - * @param \Google\Cloud\Build\V1\PushFilter $var - * @return $this - */ - public function setPush($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PushFilter::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * @return string - */ - public function getEvent() - { - return $this->whichOneof("event"); - } - -} - diff --git a/Build/src/V1/GitRepoSource.php b/Build/src/V1/GitRepoSource.php deleted file mode 100644 index 265223891fbe..000000000000 --- a/Build/src/V1/GitRepoSource.php +++ /dev/null @@ -1,238 +0,0 @@ -google.devtools.cloudbuild.v1.GitRepoSource - */ -class GitRepoSource extends \Google\Protobuf\Internal\Message -{ - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - */ - private $ref = ''; - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - */ - private $repo_type = 0; - protected $source; - protected $enterprise_config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * @type string $repository - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * @type string $ref - * The branch or tag to use. Must start with "refs/" (required). - * @type int $repo_type - * See RepoType below. - * @type string $github_enterprise_config - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * The URI of the repo (e.g. https://github.com/user/repo.git). - * Either `uri` or `repository` can be specified and is required. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * - * Generated from protobuf field string repository = 6 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->readOneof(6); - } - - public function hasRepository() - { - return $this->hasOneof(6); - } - - /** - * The connected repository resource name, in the format - * `projects/*/locations/*/connections/*/repositories/*`. Either `uri` or - * `repository` can be specified and is required. - * - * Generated from protobuf field string repository = 6 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - * @return string - */ - public function getRef() - { - return $this->ref; - } - - /** - * The branch or tag to use. Must start with "refs/" (required). - * - * Generated from protobuf field string ref = 2; - * @param string $var - * @return $this - */ - public function setRef($var) - { - GPBUtil::checkString($var, True); - $this->ref = $var; - - return $this; - } - - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @return int - */ - public function getRepoType() - { - return $this->repo_type; - } - - /** - * See RepoType below. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitFileSource.RepoType repo_type = 3; - * @param int $var - * @return $this - */ - public function setRepoType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\GitFileSource\RepoType::class); - $this->repo_type = $var; - - return $this; - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getGithubEnterpriseConfig() - { - return $this->readOneof(4); - } - - public function hasGithubEnterpriseConfig() - { - return $this->hasOneof(4); - } - - /** - * The full resource name of the github enterprise config. - * Format: - * `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`. - * `projects/{project}/githubEnterpriseConfigs/{id}`. - * - * Generated from protobuf field string github_enterprise_config = 4 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setGithubEnterpriseConfig($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - - /** - * @return string - */ - public function getEnterpriseConfig() - { - return $this->whichOneof("enterprise_config"); - } - -} - diff --git a/Build/src/V1/GitSource.php b/Build/src/V1/GitSource.php deleted file mode 100644 index a61c0c27a654..000000000000 --- a/Build/src/V1/GitSource.php +++ /dev/null @@ -1,179 +0,0 @@ -google.devtools.cloudbuild.v1.GitSource - */ -class GitSource extends \Google\Protobuf\Internal\Message -{ - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - */ - private $url = ''; - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - */ - private $dir = ''; - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - */ - private $revision = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $url - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * @type string $dir - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * @type string $revision - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Location of the Git repo to build. - * This will be used as a `git remote`, see - * https://git-scm.com/docs/git-remote. - * - * Generated from protobuf field string url = 1; - * @param string $var - * @return $this - */ - public function setUrl($var) - { - GPBUtil::checkString($var, True); - $this->url = $var; - - return $this; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 5; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - * @return string - */ - public function getRevision() - { - return $this->revision; - } - - /** - * The revision to fetch from the Git repository such as a branch, a tag, a - * commit SHA, or any Git ref. - * Cloud Build uses `git fetch` to fetch the revision from the Git - * repository; therefore make sure that the string you provide for `revision` - * is parsable by the command. For information on string values accepted by - * `git fetch`, see - * https://git-scm.com/docs/gitrevisions#_specifying_revisions. For - * information on `git fetch`, see https://git-scm.com/docs/git-fetch. - * - * Generated from protobuf field string revision = 6; - * @param string $var - * @return $this - */ - public function setRevision($var) - { - GPBUtil::checkString($var, True); - $this->revision = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Hash.php b/Build/src/V1/Hash.php deleted file mode 100644 index 90acb2067683..000000000000 --- a/Build/src/V1/Hash.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.cloudbuild.v1.Hash - */ -class Hash extends \Google\Protobuf\Internal\Message -{ - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - */ - private $type = 0; - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - */ - private $value = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $type - * The type of hash that was performed. - * @type string $value - * The hash value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * The type of hash that was performed. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.Hash.HashType type = 1; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\Hash\HashType::class); - $this->type = $var; - - return $this; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * The hash value. - * - * Generated from protobuf field bytes value = 2; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, False); - $this->value = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Hash/HashType.php b/Build/src/V1/Hash/HashType.php deleted file mode 100644 index dc9e57cde497..000000000000 --- a/Build/src/V1/Hash/HashType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.Hash.HashType - */ -class HashType -{ - /** - * No hash requested. - * - * Generated from protobuf enum NONE = 0; - */ - const NONE = 0; - /** - * Use a sha256 hash. - * - * Generated from protobuf enum SHA256 = 1; - */ - const SHA256 = 1; - /** - * Use a md5 hash. - * - * Generated from protobuf enum MD5 = 2; - */ - const MD5 = 2; - /** - * Use a sha512 hash. - * - * Generated from protobuf enum SHA512 = 4; - */ - const SHA512 = 4; - - private static $valueToName = [ - self::NONE => 'NONE', - self::SHA256 => 'SHA256', - self::MD5 => 'MD5', - self::SHA512 => 'SHA512', - ]; - - 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/Build/src/V1/InlineSecret.php b/Build/src/V1/InlineSecret.php deleted file mode 100644 index a53734ea10b1..000000000000 --- a/Build/src/V1/InlineSecret.php +++ /dev/null @@ -1,122 +0,0 @@ -google.devtools.cloudbuild.v1.InlineSecret - */ -class InlineSecret extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - */ - private $kms_key_name = ''; - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - */ - private $env_map; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * @type array|\Google\Protobuf\Internal\MapField $env_map - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Resource name of Cloud KMS crypto key to decrypt the encrypted value. - * In format: projects/*/locations/*/keyRings/*/cryptoKeys/* - * - * Generated from protobuf field string kms_key_name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getEnvMap() - { - return $this->env_map; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map env_map = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setEnvMap($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES); - $this->env_map = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildTriggersRequest.php b/Build/src/V1/ListBuildTriggersRequest.php deleted file mode 100644 index 94d313309171..000000000000 --- a/Build/src/V1/ListBuildTriggersRequest.php +++ /dev/null @@ -1,173 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildTriggersRequest - */ -class ListBuildTriggersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project for which to list BuildTriggers. - * @type int $page_size - * Number of results to return in the list. - * @type string $page_token - * Token to provide to skip to a particular spot in the list. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent of the collection of `Triggers`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 4 [(.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 project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project for which to list BuildTriggers. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Number of results to return in the list. - * - * 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; - } - - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * Token to provide to skip to a particular spot in the list. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildTriggersResponse.php b/Build/src/V1/ListBuildTriggersResponse.php deleted file mode 100644 index 50cb24a199a4..000000000000 --- a/Build/src/V1/ListBuildTriggersResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildTriggersResponse - */ -class ListBuildTriggersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - */ - private $triggers; - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\BuildTrigger>|\Google\Protobuf\Internal\RepeatedField $triggers - * `BuildTriggers` for the project, sorted by `create_time` descending. - * @type string $next_page_token - * Token to receive the next page of results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTriggers() - { - return $this->triggers; - } - - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuildTrigger triggers = 1; - * @param array<\Google\Cloud\Build\V1\BuildTrigger>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTriggers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->triggers = $arr; - - return $this; - } - - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to receive the next page of results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildsRequest.php b/Build/src/V1/ListBuildsRequest.php deleted file mode 100644 index 42f7e195bc96..000000000000 --- a/Build/src/V1/ListBuildsRequest.php +++ /dev/null @@ -1,227 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildsRequest - */ -class ListBuildsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - */ - private $filter = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * @type string $project_id - * Required. ID of the project. - * @type int $page_size - * Number of results to return in the list. - * @type string $page_token - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * @type string $filter - * The raw filter text to constrain the results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * The parent of the collection of `Builds`. - * Format: `projects/{project}/locations/{location}` - * - * Generated from protobuf field string parent = 9 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Number of results to return in the list. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Number of results to return in the list. - * - * 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; - } - - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token for the next page of Builds. - * If unspecified, the first page of results is returned. - * If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. - * In this case, the token should be discarded, and pagination should be - * restarted from the first page of results. - * See https://google.aip.dev/158 for more. - * - * 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; - } - - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * The raw filter text to constrain the results. - * - * Generated from protobuf field string filter = 8; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListBuildsResponse.php b/Build/src/V1/ListBuildsResponse.php deleted file mode 100644 index 7a1a3b92d9a1..000000000000 --- a/Build/src/V1/ListBuildsResponse.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.cloudbuild.v1.ListBuildsResponse - */ -class ListBuildsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - */ - private $builds; - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $builds - * Builds will be sorted by `create_time`, descending. - * @type string $next_page_token - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuilds() - { - return $this->builds; - } - - /** - * Builds will be sorted by `create_time`, descending. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.Build builds = 1; - * @param array<\Google\Cloud\Build\V1\Build>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuilds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\Build::class); - $this->builds = $arr; - - return $this; - } - - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Token to receive the next page of results. - * This will be absent if the end of the response list has been reached. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListWorkerPoolsRequest.php b/Build/src/V1/ListWorkerPoolsRequest.php deleted file mode 100644 index 0cedc7751e7d..000000000000 --- a/Build/src/V1/ListWorkerPoolsRequest.php +++ /dev/null @@ -1,147 +0,0 @@ -google.devtools.cloudbuild.v1.ListWorkerPoolsRequest - */ -class ListWorkerPoolsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $parent = ''; - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * Generated from protobuf field int32 page_size = 2; - */ - private $page_size = 0; - /** - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - */ - private $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * @type int $page_size - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * @type string $page_token - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent of the collection of `WorkerPools`. - * Format: `projects/{project}/locations/{location}`. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of `WorkerPool`s to return. The service may return - * fewer than this value. If omitted, the server will use a sensible default. - * - * 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 `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * A page token, received from a previous `ListWorkerPools` call. Provide this - * to retrieve the subsequent page. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ListWorkerPoolsResponse.php b/Build/src/V1/ListWorkerPoolsResponse.php deleted file mode 100644 index 3cfe5574005e..000000000000 --- a/Build/src/V1/ListWorkerPoolsResponse.php +++ /dev/null @@ -1,109 +0,0 @@ -google.devtools.cloudbuild.v1.ListWorkerPoolsResponse - */ -class ListWorkerPoolsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - */ - private $worker_pools; - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - */ - private $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\WorkerPool>|\Google\Protobuf\Internal\RepeatedField $worker_pools - * `WorkerPools` for the specified project. - * @type string $next_page_token - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getWorkerPools() - { - return $this->worker_pools; - } - - /** - * `WorkerPools` for the specified project. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.WorkerPool worker_pools = 1; - * @param array<\Google\Cloud\Build\V1\WorkerPool>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setWorkerPools($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pools = $arr; - - return $this; - } - - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Continuation token used to page through large result sets. Provide this - * value in a subsequent ListWorkerPoolsRequest to return the next page of - * results. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PrivatePoolV1Config.php b/Build/src/V1/PrivatePoolV1Config.php deleted file mode 100644 index 28516dd12e2b..000000000000 --- a/Build/src/V1/PrivatePoolV1Config.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config - */ -class PrivatePoolV1Config extends \Google\Protobuf\Internal\Message -{ - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - */ - private $worker_config = null; - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - */ - private $network_config = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig $worker_config - * Machine configuration for the workers in the pool. - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig $network_config - * Network configuration for the pool. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig|null - */ - public function getWorkerConfig() - { - return $this->worker_config; - } - - public function hasWorkerConfig() - { - return isset($this->worker_config); - } - - public function clearWorkerConfig() - { - unset($this->worker_config); - } - - /** - * Machine configuration for the workers in the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig worker_config = 1; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig $var - * @return $this - */ - public function setWorkerConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\WorkerConfig::class); - $this->worker_config = $var; - - return $this; - } - - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig|null - */ - public function getNetworkConfig() - { - return $this->network_config; - } - - public function hasNetworkConfig() - { - return isset($this->network_config); - } - - public function clearNetworkConfig() - { - unset($this->network_config); - } - - /** - * Network configuration for the pool. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig network_config = 2; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig $var - * @return $this - */ - public function setNetworkConfig($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig::class); - $this->network_config = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php b/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php deleted file mode 100644 index bbead095f95e..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/NetworkConfig.php +++ /dev/null @@ -1,192 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig - */ -class NetworkConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - private $peered_network = ''; - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - */ - private $egress_option = 0; - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - */ - private $peered_network_ip_range = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $peered_network - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * @type int $egress_option - * Option to configure network egress for the workers. - * @type string $peered_network_ip_range - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getPeeredNetwork() - { - return $this->peered_network; - } - - /** - * Required. Immutable. The network definition that the workers are peered - * to. If this section is left empty, the workers will be peered to - * `WorkerPool.project_id` on the service producer network. Must be in the - * format `projects/{project}/global/networks/{network}`, where `{project}` - * is a project number, such as `12345`, and `{network}` is the name of a - * VPC network in the project. See - * [Understanding network configuration - * options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) - * - * Generated from protobuf field string peered_network = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setPeeredNetwork($var) - { - GPBUtil::checkString($var, True); - $this->peered_network = $var; - - return $this; - } - - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - * @return int - */ - public function getEgressOption() - { - return $this->egress_option; - } - - /** - * Option to configure network egress for the workers. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption egress_option = 2; - * @param int $var - * @return $this - */ - public function setEgressOption($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PrivatePoolV1Config\NetworkConfig\EgressOption::class); - $this->egress_option = $var; - - return $this; - } - - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @return string - */ - public function getPeeredNetworkIpRange() - { - return $this->peered_network_ip_range; - } - - /** - * Immutable. Subnet IP range within the peered network. This is specified - * in CIDR notation with a slash and the subnet prefix size. You can - * optionally specify an IP address before the subnet prefix value. e.g. - * `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a - * prefix size of 29 bits. - * `/16` would specify a prefix size of 16 bits, with an automatically - * determined IP within the peered VPC. - * If unspecified, a value of `/24` will be used. - * - * Generated from protobuf field string peered_network_ip_range = 3 [(.google.api.field_behavior) = IMMUTABLE]; - * @param string $var - * @return $this - */ - public function setPeeredNetworkIpRange($var) - { - GPBUtil::checkString($var, True); - $this->peered_network_ip_range = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php b/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php deleted file mode 100644 index 9a572817a0ff..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/NetworkConfig/EgressOption.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption - */ -class EgressOption -{ - /** - * If set, defaults to PUBLIC_EGRESS. - * - * Generated from protobuf enum EGRESS_OPTION_UNSPECIFIED = 0; - */ - const EGRESS_OPTION_UNSPECIFIED = 0; - /** - * If set, workers are created without any public address, which prevents - * network egress to public IPs unless a network proxy is configured. - * - * Generated from protobuf enum NO_PUBLIC_EGRESS = 1; - */ - const NO_PUBLIC_EGRESS = 1; - /** - * If set, workers are created with a public address which allows for - * public internet egress. - * - * Generated from protobuf enum PUBLIC_EGRESS = 2; - */ - const PUBLIC_EGRESS = 2; - - private static $valueToName = [ - self::EGRESS_OPTION_UNSPECIFIED => 'EGRESS_OPTION_UNSPECIFIED', - self::NO_PUBLIC_EGRESS => 'NO_PUBLIC_EGRESS', - self::PUBLIC_EGRESS => 'PUBLIC_EGRESS', - ]; - - 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/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php b/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php deleted file mode 100644 index e85f29d427bb..000000000000 --- a/Build/src/V1/PrivatePoolV1Config/WorkerConfig.php +++ /dev/null @@ -1,131 +0,0 @@ -google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig - */ -class WorkerConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - */ - private $machine_type = ''; - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - */ - private $disk_size_gb = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $machine_type - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * @type int|string $disk_size_gb - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - * @return string - */ - public function getMachineType() - { - return $this->machine_type; - } - - /** - * Machine type of a worker, such as `e2-medium`. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * If left blank, Cloud Build will use a sensible default. - * - * Generated from protobuf field string machine_type = 1; - * @param string $var - * @return $this - */ - public function setMachineType($var) - { - GPBUtil::checkString($var, True); - $this->machine_type = $var; - - return $this; - } - - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - * @return int|string - */ - public function getDiskSizeGb() - { - return $this->disk_size_gb; - } - - /** - * Size of the disk attached to the worker, in GB. - * See [Worker pool config - * file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). - * Specify a value of up to 2000. If `0` is specified, Cloud Build will use - * a standard disk size. - * - * Generated from protobuf field int64 disk_size_gb = 2; - * @param int|string $var - * @return $this - */ - public function setDiskSizeGb($var) - { - GPBUtil::checkInt64($var); - $this->disk_size_gb = $var; - - return $this; - } - -} - - diff --git a/Build/src/V1/PubsubConfig.php b/Build/src/V1/PubsubConfig.php deleted file mode 100644 index 171f27eade61..000000000000 --- a/Build/src/V1/PubsubConfig.php +++ /dev/null @@ -1,182 +0,0 @@ -google.devtools.cloudbuild.v1.PubsubConfig - */ -class PubsubConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - */ - private $subscription = ''; - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - */ - private $topic = ''; - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - */ - private $service_account_email = ''; - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - */ - private $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $subscription - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * @type string $topic - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * @type string $service_account_email - * Service account that will make the push request. - * @type int $state - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Output only. Name of the subscription. Format is - * `projects/{project}/subscriptions/{subscription}`. - * - * Generated from protobuf field string subscription = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. - * - * Generated from protobuf field string topic = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccountEmail() - { - return $this->service_account_email; - } - - /** - * Service account that will make the push request. - * - * Generated from protobuf field string service_account_email = 3 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccountEmail($var) - { - GPBUtil::checkString($var, True); - $this->service_account_email = $var; - - return $this; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PubsubConfig.State state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PubsubConfig\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/PubsubConfig/State.php b/Build/src/V1/PubsubConfig/State.php deleted file mode 100644 index e77aa0f2ed2a..000000000000 --- a/Build/src/V1/PubsubConfig/State.php +++ /dev/null @@ -1,77 +0,0 @@ -google.devtools.cloudbuild.v1.PubsubConfig.State - */ -class State -{ - /** - * The subscription configuration has not been checked. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The Pub/Sub subscription is properly configured. - * - * Generated from protobuf enum OK = 1; - */ - const OK = 1; - /** - * The subscription has been deleted. - * - * Generated from protobuf enum SUBSCRIPTION_DELETED = 2; - */ - const SUBSCRIPTION_DELETED = 2; - /** - * The topic has been deleted. - * - * Generated from protobuf enum TOPIC_DELETED = 3; - */ - const TOPIC_DELETED = 3; - /** - * Some of the subscription's field are misconfigured. - * - * Generated from protobuf enum SUBSCRIPTION_MISCONFIGURED = 4; - */ - const SUBSCRIPTION_MISCONFIGURED = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::OK => 'OK', - self::SUBSCRIPTION_DELETED => 'SUBSCRIPTION_DELETED', - self::TOPIC_DELETED => 'TOPIC_DELETED', - self::SUBSCRIPTION_MISCONFIGURED => 'SUBSCRIPTION_MISCONFIGURED', - ]; - - 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/Build/src/V1/PullRequestFilter.php b/Build/src/V1/PullRequestFilter.php deleted file mode 100644 index 3322956db206..000000000000 --- a/Build/src/V1/PullRequestFilter.php +++ /dev/null @@ -1,154 +0,0 @@ -google.devtools.cloudbuild.v1.PullRequestFilter - */ -class PullRequestFilter extends \Google\Protobuf\Internal\Message -{ - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - */ - private $comment_control = 0; - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - */ - private $invert_regex = false; - protected $git_ref; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $branch - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type int $comment_control - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * @type bool $invert_regex - * If true, branches that do NOT match the git_ref will trigger a build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @return string - */ - public function getBranch() - { - return $this->readOneof(2); - } - - public function hasBranch() - { - return $this->hasOneof(2); - } - - /** - * Regex of branches to match. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - * @return int - */ - public function getCommentControl() - { - return $this->comment_control; - } - - /** - * Configure builds to run whether a repository owner or collaborator need to - * comment `/gcbrun`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl comment_control = 5; - * @param int $var - * @return $this - */ - public function setCommentControl($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\PullRequestFilter\CommentControl::class); - $this->comment_control = $var; - - return $this; - } - - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * If true, branches that do NOT match the git_ref will trigger a build. - * - * Generated from protobuf field bool invert_regex = 6; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * @return string - */ - public function getGitRef() - { - return $this->whichOneof("git_ref"); - } - -} - diff --git a/Build/src/V1/PullRequestFilter/CommentControl.php b/Build/src/V1/PullRequestFilter/CommentControl.php deleted file mode 100644 index 792c6e160508..000000000000 --- a/Build/src/V1/PullRequestFilter/CommentControl.php +++ /dev/null @@ -1,64 +0,0 @@ -google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl - */ -class CommentControl -{ - /** - * Do not require comments on Pull Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_DISABLED = 0; - */ - const COMMENTS_DISABLED = 0; - /** - * Enforce that repository owners or collaborators must comment on Pull - * Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_ENABLED = 1; - */ - const COMMENTS_ENABLED = 1; - /** - * Enforce that repository owners or collaborators must comment on external - * contributors' Pull Requests before builds are triggered. - * - * Generated from protobuf enum COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; - */ - const COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2; - - private static $valueToName = [ - self::COMMENTS_DISABLED => 'COMMENTS_DISABLED', - self::COMMENTS_ENABLED => 'COMMENTS_ENABLED', - self::COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY => 'COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/PushFilter.php b/Build/src/V1/PushFilter.php deleted file mode 100644 index cb49ff8c7ef5..000000000000 --- a/Build/src/V1/PushFilter.php +++ /dev/null @@ -1,158 +0,0 @@ -google.devtools.cloudbuild.v1.PushFilter - */ -class PushFilter extends \Google\Protobuf\Internal\Message -{ - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - */ - private $invert_regex = false; - protected $git_ref; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $branch - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $tag - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type bool $invert_regex - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @return string - */ - public function getBranch() - { - return $this->readOneof(2); - } - - public function hasBranch() - { - return $this->hasOneof(2); - } - - /** - * Regexes matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch = 2; - * @param string $var - * @return $this - */ - public function setBranch($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag = 3; - * @return string - */ - public function getTag() - { - return $this->readOneof(3); - } - - public function hasTag() - { - return $this->hasOneof(3); - } - - /** - * Regexes matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag = 3; - * @param string $var - * @return $this - */ - public function setTag($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * When true, only trigger a build if the revision regex does NOT match the - * git_ref regex. - * - * Generated from protobuf field bool invert_regex = 4; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * @return string - */ - public function getGitRef() - { - return $this->whichOneof("git_ref"); - } - -} - diff --git a/Build/src/V1/ReceiveTriggerWebhookRequest.php b/Build/src/V1/ReceiveTriggerWebhookRequest.php deleted file mode 100644 index afaa1994e219..000000000000 --- a/Build/src/V1/ReceiveTriggerWebhookRequest.php +++ /dev/null @@ -1,218 +0,0 @@ -google.devtools.cloudbuild.v1.ReceiveTriggerWebhookRequest - */ -class ReceiveTriggerWebhookRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - */ - private $name = ''; - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - */ - private $body = null; - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - */ - private $project_id = ''; - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - */ - private $trigger = ''; - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - */ - private $secret = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type \Google\Api\HttpBody $body - * HTTP request body. - * @type string $project_id - * Project in which the specified trigger lives - * @type string $trigger - * Name of the trigger to run the payload against - * @type string $secret - * Secret token used for authorization if an OAuth token isn't provided. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `ReceiveTriggerWebhook` to retrieve. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 5; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - * @return \Google\Api\HttpBody|null - */ - public function getBody() - { - return $this->body; - } - - public function hasBody() - { - return isset($this->body); - } - - public function clearBody() - { - unset($this->body); - } - - /** - * HTTP request body. - * - * Generated from protobuf field .google.api.HttpBody body = 1; - * @param \Google\Api\HttpBody $var - * @return $this - */ - public function setBody($var) - { - GPBUtil::checkMessage($var, \Google\Api\HttpBody::class); - $this->body = $var; - - return $this; - } - - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project in which the specified trigger lives - * - * Generated from protobuf field string project_id = 2; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - * @return string - */ - public function getTrigger() - { - return $this->trigger; - } - - /** - * Name of the trigger to run the payload against - * - * Generated from protobuf field string trigger = 3; - * @param string $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkString($var, True); - $this->trigger = $var; - - return $this; - } - - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - * @return string - */ - public function getSecret() - { - return $this->secret; - } - - /** - * Secret token used for authorization if an OAuth token isn't provided. - * - * Generated from protobuf field string secret = 4; - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->secret = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/ReceiveTriggerWebhookResponse.php b/Build/src/V1/ReceiveTriggerWebhookResponse.php deleted file mode 100644 index b83c62b3d78f..000000000000 --- a/Build/src/V1/ReceiveTriggerWebhookResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.devtools.cloudbuild.v1.ReceiveTriggerWebhookResponse - */ -class ReceiveTriggerWebhookResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - -} - diff --git a/Build/src/V1/RepoSource.php b/Build/src/V1/RepoSource.php deleted file mode 100644 index 2934cfdf9fd8..000000000000 --- a/Build/src/V1/RepoSource.php +++ /dev/null @@ -1,343 +0,0 @@ -google.devtools.cloudbuild.v1.RepoSource - */ -class RepoSource extends \Google\Protobuf\Internal\Message -{ - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - */ - private $project_id = ''; - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - */ - private $repo_name = ''; - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - */ - private $dir = ''; - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - */ - private $invert_regex = false; - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - */ - private $substitutions; - protected $revision; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * @type string $repo_name - * Name of the Cloud Source Repository. - * @type string $branch_name - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $tag_name - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * @type string $commit_sha - * Explicit commit SHA to build. - * @type string $dir - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * @type bool $invert_regex - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * @type array|\Google\Protobuf\Internal\MapField $substitutions - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - * @return string - */ - public function getRepoName() - { - return $this->repo_name; - } - - /** - * Name of the Cloud Source Repository. - * - * Generated from protobuf field string repo_name = 2; - * @param string $var - * @return $this - */ - public function setRepoName($var) - { - GPBUtil::checkString($var, True); - $this->repo_name = $var; - - return $this; - } - - /** - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch_name = 3; - * @return string - */ - public function getBranchName() - { - return $this->readOneof(3); - } - - public function hasBranchName() - { - return $this->hasOneof(3); - } - - /** - * Regex matching branches to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string branch_name = 3; - * @param string $var - * @return $this - */ - public function setBranchName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag_name = 4; - * @return string - */ - public function getTagName() - { - return $this->readOneof(4); - } - - public function hasTagName() - { - return $this->hasOneof(4); - } - - /** - * Regex matching tags to build. - * The syntax of the regular expressions accepted is the syntax accepted by - * RE2 and described at https://github.com/google/re2/wiki/Syntax - * - * Generated from protobuf field string tag_name = 4; - * @param string $var - * @return $this - */ - public function setTagName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Explicit commit SHA to build. - * - * Generated from protobuf field string commit_sha = 5; - * @return string - */ - public function getCommitSha() - { - return $this->readOneof(5); - } - - public function hasCommitSha() - { - return $this->hasOneof(5); - } - - /** - * Explicit commit SHA to build. - * - * Generated from protobuf field string commit_sha = 5; - * @param string $var - * @return $this - */ - public function setCommitSha($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - * @return string - */ - public function getDir() - { - return $this->dir; - } - - /** - * Directory, relative to the source root, in which to run the build. - * This must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. - * - * Generated from protobuf field string dir = 7; - * @param string $var - * @return $this - */ - public function setDir($var) - { - GPBUtil::checkString($var, True); - $this->dir = $var; - - return $this; - } - - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - * @return bool - */ - public function getInvertRegex() - { - return $this->invert_regex; - } - - /** - * Only trigger a build if the revision regex does NOT match the revision - * regex. - * - * Generated from protobuf field bool invert_regex = 8; - * @param bool $var - * @return $this - */ - public function setInvertRegex($var) - { - GPBUtil::checkBool($var); - $this->invert_regex = $var; - - return $this; - } - - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSubstitutions() - { - return $this->substitutions; - } - - /** - * Substitutions to use in a triggered build. - * Should only be used with RunBuildTrigger - * - * Generated from protobuf field map substitutions = 9; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSubstitutions($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->substitutions = $arr; - - return $this; - } - - /** - * @return string - */ - public function getRevision() - { - return $this->whichOneof("revision"); - } - -} - diff --git a/Build/src/V1/RepositoryEventConfig.php b/Build/src/V1/RepositoryEventConfig.php deleted file mode 100644 index 65a53c45f77b..000000000000 --- a/Build/src/V1/RepositoryEventConfig.php +++ /dev/null @@ -1,177 +0,0 @@ -google.devtools.cloudbuild.v1.RepositoryEventConfig - */ -class RepositoryEventConfig extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - */ - private $repository = ''; - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $repository_type = 0; - protected $filter; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $repository - * The resource name of the Repo API resource. - * @type int $repository_type - * Output only. The type of the SCM vendor the repository points to. - * @type \Google\Cloud\Build\V1\PullRequestFilter $pull_request - * Filter to match changes in pull requests. - * @type \Google\Cloud\Build\V1\PushFilter $push - * Filter to match changes in refs like branches, tags. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getRepository() - { - return $this->repository; - } - - /** - * The resource name of the Repo API resource. - * - * Generated from protobuf field string repository = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setRepository($var) - { - GPBUtil::checkString($var, True); - $this->repository = $var; - - return $this; - } - - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getRepositoryType() - { - return $this->repository_type; - } - - /** - * Output only. The type of the SCM vendor the repository points to. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType repository_type = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setRepositoryType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\RepositoryEventConfig\RepositoryType::class); - $this->repository_type = $var; - - return $this; - } - - /** - * Filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 3; - * @return \Google\Cloud\Build\V1\PullRequestFilter|null - */ - public function getPullRequest() - { - return $this->readOneof(3); - } - - public function hasPullRequest() - { - return $this->hasOneof(3); - } - - /** - * Filter to match changes in pull requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PullRequestFilter pull_request = 3; - * @param \Google\Cloud\Build\V1\PullRequestFilter $var - * @return $this - */ - public function setPullRequest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PullRequestFilter::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 4; - * @return \Google\Cloud\Build\V1\PushFilter|null - */ - public function getPush() - { - return $this->readOneof(4); - } - - public function hasPush() - { - return $this->hasOneof(4); - } - - /** - * Filter to match changes in refs like branches, tags. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PushFilter push = 4; - * @param \Google\Cloud\Build\V1\PushFilter $var - * @return $this - */ - public function setPush($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PushFilter::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getFilter() - { - return $this->whichOneof("filter"); - } - -} - diff --git a/Build/src/V1/RepositoryEventConfig/RepositoryType.php b/Build/src/V1/RepositoryEventConfig/RepositoryType.php deleted file mode 100644 index 4b07027ca872..000000000000 --- a/Build/src/V1/RepositoryEventConfig/RepositoryType.php +++ /dev/null @@ -1,69 +0,0 @@ -google.devtools.cloudbuild.v1.RepositoryEventConfig.RepositoryType - */ -class RepositoryType -{ - /** - * If unspecified, RepositoryType defaults to GITHUB. - * - * Generated from protobuf enum REPOSITORY_TYPE_UNSPECIFIED = 0; - */ - const REPOSITORY_TYPE_UNSPECIFIED = 0; - /** - * The SCM repo is GITHUB. - * - * Generated from protobuf enum GITHUB = 1; - */ - const GITHUB = 1; - /** - * The SCM repo is GITHUB Enterprise. - * - * Generated from protobuf enum GITHUB_ENTERPRISE = 2; - */ - const GITHUB_ENTERPRISE = 2; - /** - * The SCM repo is GITLAB Enterprise. - * - * Generated from protobuf enum GITLAB_ENTERPRISE = 3; - */ - const GITLAB_ENTERPRISE = 3; - - private static $valueToName = [ - self::REPOSITORY_TYPE_UNSPECIFIED => 'REPOSITORY_TYPE_UNSPECIFIED', - self::GITHUB => 'GITHUB', - self::GITHUB_ENTERPRISE => 'GITHUB_ENTERPRISE', - self::GITLAB_ENTERPRISE => 'GITLAB_ENTERPRISE', - ]; - - 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/Build/src/V1/Results.php b/Build/src/V1/Results.php deleted file mode 100644 index 2313789d1151..000000000000 --- a/Build/src/V1/Results.php +++ /dev/null @@ -1,377 +0,0 @@ -google.devtools.cloudbuild.v1.Results - */ -class Results extends \Google\Protobuf\Internal\Message -{ - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - */ - private $images; - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - */ - private $build_step_images; - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - */ - private $artifact_manifest = ''; - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - */ - private $num_artifacts = 0; - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - */ - private $build_step_outputs; - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - */ - private $artifact_timing = null; - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - */ - private $python_packages; - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - */ - private $maven_artifacts; - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - */ - private $npm_packages; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\BuiltImage>|\Google\Protobuf\Internal\RepeatedField $images - * Container images that were built as a part of the build. - * @type array|\Google\Protobuf\Internal\RepeatedField $build_step_images - * List of build step digests, in the order corresponding to build step - * indices. - * @type string $artifact_manifest - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * @type int|string $num_artifacts - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * @type array|\Google\Protobuf\Internal\RepeatedField $build_step_outputs - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * @type \Google\Cloud\Build\V1\TimeSpan $artifact_timing - * Time to push all non-container artifacts to Cloud Storage. - * @type array<\Google\Cloud\Build\V1\UploadedPythonPackage>|\Google\Protobuf\Internal\RepeatedField $python_packages - * Python artifacts uploaded to Artifact Registry at the end of the build. - * @type array<\Google\Cloud\Build\V1\UploadedMavenArtifact>|\Google\Protobuf\Internal\RepeatedField $maven_artifacts - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * @type array<\Google\Cloud\Build\V1\UploadedNpmPackage>|\Google\Protobuf\Internal\RepeatedField $npm_packages - * Npm packages uploaded to Artifact Registry at the end of the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getImages() - { - return $this->images; - } - - /** - * Container images that were built as a part of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.BuiltImage images = 2; - * @param array<\Google\Cloud\Build\V1\BuiltImage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\BuiltImage::class); - $this->images = $arr; - - return $this; - } - - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuildStepImages() - { - return $this->build_step_images; - } - - /** - * List of build step digests, in the order corresponding to build step - * indices. - * - * Generated from protobuf field repeated string build_step_images = 3; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuildStepImages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->build_step_images = $arr; - - return $this; - } - - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - * @return string - */ - public function getArtifactManifest() - { - return $this->artifact_manifest; - } - - /** - * Path to the artifact manifest for non-container artifacts uploaded to Cloud - * Storage. Only populated when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field string artifact_manifest = 4; - * @param string $var - * @return $this - */ - public function setArtifactManifest($var) - { - GPBUtil::checkString($var, True); - $this->artifact_manifest = $var; - - return $this; - } - - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - * @return int|string - */ - public function getNumArtifacts() - { - return $this->num_artifacts; - } - - /** - * Number of non-container artifacts uploaded to Cloud Storage. Only populated - * when artifacts are uploaded to Cloud Storage. - * - * Generated from protobuf field int64 num_artifacts = 5; - * @param int|string $var - * @return $this - */ - public function setNumArtifacts($var) - { - GPBUtil::checkInt64($var); - $this->num_artifacts = $var; - - return $this; - } - - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getBuildStepOutputs() - { - return $this->build_step_outputs; - } - - /** - * List of build step outputs, produced by builder images, in the order - * corresponding to build step indices. - * [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders) - * can produce this output by writing to `$BUILDER_OUTPUT/output`. - * Only the first 4KB of data is stored. - * - * Generated from protobuf field repeated bytes build_step_outputs = 6; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setBuildStepOutputs($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES); - $this->build_step_outputs = $arr; - - return $this; - } - - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getArtifactTiming() - { - return $this->artifact_timing; - } - - public function hasArtifactTiming() - { - return isset($this->artifact_timing); - } - - public function clearArtifactTiming() - { - unset($this->artifact_timing); - } - - /** - * Time to push all non-container artifacts to Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan artifact_timing = 7; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setArtifactTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->artifact_timing = $var; - - return $this; - } - - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPythonPackages() - { - return $this->python_packages; - } - - /** - * Python artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedPythonPackage python_packages = 8; - * @param array<\Google\Cloud\Build\V1\UploadedPythonPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPythonPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedPythonPackage::class); - $this->python_packages = $arr; - - return $this; - } - - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMavenArtifacts() - { - return $this->maven_artifacts; - } - - /** - * Maven artifacts uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedMavenArtifact maven_artifacts = 9; - * @param array<\Google\Cloud\Build\V1\UploadedMavenArtifact>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMavenArtifacts($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedMavenArtifact::class); - $this->maven_artifacts = $arr; - - return $this; - } - - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNpmPackages() - { - return $this->npm_packages; - } - - /** - * Npm packages uploaded to Artifact Registry at the end of the build. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.UploadedNpmPackage npm_packages = 12; - * @param array<\Google\Cloud\Build\V1\UploadedNpmPackage>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNpmPackages($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\UploadedNpmPackage::class); - $this->npm_packages = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/RetryBuildRequest.php b/Build/src/V1/RetryBuildRequest.php deleted file mode 100644 index 7cb6776d63cc..000000000000 --- a/Build/src/V1/RetryBuildRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -google.devtools.cloudbuild.v1.RetryBuildRequest - */ -class RetryBuildRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @type string $project_id - * Required. ID of the project. - * @type string $id - * Required. Build ID of the original build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * - * Generated from protobuf field string name = 3 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Required. Build ID of the original build. - * - * Generated from protobuf field string id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkString($var, True); - $this->id = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/RunBuildTriggerRequest.php b/Build/src/V1/RunBuildTriggerRequest.php deleted file mode 100644 index 2c6f2ca0fd77..000000000000 --- a/Build/src/V1/RunBuildTriggerRequest.php +++ /dev/null @@ -1,187 +0,0 @@ -google.devtools.cloudbuild.v1.RunBuildTriggerRequest - */ -class RunBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - */ - private $name = ''; - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - */ - private $source = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @type string $project_id - * Required. ID of the project. - * @type string $trigger_id - * Required. ID of the trigger. - * @type \Google\Cloud\Build\V1\RepoSource $source - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * - * Generated from protobuf field string name = 4 [(.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 project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the trigger. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getSource() - { - return $this->source; - } - - public function hasSource() - { - return isset($this->source); - } - - public function clearSource() - { - unset($this->source); - } - - /** - * Source to build against this trigger. - * Branch and tag names cannot consist of regular expressions. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource source = 3; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->source = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Secret.php b/Build/src/V1/Secret.php deleted file mode 100644 index 9fd4c09d1699..000000000000 --- a/Build/src/V1/Secret.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.Secret - */ -class Secret extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - */ - private $kms_key_name = ''; - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - */ - private $secret_env; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kms_key_name - * Cloud KMS key name to use to decrypt these envs. - * @type array|\Google\Protobuf\Internal\MapField $secret_env - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - * @return string - */ - public function getKmsKeyName() - { - return $this->kms_key_name; - } - - /** - * Cloud KMS key name to use to decrypt these envs. - * - * Generated from protobuf field string kms_key_name = 1; - * @param string $var - * @return $this - */ - public function setKmsKeyName($var) - { - GPBUtil::checkString($var, True); - $this->kms_key_name = $var; - - return $this; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getSecretEnv() - { - return $this->secret_env; - } - - /** - * Map of environment variable name to its encrypted value. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. Values can be at most - * 64 KB in size. There can be at most 100 secret values across all of a - * build's secrets. - * - * Generated from protobuf field map secret_env = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setSecretEnv($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::BYTES); - $this->secret_env = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/SecretManagerSecret.php b/Build/src/V1/SecretManagerSecret.php deleted file mode 100644 index 711adededa11..000000000000 --- a/Build/src/V1/SecretManagerSecret.php +++ /dev/null @@ -1,113 +0,0 @@ -google.devtools.cloudbuild.v1.SecretManagerSecret - */ -class SecretManagerSecret extends \Google\Protobuf\Internal\Message -{ - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - */ - private $version_name = ''; - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - */ - private $env = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $version_name - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * @type string $env - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getVersionName() - { - return $this->version_name; - } - - /** - * Resource name of the SecretVersion. In format: - * projects/*/secrets/*/versions/* - * - * Generated from protobuf field string version_name = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setVersionName($var) - { - GPBUtil::checkString($var, True); - $this->version_name = $var; - - return $this; - } - - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - * @return string - */ - public function getEnv() - { - return $this->env; - } - - /** - * Environment variable name to associate with the secret. - * Secret environment variables must be unique across all of a build's - * secrets, and must be used by at least one build step. - * - * Generated from protobuf field string env = 2; - * @param string $var - * @return $this - */ - public function setEnv($var) - { - GPBUtil::checkString($var, True); - $this->env = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Secrets.php b/Build/src/V1/Secrets.php deleted file mode 100644 index b43d3c3f25c2..000000000000 --- a/Build/src/V1/Secrets.php +++ /dev/null @@ -1,105 +0,0 @@ -google.devtools.cloudbuild.v1.Secrets - */ -class Secrets extends \Google\Protobuf\Internal\Message -{ - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - */ - private $secret_manager; - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - */ - private $inline; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Build\V1\SecretManagerSecret>|\Google\Protobuf\Internal\RepeatedField $secret_manager - * Secrets in Secret Manager and associated secret environment variable. - * @type array<\Google\Cloud\Build\V1\InlineSecret>|\Google\Protobuf\Internal\RepeatedField $inline - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getSecretManager() - { - return $this->secret_manager; - } - - /** - * Secrets in Secret Manager and associated secret environment variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.SecretManagerSecret secret_manager = 1; - * @param array<\Google\Cloud\Build\V1\SecretManagerSecret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setSecretManager($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\SecretManagerSecret::class); - $this->secret_manager = $arr; - - return $this; - } - - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getInline() - { - return $this->inline; - } - - /** - * Secrets encrypted with KMS key and the associated secret environment - * variable. - * - * Generated from protobuf field repeated .google.devtools.cloudbuild.v1.InlineSecret inline = 2; - * @param array<\Google\Cloud\Build\V1\InlineSecret>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setInline($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\InlineSecret::class); - $this->inline = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/Source.php b/Build/src/V1/Source.php deleted file mode 100644 index 62906bcf427a..000000000000 --- a/Build/src/V1/Source.php +++ /dev/null @@ -1,183 +0,0 @@ -google.devtools.cloudbuild.v1.Source - */ -class Source extends \Google\Protobuf\Internal\Message -{ - protected $source; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\StorageSource $storage_source - * If provided, get the source from this location in Cloud Storage. - * @type \Google\Cloud\Build\V1\RepoSource $repo_source - * If provided, get the source from this location in a Cloud Source - * Repository. - * @type \Google\Cloud\Build\V1\GitSource $git_source - * If provided, get the source from this Git repository. - * @type \Google\Cloud\Build\V1\StorageSourceManifest $storage_source_manifest - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * If provided, get the source from this location in Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource storage_source = 2; - * @return \Google\Cloud\Build\V1\StorageSource|null - */ - public function getStorageSource() - { - return $this->readOneof(2); - } - - public function hasStorageSource() - { - return $this->hasOneof(2); - } - - /** - * If provided, get the source from this location in Cloud Storage. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource storage_source = 2; - * @param \Google\Cloud\Build\V1\StorageSource $var - * @return $this - */ - public function setStorageSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSource::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * If provided, get the source from this location in a Cloud Source - * Repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource repo_source = 3; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getRepoSource() - { - return $this->readOneof(3); - } - - public function hasRepoSource() - { - return $this->hasOneof(3); - } - - /** - * If provided, get the source from this location in a Cloud Source - * Repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource repo_source = 3; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setRepoSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * If provided, get the source from this Git repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitSource git_source = 5; - * @return \Google\Cloud\Build\V1\GitSource|null - */ - public function getGitSource() - { - return $this->readOneof(5); - } - - public function hasGitSource() - { - return $this->hasOneof(5); - } - - /** - * If provided, get the source from this Git repository. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.GitSource git_source = 5; - * @param \Google\Cloud\Build\V1\GitSource $var - * @return $this - */ - public function setGitSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\GitSource::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest storage_source_manifest = 8; - * @return \Google\Cloud\Build\V1\StorageSourceManifest|null - */ - public function getStorageSourceManifest() - { - return $this->readOneof(8); - } - - public function hasStorageSourceManifest() - { - return $this->hasOneof(8); - } - - /** - * If provided, get the source from this manifest in Cloud Storage. - * This feature is in Preview; see description - * [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest storage_source_manifest = 8; - * @param \Google\Cloud\Build\V1\StorageSourceManifest $var - * @return $this - */ - public function setStorageSourceManifest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSourceManifest::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * @return string - */ - public function getSource() - { - return $this->whichOneof("source"); - } - -} - diff --git a/Build/src/V1/SourceProvenance.php b/Build/src/V1/SourceProvenance.php deleted file mode 100644 index 26f8a91c1e55..000000000000 --- a/Build/src/V1/SourceProvenance.php +++ /dev/null @@ -1,244 +0,0 @@ -google.devtools.cloudbuild.v1.SourceProvenance - */ -class SourceProvenance extends \Google\Protobuf\Internal\Message -{ - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - */ - private $resolved_storage_source = null; - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - */ - private $resolved_repo_source = null; - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - */ - private $resolved_storage_source_manifest = null; - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $file_hashes; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\StorageSource $resolved_storage_source - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * @type \Google\Cloud\Build\V1\RepoSource $resolved_repo_source - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * @type \Google\Cloud\Build\V1\StorageSourceManifest $resolved_storage_source_manifest - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * @type array|\Google\Protobuf\Internal\MapField $file_hashes - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - * @return \Google\Cloud\Build\V1\StorageSource|null - */ - public function getResolvedStorageSource() - { - return $this->resolved_storage_source; - } - - public function hasResolvedStorageSource() - { - return isset($this->resolved_storage_source); - } - - public function clearResolvedStorageSource() - { - unset($this->resolved_storage_source); - } - - /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource resolved_storage_source = 3; - * @param \Google\Cloud\Build\V1\StorageSource $var - * @return $this - */ - public function setResolvedStorageSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSource::class); - $this->resolved_storage_source = $var; - - return $this; - } - - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - * @return \Google\Cloud\Build\V1\RepoSource|null - */ - public function getResolvedRepoSource() - { - return $this->resolved_repo_source; - } - - public function hasResolvedRepoSource() - { - return isset($this->resolved_repo_source); - } - - public function clearResolvedRepoSource() - { - unset($this->resolved_repo_source); - } - - /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.RepoSource resolved_repo_source = 6; - * @param \Google\Cloud\Build\V1\RepoSource $var - * @return $this - */ - public function setResolvedRepoSource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\RepoSource::class); - $this->resolved_repo_source = $var; - - return $this; - } - - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - * @return \Google\Cloud\Build\V1\StorageSourceManifest|null - */ - public function getResolvedStorageSourceManifest() - { - return $this->resolved_storage_source_manifest; - } - - public function hasResolvedStorageSourceManifest() - { - return isset($this->resolved_storage_source_manifest); - } - - public function clearResolvedStorageSourceManifest() - { - unset($this->resolved_storage_source_manifest); - } - - /** - * A copy of the build's `source.storage_source_manifest`, if exists, with any - * revisions resolved. - * This feature is in Preview. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSourceManifest resolved_storage_source_manifest = 9; - * @param \Google\Cloud\Build\V1\StorageSourceManifest $var - * @return $this - */ - public function setResolvedStorageSourceManifest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\StorageSourceManifest::class); - $this->resolved_storage_source_manifest = $var; - - return $this; - } - - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - /** - * Output only. Hash(es) of the build source, which can be used to verify that - * the original source integrity was maintained in the build. Note that - * `FileHashes` will only be populated if `BuildOptions` has requested a - * `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. - * If the build source came in a single package such as a gzipped tarfile - * (`.tar.gz`), the `FileHash` will be for the single path to that file. - * - * Generated from protobuf field map file_hashes = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setFileHashes($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $arr; - - return $this; - } - -} - diff --git a/Build/src/V1/StorageSource.php b/Build/src/V1/StorageSource.php deleted file mode 100644 index afc0ea14f43b..000000000000 --- a/Build/src/V1/StorageSource.php +++ /dev/null @@ -1,189 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSource - */ -class StorageSource extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - */ - private $bucket = ''; - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - */ - private $object = ''; - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - */ - private $generation = 0; - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $source_fetcher = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * @type string $object - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * @type int|string $generation - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * @type int $source_fetcher - * Option to specify the tool to fetch the source file for the build. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Cloud Storage bucket containing the source (see - * [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - * @return string - */ - public function getObject() - { - return $this->object; - } - - /** - * Cloud Storage object containing the source. - * This object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) - * containing source to build. - * - * Generated from protobuf field string object = 2; - * @param string $var - * @return $this - */ - public function setObject($var) - { - GPBUtil::checkString($var, True); - $this->object = $var; - - return $this; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return int - */ - public function getSourceFetcher() - { - return $this->source_fetcher; - } - - /** - * Option to specify the tool to fetch the source file for the build. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.StorageSource.SourceFetcher source_fetcher = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param int $var - * @return $this - */ - public function setSourceFetcher($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\StorageSource\SourceFetcher::class); - $this->source_fetcher = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/StorageSource/SourceFetcher.php b/Build/src/V1/StorageSource/SourceFetcher.php deleted file mode 100644 index 5e9c05c7a010..000000000000 --- a/Build/src/V1/StorageSource/SourceFetcher.php +++ /dev/null @@ -1,62 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSource.SourceFetcher - */ -class SourceFetcher -{ - /** - * Unspecified. Defaults to GSUTIL. - * - * Generated from protobuf enum SOURCE_FETCHER_UNSPECIFIED = 0; - */ - const SOURCE_FETCHER_UNSPECIFIED = 0; - /** - * Use the "gsutil" tool to download the source file. - * - * Generated from protobuf enum GSUTIL = 1; - */ - const GSUTIL = 1; - /** - * Use the Cloud Storage Fetcher tool to download the source file. - * - * Generated from protobuf enum GCS_FETCHER = 2; - */ - const GCS_FETCHER = 2; - - private static $valueToName = [ - self::SOURCE_FETCHER_UNSPECIFIED => 'SOURCE_FETCHER_UNSPECIFIED', - self::GSUTIL => 'GSUTIL', - self::GCS_FETCHER => 'GCS_FETCHER', - ]; - - 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/Build/src/V1/StorageSourceManifest.php b/Build/src/V1/StorageSourceManifest.php deleted file mode 100644 index 74cd6e2b6522..000000000000 --- a/Build/src/V1/StorageSourceManifest.php +++ /dev/null @@ -1,153 +0,0 @@ -google.devtools.cloudbuild.v1.StorageSourceManifest - */ -class StorageSourceManifest extends \Google\Protobuf\Internal\Message -{ - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - */ - private $bucket = ''; - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - */ - private $object = ''; - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - */ - private $generation = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $bucket - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * @type string $object - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * @type int|string $generation - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @return string - */ - public function getBucket() - { - return $this->bucket; - } - - /** - * Cloud Storage bucket containing the source manifest (see [Bucket - * Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * - * Generated from protobuf field string bucket = 1; - * @param string $var - * @return $this - */ - public function setBucket($var) - { - GPBUtil::checkString($var, True); - $this->bucket = $var; - - return $this; - } - - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - * @return string - */ - public function getObject() - { - return $this->object; - } - - /** - * Cloud Storage object containing the source manifest. - * This object must be a JSON file. - * - * Generated from protobuf field string object = 2; - * @param string $var - * @return $this - */ - public function setObject($var) - { - GPBUtil::checkString($var, True); - $this->object = $var; - - return $this; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @return int|string - */ - public function getGeneration() - { - return $this->generation; - } - - /** - * Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - * - * Generated from protobuf field int64 generation = 3; - * @param int|string $var - * @return $this - */ - public function setGeneration($var) - { - GPBUtil::checkInt64($var); - $this->generation = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/TimeSpan.php b/Build/src/V1/TimeSpan.php deleted file mode 100644 index bb5d10e292a4..000000000000 --- a/Build/src/V1/TimeSpan.php +++ /dev/null @@ -1,121 +0,0 @@ -google.devtools.cloudbuild.v1.TimeSpan - */ -class TimeSpan extends \Google\Protobuf\Internal\Message -{ - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - private $start_time = null; - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - private $end_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * Start of time span. - * @type \Google\Protobuf\Timestamp $end_time - * End of time span. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * Start of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * End of time span. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateBuildTriggerRequest.php b/Build/src/V1/UpdateBuildTriggerRequest.php deleted file mode 100644 index 4575fec5ff11..000000000000 --- a/Build/src/V1/UpdateBuildTriggerRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateBuildTriggerRequest - */ -class UpdateBuildTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $project_id = ''; - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger_id = ''; - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $trigger = null; - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - */ - private $update_mask = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. ID of the project that owns the trigger. - * @type string $trigger_id - * Required. ID of the `BuildTrigger` to update. - * @type \Google\Cloud\Build\V1\BuildTrigger $trigger - * Required. `BuildTrigger` to update. - * @type \Google\Protobuf\FieldMask $update_mask - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. ID of the project that owns the trigger. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. ID of the `BuildTrigger` to update. - * - * Generated from protobuf field string trigger_id = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\BuildTrigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * Required. `BuildTrigger` to update. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.BuildTrigger trigger = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\BuildTrigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\BuildTrigger::class); - $this->trigger = $var; - - return $this; - } - - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - * @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); - } - - /** - * Update mask for the resource. If this is set, - * the server will only update the fields specified in the field mask. - * Otherwise, a full update of the mutable resource fields will be performed. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 5; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateWorkerPoolOperationMetadata.php b/Build/src/V1/UpdateWorkerPoolOperationMetadata.php deleted file mode 100644 index ac35538bc7c8..000000000000 --- a/Build/src/V1/UpdateWorkerPoolOperationMetadata.php +++ /dev/null @@ -1,163 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata - */ -class UpdateWorkerPoolOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - */ - private $worker_pool = ''; - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - */ - private $create_time = null; - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - */ - private $complete_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $worker_pool - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * @type \Google\Protobuf\Timestamp $create_time - * Time the operation was created. - * @type \Google\Protobuf\Timestamp $complete_time - * Time the operation was completed. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @return string - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - /** - * The resource name of the `WorkerPool` being updated. - * Format: - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * - * Generated from protobuf field string worker_pool = 1 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkString($var, True); - $this->worker_pool = $var; - - return $this; - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCompleteTime() - { - return $this->complete_time; - } - - public function hasCompleteTime() - { - return isset($this->complete_time); - } - - public function clearCompleteTime() - { - unset($this->complete_time); - } - - /** - * Time the operation was completed. - * - * Generated from protobuf field .google.protobuf.Timestamp complete_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCompleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->complete_time = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UpdateWorkerPoolRequest.php b/Build/src/V1/UpdateWorkerPoolRequest.php deleted file mode 100644 index e4ff97b5d993..000000000000 --- a/Build/src/V1/UpdateWorkerPoolRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest - */ -class UpdateWorkerPoolRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $worker_pool = null; - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - private $update_mask = null; - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - */ - private $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Build\V1\WorkerPool $worker_pool - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * @type \Google\Protobuf\FieldMask $update_mask - * A mask specifying which fields in `worker_pool` to update. - * @type bool $validate_only - * If set, validate the request and preview the response, but do not actually - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Build\V1\WorkerPool|null - */ - public function getWorkerPool() - { - return $this->worker_pool; - } - - public function hasWorkerPool() - { - return isset($this->worker_pool); - } - - public function clearWorkerPool() - { - unset($this->worker_pool); - } - - /** - * Required. The `WorkerPool` to update. - * The `name` field is used to identify the `WorkerPool` to update. - * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool worker_pool = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Build\V1\WorkerPool $var - * @return $this - */ - public function setWorkerPool($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WorkerPool::class); - $this->worker_pool = $var; - - return $this; - } - - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @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); - } - - /** - * A mask specifying which fields in `worker_pool` to update. - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * If set, validate the request and preview the response, but do not actually - * post it. - * - * Generated from protobuf field bool validate_only = 4; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedMavenArtifact.php b/Build/src/V1/UploadedMavenArtifact.php deleted file mode 100644 index 4f3afc223d21..000000000000 --- a/Build/src/V1/UploadedMavenArtifact.php +++ /dev/null @@ -1,155 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedMavenArtifact - */ -class UploadedMavenArtifact extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded artifact. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the Maven Artifact. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the Maven Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedNpmPackage.php b/Build/src/V1/UploadedNpmPackage.php deleted file mode 100644 index 042e1f3ee66c..000000000000 --- a/Build/src/V1/UploadedNpmPackage.php +++ /dev/null @@ -1,156 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedNpmPackage - */ -class UploadedNpmPackage extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded npm package. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the npm package. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded npm package. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the npm package. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/UploadedPythonPackage.php b/Build/src/V1/UploadedPythonPackage.php deleted file mode 100644 index f4b5cce260e1..000000000000 --- a/Build/src/V1/UploadedPythonPackage.php +++ /dev/null @@ -1,155 +0,0 @@ -google.devtools.cloudbuild.v1.UploadedPythonPackage - */ -class UploadedPythonPackage extends \Google\Protobuf\Internal\Message -{ - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - */ - private $uri = ''; - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - */ - private $file_hashes = null; - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $push_timing = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $uri - * URI of the uploaded artifact. - * @type \Google\Cloud\Build\V1\FileHashes $file_hashes - * Hash types and values of the Python Artifact. - * @type \Google\Cloud\Build\V1\TimeSpan $push_timing - * Output only. Stores timing information for pushing the specified artifact. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * URI of the uploaded artifact. - * - * Generated from protobuf field string uri = 1; - * @param string $var - * @return $this - */ - public function setUri($var) - { - GPBUtil::checkString($var, True); - $this->uri = $var; - - return $this; - } - - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @return \Google\Cloud\Build\V1\FileHashes|null - */ - public function getFileHashes() - { - return $this->file_hashes; - } - - public function hasFileHashes() - { - return isset($this->file_hashes); - } - - public function clearFileHashes() - { - unset($this->file_hashes); - } - - /** - * Hash types and values of the Python Artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.FileHashes file_hashes = 2; - * @param \Google\Cloud\Build\V1\FileHashes $var - * @return $this - */ - public function setFileHashes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\FileHashes::class); - $this->file_hashes = $var; - - return $this; - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Cloud\Build\V1\TimeSpan|null - */ - public function getPushTiming() - { - return $this->push_timing; - } - - public function hasPushTiming() - { - return isset($this->push_timing); - } - - public function clearPushTiming() - { - unset($this->push_timing); - } - - /** - * Output only. Stores timing information for pushing the specified artifact. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.TimeSpan push_timing = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Cloud\Build\V1\TimeSpan $var - * @return $this - */ - public function setPushTiming($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\TimeSpan::class); - $this->push_timing = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/Volume.php b/Build/src/V1/Volume.php deleted file mode 100644 index 4dba33d5d098..000000000000 --- a/Build/src/V1/Volume.php +++ /dev/null @@ -1,118 +0,0 @@ -google.devtools.cloudbuild.v1.Volume - */ -class Volume extends \Google\Protobuf\Internal\Message -{ - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - */ - private $name = ''; - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - */ - private $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * @type string $path - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Name of the volume to mount. - * Volume names must be unique per build step and must be valid names for - * Docker volumes. Each named volume must be used by at least two build steps. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Path at which to mount the volume. - * Paths must be absolute and cannot conflict with other volume paths on the - * same build step or with certain reserved volume paths. - * - * Generated from protobuf field string path = 2; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/Build/src/V1/WebhookConfig.php b/Build/src/V1/WebhookConfig.php deleted file mode 100644 index 3601262392a2..000000000000 --- a/Build/src/V1/WebhookConfig.php +++ /dev/null @@ -1,114 +0,0 @@ -google.devtools.cloudbuild.v1.WebhookConfig - */ -class WebhookConfig extends \Google\Protobuf\Internal\Message -{ - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - */ - private $state = 0; - protected $auth_method; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $secret - * Required. Resource name for the secret required as a URL parameter. - * @type int $state - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Required. Resource name for the secret required as a URL parameter. - * - * Generated from protobuf field string secret = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getSecret() - { - return $this->readOneof(3); - } - - public function hasSecret() - { - return $this->hasOneof(3); - } - - /** - * Required. Resource name for the secret required as a URL parameter. - * - * Generated from protobuf field string secret = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setSecret($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Potential issues with the underlying Pub/Sub subscription configuration. - * Only populated on get requests. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WebhookConfig.State state = 4; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\WebhookConfig\State::class); - $this->state = $var; - - return $this; - } - - /** - * @return string - */ - public function getAuthMethod() - { - return $this->whichOneof("auth_method"); - } - -} - diff --git a/Build/src/V1/WebhookConfig/State.php b/Build/src/V1/WebhookConfig/State.php deleted file mode 100644 index e1a8182e7fc9..000000000000 --- a/Build/src/V1/WebhookConfig/State.php +++ /dev/null @@ -1,63 +0,0 @@ -google.devtools.cloudbuild.v1.WebhookConfig.State - */ -class State -{ - /** - * The webhook auth configuration not been checked. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The auth configuration is properly setup. - * - * Generated from protobuf enum OK = 1; - */ - const OK = 1; - /** - * The secret provided in auth_method has been deleted. - * - * Generated from protobuf enum SECRET_DELETED = 2; - */ - const SECRET_DELETED = 2; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::OK => 'OK', - self::SECRET_DELETED => 'SECRET_DELETED', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - - diff --git a/Build/src/V1/WorkerPool.php b/Build/src/V1/WorkerPool.php deleted file mode 100644 index 302294c0fa87..000000000000 --- a/Build/src/V1/WorkerPool.php +++ /dev/null @@ -1,465 +0,0 @@ -google.devtools.cloudbuild.v1.WorkerPool - */ -class WorkerPool extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $name = ''; - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - */ - private $display_name = ''; - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $uid = ''; - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - */ - private $annotations; - /** - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $create_time = null; - /** - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $update_time = null; - /** - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $delete_time = null; - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $state = 0; - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - private $etag = ''; - protected $config; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * @type string $display_name - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * @type string $uid - * Output only. A unique identifier for the `WorkerPool`. - * @type array|\Google\Protobuf\Internal\MapField $annotations - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. Time at which the request to update the `WorkerPool` was - * received. - * @type \Google\Protobuf\Timestamp $delete_time - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * @type int $state - * Output only. `WorkerPool` state. - * @type \Google\Cloud\Build\V1\PrivatePoolV1Config $private_pool_v1_config - * Legacy Private Pool configuration. - * @type string $etag - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Output only. The resource name of the `WorkerPool`, with format - * `projects/{project}/locations/{location}/workerPools/{worker_pool}`. - * The value of `{worker_pool}` is provided by `worker_pool_id` in - * `CreateWorkerPool` request and the value of `{location}` is determined by - * the endpoint accessed. - * - * 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; - } - - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - * @return string - */ - public function getDisplayName() - { - return $this->display_name; - } - - /** - * A user-specified, human-readable name for the `WorkerPool`. If provided, - * this value must be 1-63 characters. - * - * Generated from protobuf field string display_name = 2; - * @param string $var - * @return $this - */ - public function setDisplayName($var) - { - GPBUtil::checkString($var, True); - $this->display_name = $var; - - return $this; - } - - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. A unique identifier for the `WorkerPool`. - * - * Generated from protobuf field string uid = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAnnotations() - { - return $this->annotations; - } - - /** - * User specified annotations. See https://google.aip.dev/128#annotations - * for more details such as format and size limitations. - * - * Generated from protobuf field map annotations = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAnnotations($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->annotations = $arr; - - return $this; - } - - /** - * Output only. Time at which the request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 request to create the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.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 request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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 request to update the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.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. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getDeleteTime() - { - return $this->delete_time; - } - - public function hasDeleteTime() - { - return isset($this->delete_time); - } - - public function clearDeleteTime() - { - unset($this->delete_time); - } - - /** - * Output only. Time at which the request to delete the `WorkerPool` was - * received. - * - * Generated from protobuf field .google.protobuf.Timestamp delete_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setDeleteTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->delete_time = $var; - - return $this; - } - - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. `WorkerPool` state. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.WorkerPool.State state = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Build\V1\WorkerPool\State::class); - $this->state = $var; - - return $this; - } - - /** - * Legacy Private Pool configuration. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config private_pool_v1_config = 12; - * @return \Google\Cloud\Build\V1\PrivatePoolV1Config|null - */ - public function getPrivatePoolV1Config() - { - return $this->readOneof(12); - } - - public function hasPrivatePoolV1Config() - { - return $this->hasOneof(12); - } - - /** - * Legacy Private Pool configuration. - * - * Generated from protobuf field .google.devtools.cloudbuild.v1.PrivatePoolV1Config private_pool_v1_config = 12; - * @param \Google\Cloud\Build\V1\PrivatePoolV1Config $var - * @return $this - */ - public function setPrivatePoolV1Config($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\PrivatePoolV1Config::class); - $this->writeOneof(12, $var); - - return $this; - } - - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. Checksum computed by the server. May be sent on update and - * delete requests to ensure that the client has an up-to-date value before - * proceeding. - * - * Generated from protobuf field string etag = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * @return string - */ - public function getConfig() - { - return $this->whichOneof("config"); - } - -} - diff --git a/Build/src/V1/WorkerPool/State.php b/Build/src/V1/WorkerPool/State.php deleted file mode 100644 index e06f0e2a8ddb..000000000000 --- a/Build/src/V1/WorkerPool/State.php +++ /dev/null @@ -1,83 +0,0 @@ -google.devtools.cloudbuild.v1.WorkerPool.State - */ -class State -{ - /** - * State of the `WorkerPool` is unknown. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * `WorkerPool` is being created. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * `WorkerPool` is running. - * - * Generated from protobuf enum RUNNING = 2; - */ - const RUNNING = 2; - /** - * `WorkerPool` is being deleted: cancelling builds and draining workers. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * `WorkerPool` is deleted. - * - * Generated from protobuf enum DELETED = 4; - */ - const DELETED = 4; - /** - * `WorkerPool` is being updated; new builds cannot be run. - * - * Generated from protobuf enum UPDATING = 5; - */ - const UPDATING = 5; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::RUNNING => 'RUNNING', - self::DELETING => 'DELETING', - self::DELETED => 'DELETED', - self::UPDATING => 'UPDATING', - ]; - - 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/Build/src/V1/gapic_metadata.json b/Build/src/V1/gapic_metadata.json deleted file mode 100644 index fbef7758f29a..000000000000 --- a/Build/src/V1/gapic_metadata.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.devtools.cloudbuild.v1", - "libraryPackage": "Google\\Cloud\\Build\\V1", - "services": { - "CloudBuild": { - "clients": { - "grpc": { - "libraryClient": "CloudBuildGapicClient", - "rpcs": { - "ApproveBuild": { - "methods": [ - "approveBuild" - ] - }, - "CancelBuild": { - "methods": [ - "cancelBuild" - ] - }, - "CreateBuild": { - "methods": [ - "createBuild" - ] - }, - "CreateBuildTrigger": { - "methods": [ - "createBuildTrigger" - ] - }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, - "DeleteBuildTrigger": { - "methods": [ - "deleteBuildTrigger" - ] - }, - "DeleteWorkerPool": { - "methods": [ - "deleteWorkerPool" - ] - }, - "GetBuild": { - "methods": [ - "getBuild" - ] - }, - "GetBuildTrigger": { - "methods": [ - "getBuildTrigger" - ] - }, - "GetWorkerPool": { - "methods": [ - "getWorkerPool" - ] - }, - "ListBuildTriggers": { - "methods": [ - "listBuildTriggers" - ] - }, - "ListBuilds": { - "methods": [ - "listBuilds" - ] - }, - "ListWorkerPools": { - "methods": [ - "listWorkerPools" - ] - }, - "ReceiveTriggerWebhook": { - "methods": [ - "receiveTriggerWebhook" - ] - }, - "RetryBuild": { - "methods": [ - "retryBuild" - ] - }, - "RunBuildTrigger": { - "methods": [ - "runBuildTrigger" - ] - }, - "UpdateBuildTrigger": { - "methods": [ - "updateBuildTrigger" - ] - }, - "UpdateWorkerPool": { - "methods": [ - "updateWorkerPool" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/Build/src/V1/resources/cloud_build_client_config.json b/Build/src/V1/resources/cloud_build_client_config.json deleted file mode 100644 index d76262d160d0..000000000000 --- a/Build/src/V1/resources/cloud_build_client_config.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "interfaces": { - "google.devtools.cloudbuild.v1.CloudBuild": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ApproveBuild": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CancelBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "CreateWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "DeleteWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetBuild": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "GetWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBuildTriggers": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListBuilds": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ListWorkerPools": { - "timeout_millis": 600000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ReceiveTriggerWebhook": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "RetryBuild": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateBuildTrigger": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "UpdateWorkerPool": { - "timeout_millis": 600000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - } - } - } - } -} diff --git a/Build/src/V1/resources/cloud_build_descriptor_config.php b/Build/src/V1/resources/cloud_build_descriptor_config.php deleted file mode 100644 index 26adbe6e6ec8..000000000000 --- a/Build/src/V1/resources/cloud_build_descriptor_config.php +++ /dev/null @@ -1,128 +0,0 @@ - [ - 'google.devtools.cloudbuild.v1.CloudBuild' => [ - 'ApproveBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\WorkerPool', - 'metadataReturnType' => '\Google\Cloud\Build\V1\CreateWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Build\V1\DeleteWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RetryBuild' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'RunBuildTrigger' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\Build', - 'metadataReturnType' => '\Google\Cloud\Build\V1\BuildOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateWorkerPool' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Build\V1\WorkerPool', - 'metadataReturnType' => '\Google\Cloud\Build\V1\UpdateWorkerPoolOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListBuildTriggers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTriggers', - ], - ], - 'ListBuilds' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getBuilds', - ], - ], - 'ListWorkerPools' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getWorkerPools', - ], - ], - ], - ], -]; diff --git a/Build/src/V1/resources/cloud_build_rest_client_config.php b/Build/src/V1/resources/cloud_build_rest_client_config.php deleted file mode 100644 index 66e7b402fee0..000000000000 --- a/Build/src/V1/resources/cloud_build_rest_client_config.php +++ /dev/null @@ -1,465 +0,0 @@ - [ - 'google.devtools.cloudbuild.v1.CloudBuild' => [ - 'ApproveBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/builds/*}:approve', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:approve', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'CancelBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds', - 'body' => 'build', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/builds', - 'body' => 'build', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateBuildTrigger' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers', - 'body' => 'trigger', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - 'body' => 'trigger', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'CreateWorkerPool' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workerPools', - 'body' => 'worker_pool', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'worker_pool_id', - ], - ], - 'DeleteBuildTrigger' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'additionalBindings' => [ - [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'DeleteWorkerPool' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workerPools/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetBuild' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'GetBuildTrigger' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'GetWorkerPool' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/workerPools/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListBuildTriggers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/triggers', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ListBuilds' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/builds', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/builds', - ], - ], - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ListWorkerPools' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/workerPools', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ReceiveTriggerWebhook' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger}:webhook', - 'body' => 'body', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}:webhook', - 'body' => 'body', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger' => [ - 'getters' => [ - 'getTrigger', - ], - ], - ], - ], - 'RetryBuild' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/builds/{id}:retry', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/builds/*}:retry', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'id' => [ - 'getters' => [ - 'getId', - ], - ], - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'RunBuildTrigger' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}:run', - 'body' => 'source', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}:run', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'UpdateBuildTrigger' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/projects/{project_id}/triggers/{trigger_id}', - 'body' => 'trigger', - 'additionalBindings' => [ - [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}', - 'body' => 'trigger', - ], - ], - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - 'trigger.resource_name' => [ - 'getters' => [ - 'getTrigger', - 'getResourceName', - ], - ], - 'trigger_id' => [ - 'getters' => [ - 'getTriggerId', - ], - ], - ], - ], - 'UpdateWorkerPool' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}', - 'body' => 'worker_pool', - 'placeholders' => [ - 'worker_pool.name' => [ - 'getters' => [ - 'getWorkerPool', - 'getName', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=operations/**}:cancel', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=operations/**}', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', - ], - ], - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], -]; diff --git a/Build/src/V2/BatchCreateRepositoriesRequest.php b/Build/src/V2/BatchCreateRepositoriesRequest.php index 256d779a83ee..e0aa32884db9 100644 --- a/Build/src/V2/BatchCreateRepositoriesRequest.php +++ b/Build/src/V2/BatchCreateRepositoriesRequest.php @@ -23,7 +23,7 @@ class BatchCreateRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The request messages specifying the repositories to create. * diff --git a/Build/src/V2/BitbucketCloudConfig.php b/Build/src/V2/BitbucketCloudConfig.php index d526163a7952..b0c857475261 100644 --- a/Build/src/V2/BitbucketCloudConfig.php +++ b/Build/src/V2/BitbucketCloudConfig.php @@ -21,14 +21,14 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string workspace = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $workspace = ''; + protected $workspace = ''; /** * Required. SecretManager resource containing the webhook secret used to * verify webhook events, formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. An access token with the `repository` access. It can be either a * workspace, project or repository access token. It's recommended to use a @@ -36,7 +36,7 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. An access token with the `webhook`, `repository`, * `repository:admin` and `pullrequest` scope access. It can be either a @@ -45,7 +45,7 @@ class BitbucketCloudConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Constructor. diff --git a/Build/src/V2/BitbucketDataCenterConfig.php b/Build/src/V2/BitbucketDataCenterConfig.php index f35711f64d18..5927ea5a1b98 100644 --- a/Build/src/V2/BitbucketDataCenterConfig.php +++ b/Build/src/V2/BitbucketDataCenterConfig.php @@ -21,7 +21,7 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. Immutable. SecretManager resource containing the webhook secret * used to verify webhook events, formatted as @@ -29,19 +29,19 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. A http access token with the `REPO_READ` access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. A http access token with the `REPO_ADMIN` scope access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Optional. Configuration for using Service Directory to privately connect to * a Bitbucket Data Center. This should only be set if the Bitbucket Data @@ -51,20 +51,20 @@ class BitbucketDataCenterConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * Optional. SSL certificate to use for requests to the Bitbucket Data Center. * * Generated from protobuf field string ssl_ca = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. Version of the Bitbucket Data Center running on the * `host_uri`. * * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/Client/RepositoryManagerClient.php b/Build/src/V2/Client/RepositoryManagerClient.php index 74d4a3da2fbf..81c5204ea7c9 100644 --- a/Build/src/V2/Client/RepositoryManagerClient.php +++ b/Build/src/V2/Client/RepositoryManagerClient.php @@ -1,6 +1,6 @@ descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; } + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + /** * Formats a string containing the fully-qualified path to represent a connection * resource. @@ -217,8 +236,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted repository resource. */ - public static function repositoryName(string $project, string $location, string $connection, string $repository): string - { + public static function repositoryName( + string $project, + string $location, + string $connection, + string $repository + ): string { return self::getPathTemplate('repository')->render([ 'project' => $project, 'location' => $location, @@ -389,8 +412,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function batchCreateRepositories(BatchCreateRepositoriesRequest $request, array $callOptions = []): OperationResponse - { + public function batchCreateRepositories( + BatchCreateRepositoriesRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('BatchCreateRepositories', $request, $callOptions)->wait(); } @@ -547,8 +572,10 @@ public function fetchGitRefs(FetchGitRefsRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function fetchLinkableRepositories(FetchLinkableRepositoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function fetchLinkableRepositories( + FetchLinkableRepositoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('FetchLinkableRepositories', $request, $callOptions); } @@ -600,8 +627,10 @@ public function fetchReadToken(FetchReadTokenRequest $request, array $callOption * * @throws ApiException Thrown if the API call fails. */ - public function fetchReadWriteToken(FetchReadWriteTokenRequest $request, array $callOptions = []): FetchReadWriteTokenResponse - { + public function fetchReadWriteToken( + FetchReadWriteTokenRequest $request, + array $callOptions = [] + ): FetchReadWriteTokenResponse { return $this->startApiCall('FetchReadWriteToken', $request, $callOptions)->wait(); } @@ -819,8 +848,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } } diff --git a/Build/src/V2/Connection.php b/Build/src/V2/Connection.php index ece4f99a1a1f..af1a1dcd99fb 100644 --- a/Build/src/V2/Connection.php +++ b/Build/src/V2/Connection.php @@ -22,25 +22,25 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Output only. Server assigned timestamp for when the connection was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Server assigned timestamp for when the connection was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Output only. Installation state of the Connection. * * Generated from protobuf field .google.devtools.cloudbuild.v2.InstallationState installation_state = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $installation_state = null; + protected $installation_state = null; /** * If disabled is set to true, functionality is disabled for this connection. * Repository based API methods and webhooks processing for repositories in @@ -48,14 +48,14 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool disabled = 13; */ - private $disabled = false; + protected $disabled = false; /** * Output only. Set to true when the connection is being set up or updated in * the background. * * Generated from protobuf field bool reconciling = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $reconciling = false; + protected $reconciling = false; /** * Allows clients to store small amounts of arbitrary data. * @@ -69,7 +69,7 @@ class Connection extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 16; */ - private $etag = ''; + protected $etag = ''; protected $connection_config; /** diff --git a/Build/src/V2/CreateConnectionRequest.php b/Build/src/V2/CreateConnectionRequest.php index baf6736e2b37..4ba96b1380b1 100644 --- a/Build/src/V2/CreateConnectionRequest.php +++ b/Build/src/V2/CreateConnectionRequest.php @@ -21,13 +21,13 @@ class CreateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The Connection to create. * * Generated from protobuf field .google.devtools.cloudbuild.v2.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection = null; + protected $connection = null; /** * Required. The ID to use for the Connection, which will become the final * component of the Connection's resource name. Names must be unique @@ -36,7 +36,7 @@ class CreateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection_id = ''; + protected $connection_id = ''; /** * @param string $parent Required. Project and location where the connection will be created. diff --git a/Build/src/V2/CreateRepositoryRequest.php b/Build/src/V2/CreateRepositoryRequest.php index 27e44315aa9b..5dbc70bca90c 100644 --- a/Build/src/V2/CreateRepositoryRequest.php +++ b/Build/src/V2/CreateRepositoryRequest.php @@ -22,13 +22,13 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Required. The repository to create. * * Generated from protobuf field .google.devtools.cloudbuild.v2.Repository repository = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository = null; + protected $repository = null; /** * Required. The ID to use for the repository, which will become the final * component of the repository's resource name. This ID should be unique in @@ -37,7 +37,7 @@ class CreateRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository_id = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $repository_id = ''; + protected $repository_id = ''; /** * @param string $parent Required. The connection to contain the repository. If the request is part diff --git a/Build/src/V2/DeleteConnectionRequest.php b/Build/src/V2/DeleteConnectionRequest.php index e054f29cf7e3..d76949b9bafc 100644 --- a/Build/src/V2/DeleteConnectionRequest.php +++ b/Build/src/V2/DeleteConnectionRequest.php @@ -21,7 +21,7 @@ class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The current etag of the connection. * If an etag is provided and does not match the current etag of the @@ -29,13 +29,13 @@ class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2; */ - private $etag = ''; + protected $etag = ''; /** * If set, validate the request, but do not actually post it. * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $name Required. The name of the Connection to delete. diff --git a/Build/src/V2/DeleteRepositoryRequest.php b/Build/src/V2/DeleteRepositoryRequest.php index 1bb8842af7c3..c12878d13cb8 100644 --- a/Build/src/V2/DeleteRepositoryRequest.php +++ b/Build/src/V2/DeleteRepositoryRequest.php @@ -21,7 +21,7 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * The current etag of the repository. * If an etag is provided and does not match the current etag of the @@ -29,13 +29,13 @@ class DeleteRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 2; */ - private $etag = ''; + protected $etag = ''; /** * If set, validate the request, but do not actually post it. * * Generated from protobuf field bool validate_only = 3; */ - private $validate_only = false; + protected $validate_only = false; /** * @param string $name Required. The name of the Repository to delete. diff --git a/Build/src/V2/FetchGitRefsRequest.php b/Build/src/V2/FetchGitRefsRequest.php index 918f9febd952..4f5bff6c029f 100644 --- a/Build/src/V2/FetchGitRefsRequest.php +++ b/Build/src/V2/FetchGitRefsRequest.php @@ -21,13 +21,13 @@ class FetchGitRefsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * Type of refs to fetch * * Generated from protobuf field .google.devtools.cloudbuild.v2.FetchGitRefsRequest.RefType ref_type = 2; */ - private $ref_type = 0; + protected $ref_type = 0; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchLinkableRepositoriesRequest.php b/Build/src/V2/FetchLinkableRepositoriesRequest.php index 1fce8d912d43..677401c74cc3 100644 --- a/Build/src/V2/FetchLinkableRepositoriesRequest.php +++ b/Build/src/V2/FetchLinkableRepositoriesRequest.php @@ -21,19 +21,19 @@ class FetchLinkableRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $connection = ''; + protected $connection = ''; /** * Number of results to return in the list. Default to 20. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * Constructor. diff --git a/Build/src/V2/FetchLinkableRepositoriesResponse.php b/Build/src/V2/FetchLinkableRepositoriesResponse.php index 67b41d3daa80..cab0cfef5019 100644 --- a/Build/src/V2/FetchLinkableRepositoriesResponse.php +++ b/Build/src/V2/FetchLinkableRepositoriesResponse.php @@ -26,7 +26,7 @@ class FetchLinkableRepositoriesResponse extends \Google\Protobuf\Internal\Messag * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/FetchReadTokenRequest.php b/Build/src/V2/FetchReadTokenRequest.php index ebd949ec1c8d..ab9057b88e0a 100644 --- a/Build/src/V2/FetchReadTokenRequest.php +++ b/Build/src/V2/FetchReadTokenRequest.php @@ -21,7 +21,7 @@ class FetchReadTokenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchReadTokenResponse.php b/Build/src/V2/FetchReadTokenResponse.php index fc8190cc7f39..3302adc79daf 100644 --- a/Build/src/V2/FetchReadTokenResponse.php +++ b/Build/src/V2/FetchReadTokenResponse.php @@ -20,13 +20,13 @@ class FetchReadTokenResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string token = 1; */ - private $token = ''; + protected $token = ''; /** * Expiration timestamp. Can be empty if unknown or non-expiring. * * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; */ - private $expiration_time = null; + protected $expiration_time = null; /** * Constructor. diff --git a/Build/src/V2/FetchReadWriteTokenRequest.php b/Build/src/V2/FetchReadWriteTokenRequest.php index 7d0ba66e6169..5c24c1711c42 100644 --- a/Build/src/V2/FetchReadWriteTokenRequest.php +++ b/Build/src/V2/FetchReadWriteTokenRequest.php @@ -21,7 +21,7 @@ class FetchReadWriteTokenRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string repository = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $repository = ''; + protected $repository = ''; /** * @param string $repository Required. The resource name of the repository in the format diff --git a/Build/src/V2/FetchReadWriteTokenResponse.php b/Build/src/V2/FetchReadWriteTokenResponse.php index 18a87ed5c448..c38b59dc84b1 100644 --- a/Build/src/V2/FetchReadWriteTokenResponse.php +++ b/Build/src/V2/FetchReadWriteTokenResponse.php @@ -20,13 +20,13 @@ class FetchReadWriteTokenResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string token = 1; */ - private $token = ''; + protected $token = ''; /** * Expiration timestamp. Can be empty if unknown or non-expiring. * * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; */ - private $expiration_time = null; + protected $expiration_time = null; /** * Constructor. diff --git a/Build/src/V2/Gapic/RepositoryManagerGapicClient.php b/Build/src/V2/Gapic/RepositoryManagerGapicClient.php deleted file mode 100644 index 7d58b5efa2c1..000000000000 --- a/Build/src/V2/Gapic/RepositoryManagerGapicClient.php +++ /dev/null @@ -1,1516 +0,0 @@ -connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $requests = []; - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $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 = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'batchCreateRepositories'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - * - * @deprecated Please use the new service client {@see \Google\Cloud\Build\V2\Client\RepositoryManagerClient}. - */ -class RepositoryManagerGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.devtools.cloudbuild.v2.RepositoryManager'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'cloudbuild.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'cloudbuild.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $connectionNameTemplate; - - private static $locationNameTemplate; - - private static $repositoryNameTemplate; - - private static $secretVersionNameTemplate; - - private static $serviceNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/repository_manager_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/repository_manager_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/repository_manager_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/repository_manager_rest_client_config.php', - ], - ], - ]; - } - - private static function getConnectionNameTemplate() - { - if (self::$connectionNameTemplate == null) { - self::$connectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}'); - } - - return self::$connectionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getRepositoryNameTemplate() - { - if (self::$repositoryNameTemplate == null) { - self::$repositoryNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}'); - } - - return self::$repositoryNameTemplate; - } - - private static function getSecretVersionNameTemplate() - { - if (self::$secretVersionNameTemplate == null) { - self::$secretVersionNameTemplate = new PathTemplate('projects/{project}/secrets/{secret}/versions/{version}'); - } - - return self::$secretVersionNameTemplate; - } - - private static function getServiceNameTemplate() - { - if (self::$serviceNameTemplate == null) { - self::$serviceNameTemplate = new PathTemplate('projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}'); - } - - return self::$serviceNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'connection' => self::getConnectionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'repository' => self::getRepositoryNameTemplate(), - 'secretVersion' => self::getSecretVersionNameTemplate(), - 'service' => self::getServiceNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a connection - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * - * @return string The formatted connection resource. - */ - public static function connectionName($project, $location, $connection) - { - return self::getConnectionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a repository - * resource. - * - * @param string $project - * @param string $location - * @param string $connection - * @param string $repository - * - * @return string The formatted repository resource. - */ - public static function repositoryName($project, $location, $connection, $repository) - { - return self::getRepositoryNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'connection' => $connection, - 'repository' => $repository, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * secret_version resource. - * - * @param string $project - * @param string $secret - * @param string $version - * - * @return string The formatted secret_version resource. - */ - public static function secretVersionName($project, $secret, $version) - { - return self::getSecretVersionNameTemplate()->render([ - 'project' => $project, - 'secret' => $secret, - 'version' => $version, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a service - * resource. - * - * @param string $project - * @param string $location - * @param string $namespace - * @param string $service - * - * @return string The formatted service resource. - */ - public static function serviceName($project, $location, $namespace, $service) - { - return self::getServiceNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'namespace' => $namespace, - 'service' => $service, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - connection: projects/{project}/locations/{location}/connections/{connection} - * - location: projects/{project}/locations/{location} - * - repository: projects/{project}/locations/{location}/connections/{connection}/repositories/{repository} - * - secretVersion: projects/{project}/secrets/{secret}/versions/{version} - * - service: projects/{project}/locations/{location}/namespaces/{namespace}/services/{service} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'cloudbuild.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates multiple repositories inside a connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $requests = []; - * $operationResponse = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $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 = $repositoryManagerClient->batchCreateRepositories($formattedParent, $requests); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'batchCreateRepositories'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The connection to contain all the repositories being created. - * Format: projects/*/locations/*/connections/* - * The parent field in the CreateRepositoryRequest messages - * must either be empty or match this field. - * @param CreateRepositoryRequest[] $requests Required. The request messages specifying the repositories to create. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function batchCreateRepositories($parent, $requests, array $optionalArgs = []) - { - $request = new BatchCreateRepositoriesRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRequests($requests); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('BatchCreateRepositories', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a Connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->locationName('[PROJECT]', '[LOCATION]'); - * $connection = new Connection(); - * $connectionId = 'connection_id'; - * $operationResponse = $repositoryManagerClient->createConnection($formattedParent, $connection, $connectionId); - * $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 = $repositoryManagerClient->createConnection($formattedParent, $connection, $connectionId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'createConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. Project and location where the connection will be created. - * Format: `projects/*/locations/*`. - * @param Connection $connection Required. The Connection to create. - * @param string $connectionId Required. The ID to use for the Connection, which will become the final - * component of the Connection's resource name. Names must be unique - * per-project per-location. Allows alphanumeric characters and any of - * -._~%!$&'()*+,;=@. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createConnection($parent, $connection, $connectionId, array $optionalArgs = []) - { - $request = new CreateConnectionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConnection($connection); - $request->setConnectionId($connectionId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Creates a Repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $repository = new Repository(); - * $repositoryId = 'repository_id'; - * $operationResponse = $repositoryManagerClient->createRepository($formattedParent, $repository, $repositoryId); - * $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 = $repositoryManagerClient->createRepository($formattedParent, $repository, $repositoryId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'createRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The connection to contain the repository. If the request is part - * of a BatchCreateRepositoriesRequest, this field should be empty or match - * the parent specified there. - * @param Repository $repository Required. The repository to create. - * @param string $repositoryId Required. The ID to use for the repository, which will become the final - * component of the repository's resource name. This ID should be unique in - * the connection. Allows alphanumeric characters and any of - * -._~%!$&'()*+,;=@. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createRepository($parent, $repository, $repositoryId, array $optionalArgs = []) - { - $request = new CreateRepositoryRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setRepository($repository); - $request->setRepositoryId($repositoryId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $operationResponse = $repositoryManagerClient->deleteConnection($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 = $repositoryManagerClient->deleteConnection($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'deleteConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Connection to delete. - * Format: `projects/*/locations/*/connections/*`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * The current etag of the connection. - * If an etag is provided and does not match the current etag of the - * connection, deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * If set, validate the request, but do not actually post it. - * @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 deleteConnection($name, array $optionalArgs = []) - { - $request = new DeleteConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - 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('DeleteConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes a single repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $operationResponse = $repositoryManagerClient->deleteRepository($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 = $repositoryManagerClient->deleteRepository($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'deleteRepository'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Repository to delete. - * Format: `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * The current etag of the repository. - * If an etag is provided and does not match the current etag of the - * repository, deletion will be blocked and an ABORTED error will be returned. - * @type bool $validateOnly - * If set, validate the request, but do not actually post it. - * @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 deleteRepository($name, array $optionalArgs = []) - { - $request = new DeleteRepositoryRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - 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('DeleteRepository', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Fetch the list of branches or tags for a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchGitRefs($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @param array $optionalArgs { - * Optional. - * - * @type int $refType - * Type of refs to fetch - * For allowed values, use constants defined on {@see \Google\Cloud\Build\V2\FetchGitRefsRequest\RefType} - * @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\Build\V2\FetchGitRefsResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchGitRefs($repository, array $optionalArgs = []) - { - $request = new FetchGitRefsRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - if (isset($optionalArgs['refType'])) { - $request->setRefType($optionalArgs['refType']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchGitRefs', FetchGitRefsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * FetchLinkableRepositories get repositories from SCM that are - * accessible and could be added to the connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedConnection = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->fetchLinkableRepositories($formattedConnection); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->fetchLinkableRepositories($formattedConnection); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $connection Required. The name of the Connection. - * Format: `projects/*/locations/*/connections/*`. - * @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 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 fetchLinkableRepositories($connection, array $optionalArgs = []) - { - $request = new FetchLinkableRepositoriesRequest(); - $requestParamHeaders = []; - $request->setConnection($connection); - $requestParamHeaders['connection'] = $connection; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('FetchLinkableRepositories', $optionalArgs, FetchLinkableRepositoriesResponse::class, $request); - } - - /** - * Fetches read token of a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchReadToken($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @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\Build\V2\FetchReadTokenResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchReadToken($repository, array $optionalArgs = []) - { - $request = new FetchReadTokenRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchReadToken', FetchReadTokenResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Fetches read/write token of a given repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedRepository = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->fetchReadWriteToken($formattedRepository); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $repository Required. The resource name of the repository in the format - * `projects/*/locations/*/connections/*/repositories/*`. - * @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\Build\V2\FetchReadWriteTokenResponse - * - * @throws ApiException if the remote call fails - */ - public function fetchReadWriteToken($repository, array $optionalArgs = []) - { - $request = new FetchReadWriteTokenRequest(); - $requestParamHeaders = []; - $request->setRepository($repository); - $requestParamHeaders['repository'] = $repository; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('FetchReadWriteToken', FetchReadWriteTokenResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $response = $repositoryManagerClient->getConnection($formattedName); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Connection to retrieve. - * Format: `projects/*/locations/*/connections/*`. - * @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\Build\V2\Connection - * - * @throws ApiException if the remote call fails - */ - public function getConnection($name, array $optionalArgs = []) - { - $request = new GetConnectionRequest(); - $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('GetConnection', Connection::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets details of a single repository. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedName = $repositoryManagerClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - * $response = $repositoryManagerClient->getRepository($formattedName); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the Repository to retrieve. - * Format: `projects/*/locations/*/connections/*/repositories/*`. - * @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\Build\V2\Repository - * - * @throws ApiException if the remote call fails - */ - public function getRepository($name, array $optionalArgs = []) - { - $request = new GetRepositoryRequest(); - $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('GetRepository', Repository::class, $optionalArgs, $request)->wait(); - } - - /** - * Lists Connections in a given project and location. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->listConnections($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->listConnections($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of Connections. - * Format: `projects/*/locations/*`. - * @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 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 listConnections($parent, array $optionalArgs = []) - { - $request = new ListConnectionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListConnections', $optionalArgs, ListConnectionsResponse::class, $request); - } - - /** - * Lists Repositories in a given connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $formattedParent = $repositoryManagerClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * // Iterate over pages of elements - * $pagedResponse = $repositoryManagerClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $repositoryManagerClient->listRepositories($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent, which owns this collection of Repositories. - * Format: `projects/*/locations/*/connections/*`. - * @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 - * A filter expression that filters resources listed in the response. - * Expressions must follow API improvement proposal - * [AIP-160](https://google.aip.dev/160). e.g. - * `remote_uri:"https://github.com*"`. - * @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 listRepositories($parent, array $optionalArgs = []) - { - $request = new ListRepositoriesRequest(); - $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']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListRepositories', $optionalArgs, ListRepositoriesResponse::class, $request); - } - - /** - * Updates a single connection. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $connection = new Connection(); - * $operationResponse = $repositoryManagerClient->updateConnection($connection); - * $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 = $repositoryManagerClient->updateConnection($connection); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $repositoryManagerClient->resumeOperation($operationName, 'updateConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param Connection $connection Required. The Connection to update. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * The list of fields to be updated. - * @type bool $allowMissing - * If set to true, and the connection is not found a new connection - * will be created. In this situation `update_mask` is ignored. - * The creation will succeed only if the input connection has all the - * necessary information (e.g a github_config with both user_oauth_token and - * installation_id properties). - * @type string $etag - * The current etag of the connection. - * If an etag is provided and does not match the current etag of the - * connection, update will be blocked and an ABORTED error will be returned. - * @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 updateConnection($connection, array $optionalArgs = []) - { - $request = new UpdateConnectionRequest(); - $requestParamHeaders = []; - $request->setConnection($connection); - $requestParamHeaders['connection.name'] = $connection->getName(); - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - 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('UpdateConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets the access control policy for a resource. Returns an empty policy - if the resource exists and does not have a policy set. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $response = $repositoryManagerClient->getIamPolicy($resource); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being requested. - * See the operation documentation for the appropriate value for this field. - * @param array $optionalArgs { - * Optional. - * - * @type GetPolicyOptions $options - * OPTIONAL: A `GetPolicyOptions` object for specifying options to - * `GetIamPolicy`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function getIamPolicy($resource, array $optionalArgs = []) - { - $request = new GetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['options'])) { - $request->setOptions($optionalArgs['options']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Sets the access control policy on the specified resource. Replaces - any existing policy. - - Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` - errors. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $repositoryManagerClient->setIamPolicy($resource, $policy); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy is being specified. - * See the operation documentation for the appropriate value for this field. - * @param Policy $policy REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a - * valid policy but certain Cloud Platform services (such as Projects) - * might reject them. - * @param array $optionalArgs { - * Optional. - * - * @type FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } - - /** - * Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of - permissions, not a `NOT_FOUND` error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - * - * Sample code: - * ``` - * $repositoryManagerClient = new RepositoryManagerClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $repositoryManagerClient->testIamPermissions($resource, $permissions); - * } finally { - * $repositoryManagerClient->close(); - * } - * ``` - * - * @param string $resource REQUIRED: The resource for which the policy detail is being requested. - * See the operation documentation for the appropriate value for this field. - * @param string[] $permissions The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For more - * information see - * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - public function testIamPermissions($resource, $permissions, array $optionalArgs = []) - { - $request = new TestIamPermissionsRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPermissions($permissions); - $requestParamHeaders['resource'] = $resource; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('TestIamPermissions', TestIamPermissionsResponse::class, $optionalArgs, $request, Call::UNARY_CALL, 'google.iam.v1.IAMPolicy')->wait(); - } -} diff --git a/Build/src/V2/GetConnectionRequest.php b/Build/src/V2/GetConnectionRequest.php index 9f3a2ecfe864..a5fb8449f96a 100644 --- a/Build/src/V2/GetConnectionRequest.php +++ b/Build/src/V2/GetConnectionRequest.php @@ -21,7 +21,7 @@ class GetConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Connection to retrieve. diff --git a/Build/src/V2/GetRepositoryRequest.php b/Build/src/V2/GetRepositoryRequest.php index 9775609531fa..2b71cd243f1f 100644 --- a/Build/src/V2/GetRepositoryRequest.php +++ b/Build/src/V2/GetRepositoryRequest.php @@ -21,7 +21,7 @@ class GetRepositoryRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $name = ''; + protected $name = ''; /** * @param string $name Required. The name of the Repository to retrieve. diff --git a/Build/src/V2/GitHubConfig.php b/Build/src/V2/GitHubConfig.php index ceaf4c2599bb..d1435a9df8ea 100644 --- a/Build/src/V2/GitHubConfig.php +++ b/Build/src/V2/GitHubConfig.php @@ -22,13 +22,13 @@ class GitHubConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.OAuthCredential authorizer_credential = 1; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * GitHub App installation id. * * Generated from protobuf field int64 app_installation_id = 2; */ - private $app_installation_id = 0; + protected $app_installation_id = 0; /** * Constructor. diff --git a/Build/src/V2/GitHubEnterpriseConfig.php b/Build/src/V2/GitHubEnterpriseConfig.php index 27124ed5cc1a..333e58603534 100644 --- a/Build/src/V2/GitHubEnterpriseConfig.php +++ b/Build/src/V2/GitHubEnterpriseConfig.php @@ -20,45 +20,45 @@ class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. API Key used for authentication of webhook events. * * Generated from protobuf field string api_key = 12 [(.google.api.field_behavior) = REQUIRED]; */ - private $api_key = ''; + protected $api_key = ''; /** * Id of the GitHub App created from the manifest. * * Generated from protobuf field int64 app_id = 2; */ - private $app_id = 0; + protected $app_id = 0; /** * The URL-friendly name of the GitHub App. * * Generated from protobuf field string app_slug = 13; */ - private $app_slug = ''; + protected $app_slug = ''; /** * SecretManager resource containing the private key of the GitHub App, * formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string private_key_secret_version = 4 [(.google.api.resource_reference) = { */ - private $private_key_secret_version = ''; + protected $private_key_secret_version = ''; /** * SecretManager resource containing the webhook secret of the GitHub App, * formatted as `projects/*/secrets/*/versions/*`. * * Generated from protobuf field string webhook_secret_secret_version = 5 [(.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * ID of the installation of the GitHub App. * * Generated from protobuf field int64 app_installation_id = 9; */ - private $app_installation_id = 0; + protected $app_installation_id = 0; /** * Configuration for using Service Directory to privately connect to a GitHub * Enterprise server. This should only be set if the GitHub Enterprise server @@ -68,19 +68,19 @@ class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 10; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * SSL certificate to use for requests to GitHub Enterprise. * * Generated from protobuf field string ssl_ca = 11; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. GitHub Enterprise version installed at the host_uri. * * Generated from protobuf field string server_version = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/GitLabConfig.php b/Build/src/V2/GitLabConfig.php index 15ebcfc89562..078b133eccbc 100644 --- a/Build/src/V2/GitLabConfig.php +++ b/Build/src/V2/GitLabConfig.php @@ -22,7 +22,7 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string host_uri = 1; */ - private $host_uri = ''; + protected $host_uri = ''; /** * Required. Immutable. SecretManager resource containing the webhook secret * of a GitLab Enterprise project, formatted as @@ -30,20 +30,20 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { */ - private $webhook_secret_secret_version = ''; + protected $webhook_secret_secret_version = ''; /** * Required. A GitLab personal access token with the minimum `read_api` scope * access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; */ - private $read_authorizer_credential = null; + protected $read_authorizer_credential = null; /** * Required. A GitLab personal access token with the `api` scope access. * * Generated from protobuf field .google.devtools.cloudbuild.v2.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; */ - private $authorizer_credential = null; + protected $authorizer_credential = null; /** * Configuration for using Service Directory to privately connect to a GitLab * Enterprise server. This should only be set if the GitLab Enterprise server @@ -53,20 +53,20 @@ class GitLabConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.ServiceDirectoryConfig service_directory_config = 5; */ - private $service_directory_config = null; + protected $service_directory_config = null; /** * SSL certificate to use for requests to GitLab Enterprise. * * Generated from protobuf field string ssl_ca = 6; */ - private $ssl_ca = ''; + protected $ssl_ca = ''; /** * Output only. Version of the GitLab Enterprise server running on the * `host_uri`. * * Generated from protobuf field string server_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $server_version = ''; + protected $server_version = ''; /** * Constructor. diff --git a/Build/src/V2/InstallationState.php b/Build/src/V2/InstallationState.php index d0754dabd95b..b1ae1f2c68e8 100644 --- a/Build/src/V2/InstallationState.php +++ b/Build/src/V2/InstallationState.php @@ -22,21 +22,21 @@ class InstallationState extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $stage = 0; + protected $stage = 0; /** * Output only. Message of what the user should do next to continue the * installation. Empty string if the installation is already complete. * * Generated from protobuf field string message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $message = ''; + protected $message = ''; /** * Output only. Link to follow for next action. Empty string if the * installation is already complete. * * Generated from protobuf field string action_uri = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $action_uri = ''; + protected $action_uri = ''; /** * Constructor. diff --git a/Build/src/V2/ListConnectionsRequest.php b/Build/src/V2/ListConnectionsRequest.php index d768d13cf5b9..d074735f716d 100644 --- a/Build/src/V2/ListConnectionsRequest.php +++ b/Build/src/V2/ListConnectionsRequest.php @@ -21,19 +21,19 @@ class ListConnectionsRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Number of results to return in the list. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * @param string $parent Required. The parent, which owns this collection of Connections. diff --git a/Build/src/V2/ListConnectionsResponse.php b/Build/src/V2/ListConnectionsResponse.php index dbcd4275d0be..9d9a916d3a00 100644 --- a/Build/src/V2/ListConnectionsResponse.php +++ b/Build/src/V2/ListConnectionsResponse.php @@ -26,7 +26,7 @@ class ListConnectionsResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/ListRepositoriesRequest.php b/Build/src/V2/ListRepositoriesRequest.php index 61d2d1b2b0a3..b348f630d745 100644 --- a/Build/src/V2/ListRepositoriesRequest.php +++ b/Build/src/V2/ListRepositoriesRequest.php @@ -21,19 +21,19 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * Number of results to return in the list. * * Generated from protobuf field int32 page_size = 2; */ - private $page_size = 0; + protected $page_size = 0; /** * Page start. * * Generated from protobuf field string page_token = 3; */ - private $page_token = ''; + protected $page_token = ''; /** * A filter expression that filters resources listed in the response. * Expressions must follow API improvement proposal @@ -42,7 +42,7 @@ class ListRepositoriesRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string filter = 4; */ - private $filter = ''; + protected $filter = ''; /** * @param string $parent Required. The parent, which owns this collection of Repositories. diff --git a/Build/src/V2/ListRepositoriesResponse.php b/Build/src/V2/ListRepositoriesResponse.php index 069a03c900ef..54490f450841 100644 --- a/Build/src/V2/ListRepositoriesResponse.php +++ b/Build/src/V2/ListRepositoriesResponse.php @@ -26,7 +26,7 @@ class ListRepositoriesResponse extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string next_page_token = 2; */ - private $next_page_token = ''; + protected $next_page_token = ''; /** * Constructor. diff --git a/Build/src/V2/OAuthCredential.php b/Build/src/V2/OAuthCredential.php index aebdcc892fa1..02ae959dbbb1 100644 --- a/Build/src/V2/OAuthCredential.php +++ b/Build/src/V2/OAuthCredential.php @@ -22,13 +22,13 @@ class OAuthCredential extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.resource_reference) = { */ - private $oauth_token_secret_version = ''; + protected $oauth_token_secret_version = ''; /** * Output only. The username associated to this token. * * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $username = ''; + protected $username = ''; /** * Constructor. diff --git a/Build/src/V2/OperationMetadata.php b/Build/src/V2/OperationMetadata.php index 7e57729c84e5..42a4e11540ab 100644 --- a/Build/src/V2/OperationMetadata.php +++ b/Build/src/V2/OperationMetadata.php @@ -20,31 +20,31 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Human-readable status of the operation, if any. * * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $status_message = ''; + protected $status_message = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -54,13 +54,13 @@ class OperationMetadata extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Constructor. diff --git a/Build/src/V2/ProcessWebhookRequest.php b/Build/src/V2/ProcessWebhookRequest.php index f261ce1eb267..cf013c817200 100644 --- a/Build/src/V2/ProcessWebhookRequest.php +++ b/Build/src/V2/ProcessWebhookRequest.php @@ -21,20 +21,20 @@ class ProcessWebhookRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $parent = ''; + protected $parent = ''; /** * HTTP request body. * * Generated from protobuf field .google.api.HttpBody body = 2; */ - private $body = null; + protected $body = null; /** * Arbitrary additional key to find the maching repository for a webhook event * if needed. * * Generated from protobuf field string webhook_key = 3; */ - private $webhook_key = ''; + protected $webhook_key = ''; /** * Constructor. diff --git a/Build/src/V2/Repository.php b/Build/src/V2/Repository.php index d85a44b1b761..6099cdddc399 100644 --- a/Build/src/V2/Repository.php +++ b/Build/src/V2/Repository.php @@ -21,25 +21,25 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IMMUTABLE]; */ - private $name = ''; + protected $name = ''; /** * Required. Git Clone HTTPS URI. * * Generated from protobuf field string remote_uri = 2 [(.google.api.field_behavior) = REQUIRED]; */ - private $remote_uri = ''; + protected $remote_uri = ''; /** * Output only. Server assigned timestamp for when the connection was created. * * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. Server assigned timestamp for when the connection was updated. * * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $update_time = null; + protected $update_time = null; /** * Allows clients to store small amounts of arbitrary data. * @@ -53,13 +53,13 @@ class Repository extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 7; */ - private $etag = ''; + protected $etag = ''; /** * Output only. External ID of the webhook created for the repository. * * Generated from protobuf field string webhook_id = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $webhook_id = ''; + protected $webhook_id = ''; /** * Constructor. diff --git a/Build/src/V2/RepositoryManagerClient.php b/Build/src/V2/RepositoryManagerClient.php deleted file mode 100644 index cbbd8a468d36..000000000000 --- a/Build/src/V2/RepositoryManagerClient.php +++ /dev/null @@ -1,34 +0,0 @@ -.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $create_time = null; + protected $create_time = null; /** * Output only. The time the operation finished running. * * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $end_time = null; + protected $end_time = null; /** * Output only. Name of the verb executed by the operation. * * Generated from protobuf field string verb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $verb = ''; + protected $verb = ''; /** * Output only. Identifies whether the user has requested cancellation * of the operation. Operations that have successfully been cancelled @@ -42,25 +42,25 @@ class RunWorkflowCustomOperationMetadata extends \Google\Protobuf\Internal\Messa * * Generated from protobuf field bool requested_cancellation = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $requested_cancellation = false; + protected $requested_cancellation = false; /** * Output only. API version used to start the operation. * * Generated from protobuf field string api_version = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $api_version = ''; + protected $api_version = ''; /** * Output only. Server-defined resource path for the target of the operation. * * Generated from protobuf field string target = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $target = ''; + protected $target = ''; /** * Output only. ID of the pipeline run created by RunWorkflow. * * Generated from protobuf field string pipeline_run_id = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $pipeline_run_id = ''; + protected $pipeline_run_id = ''; /** * Constructor. diff --git a/Build/src/V2/ServiceDirectoryConfig.php b/Build/src/V2/ServiceDirectoryConfig.php index 7a177ccd6632..319cc1be7884 100644 --- a/Build/src/V2/ServiceDirectoryConfig.php +++ b/Build/src/V2/ServiceDirectoryConfig.php @@ -23,7 +23,7 @@ class ServiceDirectoryConfig extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $service = ''; + protected $service = ''; /** * Constructor. diff --git a/Build/src/V2/UpdateConnectionRequest.php b/Build/src/V2/UpdateConnectionRequest.php index 40ee2ccbd838..9249d61cca33 100644 --- a/Build/src/V2/UpdateConnectionRequest.php +++ b/Build/src/V2/UpdateConnectionRequest.php @@ -20,13 +20,13 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.devtools.cloudbuild.v2.Connection connection = 1 [(.google.api.field_behavior) = REQUIRED]; */ - private $connection = null; + protected $connection = null; /** * The list of fields to be updated. * * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; */ - private $update_mask = null; + protected $update_mask = null; /** * If set to true, and the connection is not found a new connection * will be created. In this situation `update_mask` is ignored. @@ -36,7 +36,7 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field bool allow_missing = 3; */ - private $allow_missing = false; + protected $allow_missing = false; /** * The current etag of the connection. * If an etag is provided and does not match the current etag of the @@ -44,7 +44,7 @@ class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string etag = 4; */ - private $etag = ''; + protected $etag = ''; /** * @param \Google\Cloud\Build\V2\Connection $connection Required. The Connection to update. diff --git a/Build/src/V2/UserCredential.php b/Build/src/V2/UserCredential.php index 3ad6bc625158..c19841970419 100644 --- a/Build/src/V2/UserCredential.php +++ b/Build/src/V2/UserCredential.php @@ -23,13 +23,13 @@ class UserCredential extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ - private $user_token_secret_version = ''; + protected $user_token_secret_version = ''; /** * Output only. The username associated to this token. * * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - private $username = ''; + protected $username = ''; /** * Constructor. diff --git a/Build/tests/Unit/V1/CloudBuildClientTest.php b/Build/tests/Unit/V1/CloudBuildClientTest.php deleted file mode 100644 index 9e662952ff00..000000000000 --- a/Build/tests/Unit/V1/CloudBuildClientTest.php +++ /dev/null @@ -1,1768 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return CloudBuildClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new CloudBuildClient($options); - } - - /** @test */ - public function approveBuildTest() - { - $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/approveBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $projectId = 'projectId-1969970175'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/approveBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $name = 'name3373707'; - $response = $gapicClient->approveBuild($name); - $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.devtools.cloudbuild.v1.CloudBuild/ApproveBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($name, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/approveBuildTest'); - $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 approveBuildExceptionTest() - { - $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/approveBuildTest'); - $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 - $name = 'name3373707'; - $response = $gapicClient->approveBuild($name); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/approveBuildTest'); - 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 cancelBuildTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->cancelBuild($projectId, $id); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CancelBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function cancelBuildExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - try { - $gapicClient->cancelBuild($projectId, $id); - // 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 createBuildTest() - { - $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/createBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $build = new Build(); - $response = $gapicClient->createBuild($projectId, $build); - $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.devtools.cloudbuild.v1.CloudBuild/CreateBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getBuild(); - $this->assertProtobufEquals($build, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBuildTest'); - $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 createBuildExceptionTest() - { - $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/createBuildTest'); - $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 - $projectId = 'projectId-1969970175'; - $build = new Build(); - $response = $gapicClient->createBuild($projectId, $build); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createBuildTest'); - 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 createBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name = 'name3373707'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $trigger = new BuildTrigger(); - $response = $gapicClient->createBuildTrigger($projectId, $trigger); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/CreateBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTrigger(); - $this->assertProtobufEquals($trigger, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function createBuildTriggerExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $trigger = new BuildTrigger(); - try { - $gapicClient->createBuildTrigger($projectId, $trigger); - // 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 createWorkerPoolTest() - { - $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/createWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workerPool = new WorkerPool(); - $workerPoolId = 'workerPoolId-300928931'; - $response = $gapicClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - $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.devtools.cloudbuild.v1.CloudBuild/CreateWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getWorkerPool(); - $this->assertProtobufEquals($workerPool, $actualValue); - $actualValue = $actualApiRequestObject->getWorkerPoolId(); - $this->assertProtobufEquals($workerPoolId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkerPoolTest'); - $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 createWorkerPoolExceptionTest() - { - $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/createWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $workerPool = new WorkerPool(); - $workerPoolId = 'workerPoolId-300928931'; - $response = $gapicClient->createWorkerPool($formattedParent, $workerPool, $workerPoolId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createWorkerPoolTest'); - 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 deleteBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $gapicClient->deleteBuildTrigger($projectId, $triggerId); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/DeleteBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function deleteBuildTriggerExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - try { - $gapicClient->deleteBuildTrigger($projectId, $triggerId); - // 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 deleteWorkerPoolTest() - { - $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/deleteWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->deleteWorkerPool($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.devtools.cloudbuild.v1.CloudBuild/DeleteWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkerPoolTest'); - $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 deleteWorkerPoolExceptionTest() - { - $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/deleteWorkerPoolTest'); - $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->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->deleteWorkerPool($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteWorkerPoolTest'); - 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 getBuildTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->getBuild($projectId, $id); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetBuild', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBuildExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - try { - $gapicClient->getBuild($projectId, $id); - // 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 getBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name2 = 'name2-1052831874'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name2); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->getBuildTrigger($projectId, $triggerId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getBuildTriggerExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - try { - $gapicClient->getBuildTrigger($projectId, $triggerId); - // 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 getWorkerPoolTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name2); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - $response = $gapicClient->getWorkerPool($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/GetWorkerPool', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getWorkerPoolExceptionTest() - { - $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->workerPoolName('[PROJECT]', '[LOCATION]', '[WORKER_POOL]'); - try { - $gapicClient->getWorkerPool($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 listBuildTriggersTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $triggersElement = new BuildTrigger(); - $triggers = [ - $triggersElement, - ]; - $expectedResponse = new ListBuildTriggersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTriggers($triggers); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->listBuildTriggers($projectId); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTriggers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListBuildTriggers', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildTriggersExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - try { - $gapicClient->listBuildTriggers($projectId); - // 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 listBuildsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $buildsElement = new Build(); - $builds = [ - $buildsElement, - ]; - $expectedResponse = new ListBuildsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setBuilds($builds); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->listBuilds($projectId); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getBuilds()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListBuilds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listBuildsExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - try { - $gapicClient->listBuilds($projectId); - // 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 listWorkerPoolsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $workerPoolsElement = new WorkerPool(); - $workerPools = [ - $workerPoolsElement, - ]; - $expectedResponse = new ListWorkerPoolsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setWorkerPools($workerPools); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listWorkerPools($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getWorkerPools()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ListWorkerPools', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listWorkerPoolsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listWorkerPools($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 receiveTriggerWebhookTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReceiveTriggerWebhookResponse(); - $transport->addResponse($expectedResponse); - $response = $gapicClient->receiveTriggerWebhook(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/ReceiveTriggerWebhook', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function receiveTriggerWebhookExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - try { - $gapicClient->receiveTriggerWebhook(); - // 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 retryBuildTest() - { - $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/retryBuildTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id2 = 'id23227150'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id2); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/retryBuildTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->retryBuild($projectId, $id); - $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.devtools.cloudbuild.v1.CloudBuild/RetryBuild', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getId(); - $this->assertProtobufEquals($id, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/retryBuildTest'); - $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 retryBuildExceptionTest() - { - $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/retryBuildTest'); - $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 - $projectId = 'projectId-1969970175'; - $id = 'id3355'; - $response = $gapicClient->retryBuild($projectId, $id); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/retryBuildTest'); - 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 runBuildTriggerTest() - { - $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/runBuildTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $id = 'id3355'; - $projectId2 = 'projectId2939242356'; - $statusDetail = 'statusDetail2089931070'; - $logsBucket = 'logsBucket1565363834'; - $buildTriggerId = 'buildTriggerId1105559411'; - $logUrl = 'logUrl342054388'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new Build(); - $expectedResponse->setName($name2); - $expectedResponse->setId($id); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setStatusDetail($statusDetail); - $expectedResponse->setLogsBucket($logsBucket); - $expectedResponse->setBuildTriggerId($buildTriggerId); - $expectedResponse->setLogUrl($logUrl); - $expectedResponse->setServiceAccount($serviceAccount); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/runBuildTriggerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->runBuildTrigger($projectId, $triggerId); - $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.devtools.cloudbuild.v1.CloudBuild/RunBuildTrigger', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runBuildTriggerTest'); - $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 runBuildTriggerExceptionTest() - { - $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/runBuildTriggerTest'); - $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 - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $response = $gapicClient->runBuildTrigger($projectId, $triggerId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/runBuildTriggerTest'); - 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 updateBuildTriggerTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $resourceName = 'resourceName979421212'; - $id = 'id3355'; - $description = 'description-1724546052'; - $name = 'name3373707'; - $autodetect = true; - $disabled = true; - $filter = 'filter-1274492040'; - $serviceAccount = 'serviceAccount-1948028253'; - $expectedResponse = new BuildTrigger(); - $expectedResponse->setResourceName($resourceName); - $expectedResponse->setId($id); - $expectedResponse->setDescription($description); - $expectedResponse->setName($name); - $expectedResponse->setAutodetect($autodetect); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setFilter($filter); - $expectedResponse->setServiceAccount($serviceAccount); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $trigger = new BuildTrigger(); - $response = $gapicClient->updateBuildTrigger($projectId, $triggerId, $trigger); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v1.CloudBuild/UpdateBuildTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $actualValue = $actualRequestObject->getTrigger(); - $this->assertProtobufEquals($trigger, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function updateBuildTriggerExceptionTest() - { - $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 - $projectId = 'projectId-1969970175'; - $triggerId = 'triggerId1363517698'; - $trigger = new BuildTrigger(); - try { - $gapicClient->updateBuildTrigger($projectId, $triggerId, $trigger); - // 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 updateWorkerPoolTest() - { - $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/updateWorkerPoolTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $displayName = 'displayName1615086568'; - $uid = 'uid115792'; - $etag = 'etag3123477'; - $expectedResponse = new WorkerPool(); - $expectedResponse->setName($name); - $expectedResponse->setDisplayName($displayName); - $expectedResponse->setUid($uid); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateWorkerPoolTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $workerPool = new WorkerPool(); - $response = $gapicClient->updateWorkerPool($workerPool); - $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.devtools.cloudbuild.v1.CloudBuild/UpdateWorkerPool', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getWorkerPool(); - $this->assertProtobufEquals($workerPool, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkerPoolTest'); - $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 updateWorkerPoolExceptionTest() - { - $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/updateWorkerPoolTest'); - $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 - $workerPool = new WorkerPool(); - $response = $gapicClient->updateWorkerPool($workerPool); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateWorkerPoolTest'); - 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()); - } -} diff --git a/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php b/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php index 7a961ee47ae1..3c52394f96be 100644 --- a/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php +++ b/Build/tests/Unit/V2/Client/RepositoryManagerClientTest.php @@ -1,6 +1,6 @@ getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return RepositoryManagerClient */ @@ -123,9 +125,7 @@ public function batchCreateRepositoriesTest() // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositories($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -135,7 +135,10 @@ public function batchCreateRepositoriesTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getRequests(); @@ -183,19 +186,20 @@ public function batchCreateRepositoriesExceptionTest() $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); + $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositories($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -322,12 +326,15 @@ public function createConnectionExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -465,12 +472,15 @@ public function createRepositoryExceptionTest() $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); + $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); @@ -535,8 +545,7 @@ public function deleteConnectionTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new DeleteConnectionRequest()) - ->setName($formattedName); + $request = (new DeleteConnectionRequest())->setName($formattedName); $response = $gapicClient->deleteConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -592,17 +601,19 @@ public function deleteConnectionExceptionTest() $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); + $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new DeleteConnectionRequest()) - ->setName($formattedName); + $request = (new DeleteConnectionRequest())->setName($formattedName); $response = $gapicClient->deleteConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -656,8 +667,7 @@ public function deleteRepositoryTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -713,17 +723,19 @@ public function deleteRepositoryExceptionTest() $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); + $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->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new DeleteRepositoryRequest()) - ->setName($formattedName); + $request = (new DeleteRepositoryRequest())->setName($formattedName); $response = $gapicClient->deleteRepository($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -759,8 +771,7 @@ public function fetchGitRefsTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchGitRefsRequest()) - ->setRepository($formattedRepository); + $request = (new FetchGitRefsRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchGitRefs($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -784,17 +795,19 @@ public function fetchGitRefsExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchGitRefsRequest()) - ->setRepository($formattedRepository); + $request = (new FetchGitRefsRequest())->setRepository($formattedRepository); try { $gapicClient->fetchGitRefs($request); // If the $gapicClient method call did not throw, fail the test @@ -819,17 +832,14 @@ public function fetchLinkableRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new FetchLinkableRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new FetchLinkableRepositoriesRequest()) - ->setConnection($formattedConnection); + $request = (new FetchLinkableRepositoriesRequest())->setConnection($formattedConnection); $response = $gapicClient->fetchLinkableRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -839,7 +849,10 @@ public function fetchLinkableRepositoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', $actualFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getConnection(); $this->assertProtobufEquals($formattedConnection, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -856,17 +869,19 @@ public function fetchLinkableRepositoriesExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new FetchLinkableRepositoriesRequest()) - ->setConnection($formattedConnection); + $request = (new FetchLinkableRepositoriesRequest())->setConnection($formattedConnection); try { $gapicClient->fetchLinkableRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -895,8 +910,7 @@ public function fetchReadTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadTokenRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchReadToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -920,17 +934,19 @@ public function fetchReadTokenExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadTokenRequest())->setRepository($formattedRepository); try { $gapicClient->fetchReadToken($request); // If the $gapicClient method call did not throw, fail the test @@ -959,8 +975,7 @@ public function fetchReadWriteTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadWriteTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadWriteTokenRequest())->setRepository($formattedRepository); $response = $gapicClient->fetchReadWriteToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -984,17 +999,19 @@ public function fetchReadWriteTokenExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new FetchReadWriteTokenRequest()) - ->setRepository($formattedRepository); + $request = (new FetchReadWriteTokenRequest())->setRepository($formattedRepository); try { $gapicClient->fetchReadWriteToken($request); // If the $gapicClient method call did not throw, fail the test @@ -1029,8 +1046,7 @@ public function getConnectionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new GetConnectionRequest()) - ->setName($formattedName); + $request = (new GetConnectionRequest())->setName($formattedName); $response = $gapicClient->getConnection($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1054,17 +1070,19 @@ public function getConnectionExceptionTest() $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); + $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new GetConnectionRequest()) - ->setName($formattedName); + $request = (new GetConnectionRequest())->setName($formattedName); try { $gapicClient->getConnection($request); // If the $gapicClient method call did not throw, fail the test @@ -1099,8 +1117,7 @@ public function getRepositoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); $response = $gapicClient->getRepository($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1124,17 +1141,19 @@ public function getRepositoryExceptionTest() $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); + $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->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $request = (new GetRepositoryRequest()) - ->setName($formattedName); + $request = (new GetRepositoryRequest())->setName($formattedName); try { $gapicClient->getRepository($request); // If the $gapicClient method call did not throw, fail the test @@ -1159,17 +1178,14 @@ public function listConnectionsTest() // Mock response $nextPageToken = ''; $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; + $connections = [$connectionsElement]; $expectedResponse = new ListConnectionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setConnections($connections); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConnectionsRequest()) - ->setParent($formattedParent); + $request = (new ListConnectionsRequest())->setParent($formattedParent); $response = $gapicClient->listConnections($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1196,17 +1212,19 @@ public function listConnectionsExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListConnectionsRequest()) - ->setParent($formattedParent); + $request = (new ListConnectionsRequest())->setParent($formattedParent); try { $gapicClient->listConnections($request); // If the $gapicClient method call did not throw, fail the test @@ -1231,17 +1249,14 @@ public function listRepositoriesTest() // Mock response $nextPageToken = ''; $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; + $repositories = [$repositoriesElement]; $expectedResponse = new ListRepositoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRepositories($repositories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRepositories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1268,17 +1283,19 @@ public function listRepositoriesExceptionTest() $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); + $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $request = (new ListRepositoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRepositoriesRequest())->setParent($formattedParent); try { $gapicClient->listRepositories($request); // If the $gapicClient method call did not throw, fail the test @@ -1331,8 +1348,7 @@ public function updateConnectionTest() $operationsTransport->addResponse($completeOperation); // Mock request $connection = new Connection(); - $request = (new UpdateConnectionRequest()) - ->setConnection($connection); + $request = (new UpdateConnectionRequest())->setConnection($connection); $response = $gapicClient->updateConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1388,17 +1404,19 @@ public function updateConnectionExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $connection = new Connection(); - $request = (new UpdateConnectionRequest()) - ->setConnection($connection); + $request = (new UpdateConnectionRequest())->setConnection($connection); $response = $gapicClient->updateConnection($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1438,8 +1456,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1463,17 +1480,19 @@ public function getIamPolicyExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1505,9 +1524,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1533,19 +1550,20 @@ public function setIamPolicyExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1573,9 +1591,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1601,19 +1617,20 @@ public function testIamPermissionsExceptionTest() $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); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -1659,9 +1676,7 @@ public function batchCreateRepositoriesAsyncTest() // Mock request $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $requests = []; - $request = (new BatchCreateRepositoriesRequest()) - ->setParent($formattedParent) - ->setRequests($requests); + $request = (new BatchCreateRepositoriesRequest())->setParent($formattedParent)->setRequests($requests); $response = $gapicClient->batchCreateRepositoriesAsync($request)->wait(); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -1671,7 +1686,10 @@ public function batchCreateRepositoriesAsyncTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); + $this->assertSame( + '/google.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', + $actualApiFuncCall + ); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualApiRequestObject->getRequests(); diff --git a/Build/tests/Unit/V2/RepositoryManagerClientTest.php b/Build/tests/Unit/V2/RepositoryManagerClientTest.php deleted file mode 100644 index 0cec252fb6b8..000000000000 --- a/Build/tests/Unit/V2/RepositoryManagerClientTest.php +++ /dev/null @@ -1,1530 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return RepositoryManagerClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new RepositoryManagerClient($options); - } - - /** @test */ - public function batchCreateRepositoriesTest() - { - $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/batchCreateRepositoriesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new BatchCreateRepositoriesResponse(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/batchCreateRepositoriesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $requests = []; - $response = $gapicClient->batchCreateRepositories($formattedParent, $requests); - $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.devtools.cloudbuild.v2.RepositoryManager/BatchCreateRepositories', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRequests(); - $this->assertProtobufEquals($requests, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateRepositoriesTest'); - $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 batchCreateRepositoriesExceptionTest() - { - $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/batchCreateRepositoriesTest'); - $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $requests = []; - $response = $gapicClient->batchCreateRepositories($formattedParent, $requests); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/batchCreateRepositoriesTest'); - 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 createConnectionTest() - { - $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/createConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $disabled = true; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $connectionId = 'connectionId-513204708'; - $response = $gapicClient->createConnection($formattedParent, $connection, $connectionId); - $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.devtools.cloudbuild.v2.RepositoryManager/CreateConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getConnection(); - $this->assertProtobufEquals($connection, $actualValue); - $actualValue = $actualApiRequestObject->getConnectionId(); - $this->assertProtobufEquals($connectionId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConnectionTest'); - $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 createConnectionExceptionTest() - { - $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/createConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $operationsTransport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $connectionId = 'connectionId-513204708'; - $response = $gapicClient->createConnection($formattedParent, $connection, $connectionId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createConnectionTest'); - 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 createRepositoryTest() - { - $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/createRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $remoteUri = 'remoteUri1041652211'; - $etag = 'etag3123477'; - $webhookId = 'webhookId311874531'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name); - $expectedResponse->setRemoteUri($remoteUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setWebhookId($webhookId); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $repository = new Repository(); - $repositoryRemoteUri = 'repositoryRemoteUri792690460'; - $repository->setRemoteUri($repositoryRemoteUri); - $repositoryId = 'repositoryId1101683248'; - $response = $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - $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.devtools.cloudbuild.v2.RepositoryManager/CreateRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getRepository(); - $this->assertProtobufEquals($repository, $actualValue); - $actualValue = $actualApiRequestObject->getRepositoryId(); - $this->assertProtobufEquals($repositoryId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - $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 createRepositoryExceptionTest() - { - $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/createRepositoryTest'); - $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $repository = new Repository(); - $repositoryRemoteUri = 'repositoryRemoteUri792690460'; - $repository->setRemoteUri($repositoryRemoteUri); - $repositoryId = 'repositoryId1101683248'; - $response = $gapicClient->createRepository($formattedParent, $repository, $repositoryId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createRepositoryTest'); - 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 deleteConnectionTest() - { - $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/deleteConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->deleteConnection($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.devtools.cloudbuild.v2.RepositoryManager/DeleteConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); - $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 deleteConnectionExceptionTest() - { - $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/deleteConnectionTest'); - $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->deleteConnection($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteConnectionTest'); - 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 deleteRepositoryTest() - { - $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/deleteRepositoryTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteRepositoryTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($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.devtools.cloudbuild.v2.RepositoryManager/DeleteRepository', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - $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 deleteRepositoryExceptionTest() - { - $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/deleteRepositoryTest'); - $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->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->deleteRepository($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteRepositoryTest'); - 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 fetchGitRefsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchGitRefsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchGitRefs($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchGitRefs', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchGitRefsExceptionTest() - { - $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 - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchGitRefs($formattedRepository); - // 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 fetchLinkableRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new FetchLinkableRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->fetchLinkableRepositories($formattedConnection); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchLinkableRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getConnection(); - $this->assertProtobufEquals($formattedConnection, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchLinkableRepositoriesExceptionTest() - { - $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 - $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->fetchLinkableRepositories($formattedConnection); - // 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 fetchReadTokenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $token = 'token110541305'; - $expectedResponse = new FetchReadTokenResponse(); - $expectedResponse->setToken($token); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchReadToken($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchReadToken', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadTokenExceptionTest() - { - $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 - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchReadToken($formattedRepository); - // 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 fetchReadWriteTokenTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $token = 'token110541305'; - $expectedResponse = new FetchReadWriteTokenResponse(); - $expectedResponse->setToken($token); - $transport->addResponse($expectedResponse); - // Mock request - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->fetchReadWriteToken($formattedRepository); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/FetchReadWriteToken', $actualFuncCall); - $actualValue = $actualRequestObject->getRepository(); - $this->assertProtobufEquals($formattedRepository, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchReadWriteTokenExceptionTest() - { - $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 - $formattedRepository = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->fetchReadWriteToken($formattedRepository); - // 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 getConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $disabled = true; - $reconciling = false; - $etag = 'etag3123477'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->getConnection($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/GetConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getConnectionExceptionTest() - { - $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->getConnection($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 getRepositoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $remoteUri = 'remoteUri1041652211'; - $etag = 'etag3123477'; - $webhookId = 'webhookId311874531'; - $expectedResponse = new Repository(); - $expectedResponse->setName($name2); - $expectedResponse->setRemoteUri($remoteUri); - $expectedResponse->setEtag($etag); - $expectedResponse->setWebhookId($webhookId); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - $response = $gapicClient->getRepository($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/GetRepository', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getRepositoryExceptionTest() - { - $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->repositoryName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[REPOSITORY]'); - try { - $gapicClient->getRepository($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 listConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; - $expectedResponse = new ListConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConnections($connections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $response = $gapicClient->listConnections($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getConnections()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/ListConnections', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listConnectionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - try { - $gapicClient->listConnections($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 listRepositoriesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $repositoriesElement = new Repository(); - $repositories = [ - $repositoriesElement, - ]; - $expectedResponse = new ListRepositoriesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setRepositories($repositories); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->listRepositories($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getRepositories()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.devtools.cloudbuild.v2.RepositoryManager/ListRepositories', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listRepositoriesExceptionTest() - { - $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->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->listRepositories($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 updateConnectionTest() - { - $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/updateConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $disabled = true; - $reconciling = false; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setDisabled($disabled); - $expectedResponse->setReconciling($reconciling); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $connection = new Connection(); - $response = $gapicClient->updateConnection($connection); - $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.devtools.cloudbuild.v2.RepositoryManager/UpdateConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getConnection(); - $this->assertProtobufEquals($connection, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); - $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 updateConnectionExceptionTest() - { - $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/updateConnectionTest'); - $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 - $connection = new Connection(); - $response = $gapicClient->updateConnection($connection); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateConnectionTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.iam.v1.IAMPolicy/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}