From b621772d4736996b42bfa8789924bef488fa7c9f Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 18 Nov 2024 19:00:46 +0000 Subject: [PATCH] feat: A new resource_definition `servicedirectory.googleapis.com/Service` is added feat: A new resource_definition `cloudkms.googleapis.com/CryptoKey` is added feat: A new field `github_enterprise_config` is added to message `.google.cloud.developerconnect.v1.Connection` feat: A new field `gitlab_config` is added to message `.google.cloud.developerconnect.v1.Connection` feat: A new field `gitlab_enterprise_config` is added to message `.google.cloud.developerconnect.v1.Connection` feat: A new field `crypto_key_config` is added to message `.google.cloud.developerconnect.v1.Connection` feat: A new message `CryptoKeyConfig` is added feat: A new message `GitHubEnterpriseConfig` is added feat: A new message `ServiceDirectoryConfig` is added feat: A new message `GitLabConfig` is added feat: A new message `UserCredential` is added feat: A new message `GitLabEnterpriseConfig` is added feat: A new field `webhook_id` is added to message `.google.cloud.developerconnect.v1.GitRepositoryLink` docs: A comment for field `requested_cancellation` in message `.google.cloud.developerconnect.v1.OperationMetadata` is changed PiperOrigin-RevId: 697641705 Source-Link: https://github.com/googleapis/googleapis/commit/5708c1af08f48f00c0104b516fce856a3405299d Source-Link: https://github.com/googleapis/googleapis-gen/commit/872800ed24afd879a8acead7185c24312d95ce05 Copy-Tag: eyJwIjoiRGV2ZWxvcGVyQ29ubmVjdC8uT3dsQm90LnlhbWwiLCJoIjoiODcyODAwZWQyNGFmZDg3OWE4YWNlYWQ3MTg1YzI0MzEyZDk1Y2UwNSJ9 --- .../Developerconnect/V1/DeveloperConnect.php | Bin 0 -> 13866 bytes .../Cloud/DeveloperConnect/V1/Connection.php | 664 +++++++ .../V1/CreateConnectionRequest.php | 281 +++ .../V1/CreateGitRepositoryLinkRequest.php | 286 +++ .../DeveloperConnect/V1/CryptoKeyConfig.php | 76 + .../V1/DeleteConnectionRequest.php | 231 +++ .../V1/DeleteGitRepositoryLinkRequest.php | 231 +++ .../V1/FetchGitHubInstallationsRequest.php | 86 + .../V1/FetchGitHubInstallationsResponse.php | 71 + .../Installation.php | 138 ++ .../V1/FetchGitRefsRequest.php | 191 ++ .../V1/FetchGitRefsRequest/RefType.php | 64 + .../V1/FetchGitRefsResponse.php | 101 ++ .../FetchLinkableGitRepositoriesRequest.php | 154 ++ .../FetchLinkableGitRepositoriesResponse.php | 101 ++ .../V1/FetchReadTokenRequest.php | 86 + .../V1/FetchReadTokenResponse.php | 153 ++ .../V1/FetchReadWriteTokenRequest.php | 86 + .../V1/FetchReadWriteTokenResponse.php | 153 ++ .../V1/GetConnectionRequest.php | 81 + .../V1/GetGitRepositoryLinkRequest.php | 81 + .../DeveloperConnect/V1/GitHubConfig.php | 195 ++ .../V1/GitHubConfig/GitHubApp.php | 65 + .../V1/GitHubEnterpriseConfig.php | 411 +++++ .../DeveloperConnect/V1/GitLabConfig.php | 187 ++ .../V1/GitLabEnterpriseConfig.php | 357 ++++ .../DeveloperConnect/V1/GitRepositoryLink.php | 457 +++++ .../DeveloperConnect/V1/InstallationState.php | 145 ++ .../V1/InstallationState/Stage.php | 79 + .../V1/LinkableGitRepository.php | 68 + .../V1/ListConnectionsRequest.php | 221 +++ .../V1/ListConnectionsResponse.php | 135 ++ .../V1/ListGitRepositoryLinksRequest.php | 221 +++ .../V1/ListGitRepositoryLinksResponse.php | 135 ++ .../DeveloperConnect/V1/OAuthCredential.php | 106 ++ .../DeveloperConnect/V1/OperationMetadata.php | 311 ++++ .../V1/ServiceDirectoryConfig.php | 76 + .../V1/UpdateConnectionRequest.php | 314 ++++ .../DeveloperConnect/V1/UserCredential.php | 110 ++ .../create_connection.php | 90 + .../create_git_repository_link.php | 109 ++ .../delete_connection.php | 80 + .../delete_git_repository_link.php | 85 + .../fetch_git_hub_installations.php | 79 + .../DeveloperConnectClient/fetch_git_refs.php | 85 + .../fetch_linkable_git_repositories.php | 82 + .../fetch_read_token.php | 77 + .../fetch_read_write_token.php | 77 + .../DeveloperConnectClient/get_connection.php | 71 + .../get_git_repository_link.php | 76 + .../DeveloperConnectClient/get_location.php | 57 + .../list_connections.php | 76 + .../list_git_repository_links.php | 80 + .../DeveloperConnectClient/list_locations.php | 62 + .../update_connection.php | 74 + .../src/V1/Client/DeveloperConnectClient.php | 837 +++++++++ .../v1/src/V1/gapic_metadata.json | 98 + .../developer_connect_client_config.json | 114 ++ .../developer_connect_descriptor_config.php | 306 ++++ .../developer_connect_rest_client_config.php | 269 +++ .../V1/Client/DeveloperConnectClientTest.php | 1606 +++++++++++++++++ 61 files changed, 11398 insertions(+) create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/GPBMetadata/Google/Cloud/Developerconnect/V1/DeveloperConnect.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/Connection.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateConnectionRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateGitRepositoryLinkRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CryptoKeyConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteConnectionRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteGitRepositoryLinkRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse/Installation.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest/RefType.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetConnectionRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetGitRepositoryLinkRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig/GitHubApp.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubEnterpriseConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabEnterpriseConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitRepositoryLink.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState/Stage.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/LinkableGitRepository.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksResponse.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OAuthCredential.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OperationMetadata.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ServiceDirectoryConfig.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UpdateConnectionRequest.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UserCredential.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_connection.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_git_repository_link.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_connection.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_git_repository_link.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_refs.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_token.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_write_token.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_connection.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_git_repository_link.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_location.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_connections.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_git_repository_links.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_locations.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/update_connection.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/src/V1/Client/DeveloperConnectClient.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_client_config.json create mode 100644 owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_descriptor_config.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_rest_client_config.php create mode 100644 owl-bot-staging/DeveloperConnect/v1/tests/Unit/V1/Client/DeveloperConnectClientTest.php diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/GPBMetadata/Google/Cloud/Developerconnect/V1/DeveloperConnect.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/GPBMetadata/Google/Cloud/Developerconnect/V1/DeveloperConnect.php new file mode 100644 index 0000000000000000000000000000000000000000..5ace8341f90b1c20aebcb2e0682f6a56c890f245 GIT binary patch literal 13866 zcmcgzU2Ggz74GaNj(r^`_D$k!Hx1cNBAQs~E_P^1w@sU|y>=`d+qKszEf&N6++7b| z&kQrOPE9bXK%y-|ydd#{Kms9wK;n%Dgv0|cMFj~7BoLMm72>H6An|~zN=TghGe0{s z>z%ce<|XTyIp?19opaCM+dLpTy;0+Y?7R58IDmiTDfYw(I8f? zW^9{Ui&*(wZgx4hv|P@WW*5p&0;z4Ztr{ujnugJAkwUFywCjaB*&!{%Bv#GPby9N* zJCpu3Rb0%oMG(>}+r&02HIkcOnZ8S$O1jTy>sV>ZNZoJS4;z7xs`JTT%kw-N*fEhLoB`00%7f%rJ0Ult-zzjVv{%?zVyn~Yhqc- zPHW_@av6)oh>*8(j@2f?)pI$EIBiRRp24M%c`XgH0tF7yr-rQIQC+!y-&*T7j zY1?#mlMC#TGMw&K?5#u4mNnQgPG#GSr)3`c^oyGCN2Ol(+;0x{@Kw)YsQWyH{#-*h z54(A>*!Fq0?epPnpWm6xo)^3;rUt=*Iuzgc*-L>N4eB*&Rk)3K;6mg94V**Vd^~W| z5*{FKT^6@mzL^U&7I8C&n6nrJ+qXcdA;nEMn0Yt3eA{3y@q{b9_k`oxgg+p^GlY-` zNU-tnJQ`_g&StwxgI_~yW{&5itHV?IJeRdQe))OLxznx!E1hO^R3CCKRw8mzPEk2W`;Zfu#>hE_j?uJ{k$}_CboxDI z5PuR4*DL}_Or^HSq}Uo+7Yo-=d2jPjsx+l)n~-n>RXQ z7DoDMvdcFDQ#t!I8V+ENhfx|>bC1I#==e^h)#h$CR7~BJvQua@tVb`J;bj$M_avL3I#P}Qe9eoUsBfL^tnq63$S7%mBO1Y#e zD=VW?@cQ~%X;ocT*2{NBQ?Sq(_xXh-V7R!*2-5f@8k||ayRuj+mqwBNyA(PZ4D+zF zk%;jX(`3+|N)jxBJVf45OmlhwjPjmx9IvBumA12KSWp35D#XeW(P+nAiuy4h^}A?@OAf-~3+Vj(LRr1DK24zt z;SXk+E!`_EF0TN{Gs{a$rI|9o4`|LUtd^#gwbE!x{#P1}bAI8x0cIWCG;D{N-OC&) zd-JuDCZUCDAj*hxREE_hO&}s^z^M}fHG{Ns~ zS9EYdE4&rf80kGuiC;w*@004LVQjfPL#%1RFf@G_)?ExlL-+v(8uAQ;Rg|%bwWHOD zTGt>8KxgBHSQ?xYWwJHSVb*0Z!zvo?AQ#Xnx&U~k3nY*5EJI&H*tT10t)kY50|wnms$*;s z-L;o1I(IBE6hy-Qd;nao4RW!<#t&EW_jq`KT*NV>HDC{C;W9kKH-5ijyo$0=N7dDX zg2g9#2j+E9r88EfAh2}_LA>rd99Q`(=v3!o5b7SMNPa{H`WufpV4$QCr?&;U{U3=1 zkAih~3(|l-Jasq=9vESGr<9;pUOOPd#0L>tEAt=%c_$o#Xz?rRf?rB#d{MI<*ne(G zwMxF&h9(?OqXDx5C6FT`jM(?MpOS7I4VjQ3R2vdAOF_qZScE!-U1wp&PeKw+SPiWO z-JhREC7Rp}s}4?I-DTaSh>lQRo{z|Gn@|-JtU$};s{|U*uH<^}t?lCgCC+J`yzZz0 zL7D4{|q#qWleZg<0Jc1$Qaz%VX-@nK~)oCyPd07|be9cP)) z%wiG^620Enm;)k)Q?XzY?T3*x1~H*%sro@A&B7qe0@}9f_D#I*WR=)uG%g&J)S(`O zwolaiZ0NvrPeY474Behr$OWS4PX^E!6y~eMG;EF5kc*nWMTH1Yav&Z;|ELpIrw8^~ zXu`wuSk#Y0X!+jH=0ZGAC7}vVcz6=(NmceHJOeD2zSKLGMi7Y(dR%w%u%v^KZsVBG z#f@WT4VUJF`hm@ib2ZnVUY4$2~GCO7!kCwcGP)F zp&9mRn76<+7>>A(uENZ0Yi|NapPU+tT!S%;{G$~57|&+&Vdid9TL={%&#{K%20jD? z>*!33ykabnV3HV-ktYxc7cp#UZsS?t=t&RivXAi;5D~$JX}%-82#^lrC!N{(=n3H+ z30oqaKL9Iq(?k@SFQc&Quqcs zOOq~U?|hyo2ve+J=|kIE#V@|>DV@S-n9 zz&r?B1~qu0(Bbg3K98M$c#Vi8-$W+_11N;gu9oK1@~bQ1mo+C)8eZYR>j8uYrdO4v z8F(WjPouM);s`^7FH*(WQ6#n#hPpcR)Q_J)qqFXTB++|fC_Ybz#w<9&%qm185=Az_ zd#?y3*F?U(uZW4%SO4_SZ>J`4fgZkkz=u?~ykd7E@X~Oi<7FZKg@i^rrZo83-u~V} z;HuHrC`o>CUtyl!Avd*17pXhma8B&u|4L{yJOaWAkPOqf(qDA74jd%Odp*4Tru41? zMWH`@z|jVOU%AAAzh3hOM1h}B3o~VJ$^9Cs7??QW4?ywo>?euhVVZ=Bznw_&@qotS zgaw^GF@5h$6`51|kK~ivxkL58g6iQRP!iR{GznGTdRKvTCeG}@UScQz^6U&)tn~x_ zJi$$zTu=O~lsnQ4794zPa@+OI?&muW?jN%~y!+Q+rY7RdXPr!ed*b9b;&NxAtazKBWJxqrx zuLbj&tKm`23NM3s#n;(k;um@c1XlQTlDY1j0G?QCVa>OseI;%avS8nmn{1cI1cF3~ zJ>I{IjcA))lqT@oDRjycmG#0nK}*v~;i8hDehU){K)!YmAWgaYNC9D5Q!KudLQgOO z1i@|ivE9$n7G`9U-Ma#9Is1;IX-g4Mj= ydj&Y|L{I3!Me%E|I>0)V8&7#3d|c<>69qm$f-{@&c~s1&N9;-diO?R}L+Jk_wSgx9 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/Connection.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/Connection.php new file mode 100644 index 000000000000..7348efe72383 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/Connection.php @@ -0,0 +1,664 @@ +google.cloud.developerconnect.v1.Connection + */ +class Connection extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_state = null; + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + 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 = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $crypto_key_config = null; + protected $connection_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\DeveloperConnect\V1\GitHubConfig $github_config + * Configuration for connections to github.com. + * @type \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig $github_enterprise_config + * Configuration for connections to an instance of GitHub Enterprise. + * @type \Google\Cloud\DeveloperConnect\V1\GitLabConfig $gitlab_config + * Configuration for connections to gitlab.com. + * @type \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig $gitlab_enterprise_config + * Configuration for connections to an instance of GitLab Enterprise. + * @type string $name + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create timestamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update timestamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. [Output only] Delete timestamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels as key value pairs + * @type \Google\Cloud\DeveloperConnect\V1\InstallationState $installation_state + * Output only. Installation state of the Connection. + * @type bool $disabled + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * @type bool $reconciling + * Output only. Set to true when the connection is being set up or updated in + * the background. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Allows clients to store small amounts of arbitrary data. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type string $uid + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * @type \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig $crypto_key_config + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Configuration for connections to github.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig github_config = 5; + * @return \Google\Cloud\DeveloperConnect\V1\GitHubConfig|null + */ + public function getGithubConfig() + { + return $this->readOneof(5); + } + + public function hasGithubConfig() + { + return $this->hasOneof(5); + } + + /** + * Configuration for connections to github.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig github_config = 5; + * @param \Google\Cloud\DeveloperConnect\V1\GitHubConfig $var + * @return $this + */ + public function setGithubConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitHubConfig::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Configuration for connections to an instance of GitHub Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubEnterpriseConfig github_enterprise_config = 13; + * @return \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig|null + */ + public function getGithubEnterpriseConfig() + { + return $this->readOneof(13); + } + + public function hasGithubEnterpriseConfig() + { + return $this->hasOneof(13); + } + + /** + * Configuration for connections to an instance of GitHub Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubEnterpriseConfig github_enterprise_config = 13; + * @param \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig $var + * @return $this + */ + public function setGithubEnterpriseConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitHubEnterpriseConfig::class); + $this->writeOneof(13, $var); + + return $this; + } + + /** + * Configuration for connections to gitlab.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabConfig gitlab_config = 14; + * @return \Google\Cloud\DeveloperConnect\V1\GitLabConfig|null + */ + public function getGitlabConfig() + { + return $this->readOneof(14); + } + + public function hasGitlabConfig() + { + return $this->hasOneof(14); + } + + /** + * Configuration for connections to gitlab.com. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabConfig gitlab_config = 14; + * @param \Google\Cloud\DeveloperConnect\V1\GitLabConfig $var + * @return $this + */ + public function setGitlabConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitLabConfig::class); + $this->writeOneof(14, $var); + + return $this; + } + + /** + * Configuration for connections to an instance of GitLab Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabEnterpriseConfig gitlab_enterprise_config = 16; + * @return \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig|null + */ + public function getGitlabEnterpriseConfig() + { + return $this->readOneof(16); + } + + public function hasGitlabEnterpriseConfig() + { + return $this->hasOneof(16); + } + + /** + * Configuration for connections to an instance of GitLab Enterprise. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitLabEnterpriseConfig gitlab_enterprise_config = 16; + * @param \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig $var + * @return $this + */ + public function setGitlabEnterpriseConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitLabEnterpriseConfig::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. The resource name of the connection, in the format + * `projects/{project}/locations/{location}/connections/{connection_id}`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.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. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 11 [(.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; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\DeveloperConnect\V1\InstallationState|null + */ + public function getInstallationState() + { + return $this->installation_state; + } + + public function hasInstallationState() + { + return isset($this->installation_state); + } + + public function clearInstallationState() + { + unset($this->installation_state); + } + + /** + * Output only. Installation state of the Connection. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState installation_state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\DeveloperConnect\V1\InstallationState $var + * @return $this + */ + public function setInstallationState($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\InstallationState::class); + $this->installation_state = $var; + + return $this; + } + + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } + + /** + * Optional. If disabled is set to true, functionality is disabled for this + * connection. Repository based API methods and webhooks processing for + * repositories in this connection will be disabled. + * + * Generated from protobuf field bool disabled = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setDisabled($var) + { + GPBUtil::checkBool($var); + $this->disabled = $var; + + return $this; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 12 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig|null + */ + public function getCryptoKeyConfig() + { + return $this->crypto_key_config; + } + + public function hasCryptoKeyConfig() + { + return isset($this->crypto_key_config); + } + + public function clearCryptoKeyConfig() + { + unset($this->crypto_key_config); + } + + /** + * Optional. The crypto key configuration. This field is used by the + * Customer-Managed Encryption Keys (CMEK) feature. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.CryptoKeyConfig crypto_key_config = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig $var + * @return $this + */ + public function setCryptoKeyConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\CryptoKeyConfig::class); + $this->crypto_key_config = $var; + + return $this; + } + + /** + * @return string + */ + public function getConnectionConfig() + { + return $this->whichOneof("connection_config"); + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateConnectionRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateConnectionRequest.php new file mode 100644 index 000000000000..f83aa98c54af --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateConnectionRequest.php @@ -0,0 +1,281 @@ +google.cloud.developerconnect.v1.CreateConnectionRequest + */ +class CreateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection_id = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see DeveloperConnectClient::locationName()} for help formatting this field. + * @param \Google\Cloud\DeveloperConnect\V1\Connection $connection Required. The resource being created + * @param string $connectionId Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * @return \Google\Cloud\DeveloperConnect\V1\CreateConnectionRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DeveloperConnect\V1\Connection $connection, string $connectionId): self + { + return (new self()) + ->setParent($parent) + ->setConnection($connection) + ->setConnectionId($connectionId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type string $connection_id + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * @type \Google\Cloud\DeveloperConnect\V1\Connection $connection + * Required. The resource being created + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getConnectionId() + { + return $this->connection_id; + } + + /** + * Required. Id of the requesting object + * If auto-generating Id server-side, remove this field and + * connection_id from the method_signature of Create RPC + * + * Generated from protobuf field string connection_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->connection_id = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateGitRepositoryLinkRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..0debd2162d11 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CreateGitRepositoryLinkRequest.php @@ -0,0 +1,286 @@ +google.cloud.developerconnect.v1.CreateGitRepositoryLinkRequest + */ +class CreateGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $git_repository_link = 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 + * the connection. Allows alphanumeric characters and any of + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $git_repository_link_id = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param string $parent Required. Value for parent. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * @param \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $gitRepositoryLink Required. The resource being created + * @param string $gitRepositoryLinkId 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 + * -._~%!$&'()*+,;=@. + * + * @return \Google\Cloud\DeveloperConnect\V1\CreateGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $gitRepositoryLink, string $gitRepositoryLinkId): self + { + return (new self()) + ->setParent($parent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Value for parent. + * @type \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $git_repository_link + * Required. The resource being created + * @type string $git_repository_link_id + * 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 + * -._~%!$&'()*+,;=@. + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Value for parent. + * + * 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. Value for parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink|null + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + public function hasGitRepositoryLink() + { + return isset($this->git_repository_link); + } + + public function clearGitRepositoryLink() + { + unset($this->git_repository_link); + } + + /** + * Required. The resource being created + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_link = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink::class); + $this->git_repository_link = $var; + + return $this; + } + + /** + * 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 + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getGitRepositoryLinkId() + { + return $this->git_repository_link_id; + } + + /** + * 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 + * -._~%!$&'()*+,;=@. + * + * Generated from protobuf field string git_repository_link_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setGitRepositoryLinkId($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link_id = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CryptoKeyConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CryptoKeyConfig.php new file mode 100644 index 000000000000..6f6c00bb8f28 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/CryptoKeyConfig.php @@ -0,0 +1,76 @@ +google.cloud.developerconnect.v1.CryptoKeyConfig + */ +class CryptoKeyConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $key_reference = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $key_reference + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getKeyReference() + { + return $this->key_reference; + } + + /** + * Required. The name of the key which is used to encrypt/decrypt customer + * data. For key in Cloud KMS, the key should be in the format of + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + * + * Generated from protobuf field string key_reference = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKeyReference($var) + { + GPBUtil::checkString($var, True); + $this->key_reference = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteConnectionRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteConnectionRequest.php new file mode 100644 index 000000000000..c7ddb931ee20 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteConnectionRequest.php @@ -0,0 +1,231 @@ +google.cloud.developerconnect.v1.DeleteConnectionRequest + */ +class DeleteConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. 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. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\DeleteConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * @type string $etag + * Optional. 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. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * 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. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. The 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. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. 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. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteGitRepositoryLinkRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..cc28fc5e1e60 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/DeleteGitRepositoryLinkRequest.php @@ -0,0 +1,231 @@ +google.cloud.developerconnect.v1.DeleteGitRepositoryLinkRequest + */ +class DeleteGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\DeleteGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * 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. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsRequest.php new file mode 100644 index 000000000000..1aa23cd4b8ac --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsRequest + */ +class FetchGitHubInstallationsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $connection = ''; + + /** + * @param string $connection Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsRequest + * + * @experimental + */ + public static function build(string $connection): self + { + return (new self()) + ->setConnection($connection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Required. The resource name of the connection in the format + * `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkString($var, True); + $this->connection = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse.php new file mode 100644 index 000000000000..54ca9a068f86 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse.php @@ -0,0 +1,71 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse + */ +class FetchGitHubInstallationsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + */ + private $installations; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation>|\Google\Protobuf\Internal\RepeatedField $installations + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getInstallations() + { + return $this->installations; + } + + /** + * List of installations available to the OAuth user (for github.com) + * or all the installations (for GitHub enterprise). + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation installations = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setInstallations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse\Installation::class); + $this->installations = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse/Installation.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse/Installation.php new file mode 100644 index 000000000000..cd68cee7f0aa --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitHubInstallationsResponse/Installation.php @@ -0,0 +1,138 @@ +google.cloud.developerconnect.v1.FetchGitHubInstallationsResponse.Installation + */ +class Installation extends \Google\Protobuf\Internal\Message +{ + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + */ + protected $id = 0; + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + */ + protected $type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $id + * ID of the installation in GitHub. + * @type string $name + * Name of the GitHub user or organization that owns this installation. + * @type string $type + * Either "user" or "organization". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + * @return int|string + */ + public function getId() + { + return $this->id; + } + + /** + * ID of the installation in GitHub. + * + * Generated from protobuf field int64 id = 1; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->id = $var; + + return $this; + } + + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Name of the GitHub user or organization that owns this installation. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * Either "user" or "organization". + * + * Generated from protobuf field string type = 3; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Installation::class, \Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse_Installation::class); + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest.php new file mode 100644 index 000000000000..844c9cfd91e0 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest.php @@ -0,0 +1,191 @@ +google.cloud.developerconnect.v1.FetchGitRefsRequest + */ +class FetchGitRefsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ref_type = 0; + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * @param int $refType Required. Type of refs to fetch. + * For allowed values, use constants defined on {@see \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest\RefType} + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink, int $refType): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink) + ->setRefType($refType); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * @type int $ref_type + * Required. Type of refs to fetch. + * @type int $page_size + * Optional. Number of results to return in the list. Default to 20. + * @type string $page_token + * Optional. Page start. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of GitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getRefType() + { + return $this->ref_type; + } + + /** + * Required. Type of refs to fetch. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType ref_type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setRefType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest\RefType::class); + $this->ref_type = $var; + + return $this; + } + + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results to return in the list. Default to 20. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest/RefType.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest/RefType.php new file mode 100644 index 000000000000..74c2eba79a0c --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsRequest/RefType.php @@ -0,0 +1,64 @@ +google.cloud.developerconnect.v1.FetchGitRefsRequest.RefType + */ +class RefType +{ + /** + * No type specified. + * + * Generated from protobuf enum REF_TYPE_UNSPECIFIED = 0; + */ + const REF_TYPE_UNSPECIFIED = 0; + /** + * To fetch tags. + * + * Generated from protobuf enum TAG = 1; + */ + const TAG = 1; + /** + * To fetch branches. + * + * Generated from protobuf enum BRANCH = 2; + */ + const BRANCH = 2; + + private static $valueToName = [ + self::REF_TYPE_UNSPECIFIED => 'REF_TYPE_UNSPECIFIED', + self::TAG => 'TAG', + self::BRANCH => 'BRANCH', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RefType::class, \Google\Cloud\DeveloperConnect\V1\FetchGitRefsRequest_RefType::class); + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsResponse.php new file mode 100644 index 000000000000..f5b0f6fc7010 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchGitRefsResponse.php @@ -0,0 +1,101 @@ +google.cloud.developerconnect.v1.FetchGitRefsResponse + */ +class FetchGitRefsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + */ + private $ref_names; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $ref_names + * Name of the refs fetched. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRefNames() + { + return $this->ref_names; + } + + /** + * Name of the refs fetched. + * + * Generated from protobuf field repeated string ref_names = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRefNames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->ref_names = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesRequest.php new file mode 100644 index 000000000000..8c48c66680d7 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesRequest.php @@ -0,0 +1,154 @@ +google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesRequest + */ +class FetchLinkableGitRepositoriesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $connection = ''; + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $connection Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. Please see + * {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchLinkableGitRepositoriesRequest + * + * @experimental + */ + public static function build(string $connection): self + { + return (new self()) + ->setConnection($connection); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $connection + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * @type int $page_size + * Optional. Number of results to return in the list. Defaults to 20. + * @type string $page_token + * Optional. Page start. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getConnection() + { + return $this->connection; + } + + /** + * Required. The name of the Connection. + * Format: `projects/*/locations/*/connections/*`. + * + * Generated from protobuf field string connection = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkString($var, True); + $this->connection = $var; + + return $this; + } + + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Number of results to return in the list. Defaults to 20. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. Page start. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesResponse.php new file mode 100644 index 000000000000..6e18a006bc3a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchLinkableGitRepositoriesResponse.php @@ -0,0 +1,101 @@ +google.cloud.developerconnect.v1.FetchLinkableGitRepositoriesResponse + */ +class FetchLinkableGitRepositoriesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + */ + private $linkable_git_repositories; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\LinkableGitRepository>|\Google\Protobuf\Internal\RepeatedField $linkable_git_repositories + * The git repositories that can be linked to the connection. + * @type string $next_page_token + * A token identifying a page of results the server should return. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLinkableGitRepositories() + { + return $this->linkable_git_repositories; + } + + /** + * The git repositories that can be linked to the connection. + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.LinkableGitRepository linkable_git_repositories = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\LinkableGitRepository>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLinkableGitRepositories($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\LinkableGitRepository::class); + $this->linkable_git_repositories = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenRequest.php new file mode 100644 index 000000000000..e7c3e184650d --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchReadTokenRequest + */ +class FetchReadTokenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchReadTokenRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenResponse.php new file mode 100644 index 000000000000..b627d6e31329 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadTokenResponse.php @@ -0,0 +1,153 @@ +google.cloud.developerconnect.v1.FetchReadTokenResponse + */ +class FetchReadTokenResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The token content. + * + * Generated from protobuf field string token = 1; + */ + protected $token = ''; + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + */ + protected $expiration_time = null; + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + */ + protected $git_username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * The token content. + * @type \Google\Protobuf\Timestamp $expiration_time + * Expiration timestamp. Can be empty if unknown or non-expiring. + * @type string $git_username + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpirationTime() + { + return $this->expiration_time; + } + + public function hasExpirationTime() + { + return isset($this->expiration_time); + } + + public function clearExpirationTime() + { + unset($this->expiration_time); + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpirationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiration_time = $var; + + return $this; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @return string + */ + public function getGitUsername() + { + return $this->git_username; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @param string $var + * @return $this + */ + public function setGitUsername($var) + { + GPBUtil::checkString($var, True); + $this->git_username = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenRequest.php new file mode 100644 index 000000000000..f08f600078b9 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenRequest.php @@ -0,0 +1,86 @@ +google.cloud.developerconnect.v1.FetchReadWriteTokenRequest + */ +class FetchReadWriteTokenRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $git_repository_link = ''; + + /** + * @param string $gitRepositoryLink Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. Please see + * {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\FetchReadWriteTokenRequest + * + * @experimental + */ + public static function build(string $gitRepositoryLink): self + { + return (new self()) + ->setGitRepositoryLink($gitRepositoryLink); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $git_repository_link + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getGitRepositoryLink() + { + return $this->git_repository_link; + } + + /** + * Required. The resource name of the gitRepositoryLink in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string git_repository_link = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setGitRepositoryLink($var) + { + GPBUtil::checkString($var, True); + $this->git_repository_link = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenResponse.php new file mode 100644 index 000000000000..55723d37de4a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/FetchReadWriteTokenResponse.php @@ -0,0 +1,153 @@ +google.cloud.developerconnect.v1.FetchReadWriteTokenResponse + */ +class FetchReadWriteTokenResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The token content. + * + * Generated from protobuf field string token = 1; + */ + protected $token = ''; + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + */ + protected $expiration_time = null; + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + */ + protected $git_username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $token + * The token content. + * @type \Google\Protobuf\Timestamp $expiration_time + * Expiration timestamp. Can be empty if unknown or non-expiring. + * @type string $git_username + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @return string + */ + public function getToken() + { + return $this->token; + } + + /** + * The token content. + * + * Generated from protobuf field string token = 1; + * @param string $var + * @return $this + */ + public function setToken($var) + { + GPBUtil::checkString($var, True); + $this->token = $var; + + return $this; + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpirationTime() + { + return $this->expiration_time; + } + + public function hasExpirationTime() + { + return isset($this->expiration_time); + } + + public function clearExpirationTime() + { + unset($this->expiration_time); + } + + /** + * Expiration timestamp. Can be empty if unknown or non-expiring. + * + * Generated from protobuf field .google.protobuf.Timestamp expiration_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpirationTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expiration_time = $var; + + return $this; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @return string + */ + public function getGitUsername() + { + return $this->git_username; + } + + /** + * The git_username to specify when making a git clone with the + * token. For example, for GitHub GitRepositoryLinks, this would be + * "x-access-token" + * + * Generated from protobuf field string git_username = 3; + * @param string $var + * @return $this + */ + public function setGitUsername($var) + { + GPBUtil::checkString($var, True); + $this->git_username = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetConnectionRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetConnectionRequest.php new file mode 100644 index 000000000000..7fc40faa567e --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetConnectionRequest.php @@ -0,0 +1,81 @@ +google.cloud.developerconnect.v1.GetConnectionRequest + */ +class GetConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\GetConnectionRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetGitRepositoryLinkRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetGitRepositoryLinkRequest.php new file mode 100644 index 000000000000..a5f01241c7fa --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GetGitRepositoryLinkRequest.php @@ -0,0 +1,81 @@ +google.cloud.developerconnect.v1.GetGitRepositoryLinkRequest + */ +class GetGitRepositoryLinkRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. Name of the resource + * Please see {@see DeveloperConnectClient::gitRepositoryLinkName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\GetGitRepositoryLinkRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. Name of the resource + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. Name of the resource + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig.php new file mode 100644 index 000000000000..90397b298efe --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig.php @@ -0,0 +1,195 @@ +google.cloud.developerconnect.v1.GitHubConfig + */ +class GitHubConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $github_app = 0; + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $authorizer_credential = null; + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_installation_id = 0; + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $github_app + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * @type \Google\Cloud\DeveloperConnect\V1\OAuthCredential $authorizer_credential + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * @type int|string $app_installation_id + * Optional. GitHub App installation id. + * @type string $installation_uri + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getGithubApp() + { + return $this->github_app; + } + + /** + * Required. Immutable. The GitHub Application that was installed to the + * GitHub user or organization. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.GitHubConfig.GitHubApp github_app = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setGithubApp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\GitHubConfig\GitHubApp::class); + $this->github_app = $var; + + return $this; + } + + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\OAuthCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Optional. OAuth credential of the account that authorized the GitHub App. + * It is recommended to use a robot account instead of a human user account. + * The OAuth token must be tied to the GitHub App of this config. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.OAuthCredential authorizer_credential = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\OAuthCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\OAuthCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppInstallationId() + { + return $this->app_installation_id; + } + + /** + * Optional. GitHub App installation id. + * + * Generated from protobuf field int64 app_installation_id = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppInstallationId($var) + { + GPBUtil::checkInt64($var); + $this->app_installation_id = $var; + + return $this; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstallationUri() + { + return $this->installation_uri; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubConfig. + * + * Generated from protobuf field string installation_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstallationUri($var) + { + GPBUtil::checkString($var, True); + $this->installation_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig/GitHubApp.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig/GitHubApp.php new file mode 100644 index 000000000000..58d04bcadc25 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubConfig/GitHubApp.php @@ -0,0 +1,65 @@ +google.cloud.developerconnect.v1.GitHubConfig.GitHubApp + */ +class GitHubApp +{ + /** + * GitHub App not specified. + * + * Generated from protobuf enum GIT_HUB_APP_UNSPECIFIED = 0; + */ + const GIT_HUB_APP_UNSPECIFIED = 0; + /** + * The Developer Connect GitHub Application. + * + * Generated from protobuf enum DEVELOPER_CONNECT = 1; + */ + const DEVELOPER_CONNECT = 1; + /** + * The Firebase GitHub Application. + * + * Generated from protobuf enum FIREBASE = 2; + */ + const FIREBASE = 2; + + private static $valueToName = [ + self::GIT_HUB_APP_UNSPECIFIED => 'GIT_HUB_APP_UNSPECIFIED', + self::DEVELOPER_CONNECT => 'DEVELOPER_CONNECT', + self::FIREBASE => 'FIREBASE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GitHubApp::class, \Google\Cloud\DeveloperConnect\V1\GitHubConfig_GitHubApp::class); + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubEnterpriseConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubEnterpriseConfig.php new file mode 100644 index 000000000000..3b7ef1009b17 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitHubEnterpriseConfig.php @@ -0,0 +1,411 @@ +google.cloud.developerconnect.v1.GitHubEnterpriseConfig + */ +class GitHubEnterpriseConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the GitHub Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host_uri = ''; + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_id = 0; + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $app_slug = ''; + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $private_key_secret_version = ''; + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $app_installation_id = 0; + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $installation_uri = ''; + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_directory_config = null; + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $server_version = ''; + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_ca_certificate = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * Required. The URI of the GitHub Enterprise host this connection is for. + * @type int|string $app_id + * Optional. ID of the GitHub App created from the manifest. + * @type string $app_slug + * Output only. The URL-friendly name of the GitHub App. + * @type string $private_key_secret_version + * Optional. SecretManager resource containing the private key of the GitHub + * App, formatted as `projects/*/secrets/*/versions/*`. + * @type string $webhook_secret_secret_version + * Optional. SecretManager resource containing the webhook secret of the + * GitHub App, formatted as `projects/*/secrets/*/versions/*`. + * @type int|string $app_installation_id + * Optional. ID of the installation of the GitHub App. + * @type string $installation_uri + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * @type \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $service_directory_config + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * @type string $server_version + * Output only. GitHub Enterprise version installed at the host_uri. + * @type string $ssl_ca_certificate + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the GitHub Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHostUri() + { + return $this->host_uri; + } + + /** + * Required. The URI of the GitHub Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHostUri($var) + { + GPBUtil::checkString($var, True); + $this->host_uri = $var; + + return $this; + } + + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppId() + { + return $this->app_id; + } + + /** + * Optional. ID of the GitHub App created from the manifest. + * + * Generated from protobuf field int64 app_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppId($var) + { + GPBUtil::checkInt64($var); + $this->app_id = $var; + + return $this; + } + + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getAppSlug() + { + return $this->app_slug; + } + + /** + * Output only. The URL-friendly name of the GitHub App. + * + * Generated from protobuf field string app_slug = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setAppSlug($var) + { + GPBUtil::checkString($var, True); + $this->app_slug = $var; + + return $this; + } + + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getPrivateKeySecretVersion() + { + return $this->private_key_secret_version; + } + + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setPrivateKeySecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->private_key_secret_version = $var; + + return $this; + } + + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Optional. 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.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWebhookSecretSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->webhook_secret_secret_version = $var; + + return $this; + } + + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string + */ + public function getAppInstallationId() + { + return $this->app_installation_id; + } + + /** + * Optional. ID of the installation of the GitHub App. + * + * Generated from protobuf field int64 app_installation_id = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string $var + * @return $this + */ + public function setAppInstallationId($var) + { + GPBUtil::checkInt64($var); + $this->app_installation_id = $var; + + return $this; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getInstallationUri() + { + return $this->installation_uri; + } + + /** + * Output only. The URI to navigate to in order to manage the installation + * associated with this GitHubEnterpriseConfig. + * + * Generated from protobuf field string installation_uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setInstallationUri($var) + { + GPBUtil::checkString($var, True); + $this->installation_uri = $var; + + return $this; + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig|null + */ + public function getServiceDirectoryConfig() + { + return $this->service_directory_config; + } + + public function hasServiceDirectoryConfig() + { + return isset($this->service_directory_config); + } + + public function clearServiceDirectoryConfig() + { + unset($this->service_directory_config); + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitHub Enterprise server. This should only be set if the GitHub + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitHub Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServerVersion() + { + return $this->server_version; + } + + /** + * Output only. GitHub Enterprise version installed at the host_uri. + * + * Generated from protobuf field string server_version = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServerVersion($var) + { + GPBUtil::checkString($var, True); + $this->server_version = $var; + + return $this; + } + + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSslCaCertificate() + { + return $this->ssl_ca_certificate; + } + + /** + * Optional. SSL certificate to use for requests to GitHub Enterprise. + * + * Generated from protobuf field string ssl_ca_certificate = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSslCaCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_ca_certificate = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabConfig.php new file mode 100644 index 000000000000..c3086e630f68 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabConfig.php @@ -0,0 +1,187 @@ +google.cloud.developerconnect.v1.GitLabConfig + */ +class GitLabConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $read_authorizer_credential = null; + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorizer_credential = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $webhook_secret_secret_version + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $read_authorizer_credential + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $authorizer_credential + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWebhookSecretSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->webhook_secret_secret_version = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\UserCredential|null + */ + public function getReadAuthorizerCredential() + { + return $this->read_authorizer_credential; + } + + public function hasReadAuthorizerCredential() + { + return isset($this->read_authorizer_credential); + } + + public function clearReadAuthorizerCredential() + { + unset($this->read_authorizer_credential); + } + + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\UserCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabEnterpriseConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabEnterpriseConfig.php new file mode 100644 index 000000000000..24b0389f9a38 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitLabEnterpriseConfig.php @@ -0,0 +1,357 @@ +google.cloud.developerconnect.v1.GitLabEnterpriseConfig + */ +class GitLabEnterpriseConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The URI of the GitLab Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $host_uri = ''; + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + */ + protected $webhook_secret_secret_version = ''; + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $read_authorizer_credential = null; + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $authorizer_credential = null; + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_directory_config = null; + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $ssl_ca_certificate = ''; + /** + * 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]; + */ + protected $server_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $host_uri + * Required. The URI of the GitLab Enterprise host this connection is for. + * @type string $webhook_secret_secret_version + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $read_authorizer_credential + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\UserCredential $authorizer_credential + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * @type \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $service_directory_config + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * @type string $ssl_ca_certificate + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * @type string $server_version + * Output only. Version of the GitLab Enterprise server running on the + * `host_uri`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The URI of the GitLab Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getHostUri() + { + return $this->host_uri; + } + + /** + * Required. The URI of the GitLab Enterprise host this connection is for. + * + * Generated from protobuf field string host_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setHostUri($var) + { + GPBUtil::checkString($var, True); + $this->host_uri = $var; + + return $this; + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @return string + */ + public function getWebhookSecretSecretVersion() + { + return $this->webhook_secret_secret_version; + } + + /** + * Required. Immutable. SecretManager resource containing the webhook secret + * of a GitLab project, formatted as `projects/*/secrets/*/versions/*`. This + * is used to validate webhooks. + * + * Generated from protobuf field string webhook_secret_secret_version = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setWebhookSecretSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->webhook_secret_secret_version = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\UserCredential|null + */ + public function getReadAuthorizerCredential() + { + return $this->read_authorizer_credential; + } + + public function hasReadAuthorizerCredential() + { + return isset($this->read_authorizer_credential); + } + + public function clearReadAuthorizerCredential() + { + unset($this->read_authorizer_credential); + } + + /** + * Required. A GitLab personal access token with the minimum `read_api` scope + * access and a minimum role of `reporter`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential read_authorizer_credential = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setReadAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->read_authorizer_credential = $var; + + return $this; + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\UserCredential|null + */ + public function getAuthorizerCredential() + { + return $this->authorizer_credential; + } + + public function hasAuthorizerCredential() + { + return isset($this->authorizer_credential); + } + + public function clearAuthorizerCredential() + { + unset($this->authorizer_credential); + } + + /** + * Required. A GitLab personal access token with the minimum `api` scope + * access and a minimum role of `maintainer`. The GitLab Projects visible to + * this Personal Access Token will control which Projects Developer Connect + * has access to. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.UserCredential authorizer_credential = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\UserCredential $var + * @return $this + */ + public function setAuthorizerCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\UserCredential::class); + $this->authorizer_credential = $var; + + return $this; + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig|null + */ + public function getServiceDirectoryConfig() + { + return $this->service_directory_config; + } + + public function hasServiceDirectoryConfig() + { + return isset($this->service_directory_config); + } + + public function clearServiceDirectoryConfig() + { + unset($this->service_directory_config); + } + + /** + * Optional. Configuration for using Service Directory to privately connect to + * a GitLab Enterprise instance. This should only be set if the GitLab + * Enterprise server is hosted on-premises and not reachable by public + * internet. If this field is left empty, calls to the GitLab Enterprise + * server will be made over the public internet. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.ServiceDirectoryConfig service_directory_config = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig $var + * @return $this + */ + public function setServiceDirectoryConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\ServiceDirectoryConfig::class); + $this->service_directory_config = $var; + + return $this; + } + + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getSslCaCertificate() + { + return $this->ssl_ca_certificate; + } + + /** + * Optional. SSL Certificate Authority certificate to use for requests to + * GitLab Enterprise instance. + * + * Generated from protobuf field string ssl_ca_certificate = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setSslCaCertificate($var) + { + GPBUtil::checkString($var, True); + $this->ssl_ca_certificate = $var; + + return $this; + } + + /** + * 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]; + * @return string + */ + public function getServerVersion() + { + return $this->server_version; + } + + /** + * 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]; + * @param string $var + * @return $this + */ + public function setServerVersion($var) + { + GPBUtil::checkString($var, True); + $this->server_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitRepositoryLink.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitRepositoryLink.php new file mode 100644 index 000000000000..30bf0e2cfd17 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/GitRepositoryLink.php @@ -0,0 +1,457 @@ +google.cloud.developerconnect.v1.GitRepositoryLink + */ +class GitRepositoryLink extends \Google\Protobuf\Internal\Message +{ + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + */ + protected $name = ''; + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $clone_uri = ''; + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $delete_time = null; + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $etag = ''; + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $reconciling = false; + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $annotations; + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + */ + protected $uid = ''; + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $webhook_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * @type string $clone_uri + * Required. Git Clone URI. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. [Output only] Create timestamp + * @type \Google\Protobuf\Timestamp $update_time + * Output only. [Output only] Update timestamp + * @type \Google\Protobuf\Timestamp $delete_time + * Output only. [Output only] Delete timestamp + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. Labels as key value pairs + * @type string $etag + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * @type bool $reconciling + * Output only. Set to true when the connection is being set up or updated in + * the background. + * @type array|\Google\Protobuf\Internal\MapField $annotations + * Optional. Allows clients to store small amounts of arbitrary data. + * @type string $uid + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * @type string $webhook_id + * Output only. External ID of the webhook created for the repository. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Identifier. Resource name of the repository, in the format + * `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCloneUri() + { + return $this->clone_uri; + } + + /** + * Required. Git Clone URI. + * + * Generated from protobuf field string clone_uri = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCloneUri($var) + { + GPBUtil::checkString($var, True); + $this->clone_uri = $var; + + return $this; + } + + /** + * Output only. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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. [Output only] Create timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.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. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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. [Output only] Update timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4 [(.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. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.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. [Output only] Delete timestamp + * + * Generated from protobuf field .google.protobuf.Timestamp delete_time = 5 [(.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; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. Labels as key value pairs + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Optional. This checksum is computed by the server based on the value of + * other fields, and may be sent on update and delete requests to ensure the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getReconciling() + { + return $this->reconciling; + } + + /** + * Output only. Set to true when the connection is being set up or updated in + * the background. + * + * Generated from protobuf field bool reconciling = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setReconciling($var) + { + GPBUtil::checkBool($var); + $this->reconciling = $var; + + return $this; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAnnotations() + { + return $this->annotations; + } + + /** + * Optional. Allows clients to store small amounts of arbitrary data. + * + * Generated from protobuf field map annotations = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAnnotations($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->annotations = $arr; + + return $this; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. A system-assigned unique identifier for a the + * GitRepositoryLink. + * + * Generated from protobuf field string uid = 10 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getWebhookId() + { + return $this->webhook_id; + } + + /** + * Output only. External ID of the webhook created for the repository. + * + * Generated from protobuf field string webhook_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setWebhookId($var) + { + GPBUtil::checkString($var, True); + $this->webhook_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState.php new file mode 100644 index 000000000000..d386e6ed3283 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState.php @@ -0,0 +1,145 @@ +google.cloud.developerconnect.v1.InstallationState + */ +class InstallationState extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + 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]; + */ + 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]; + */ + protected $action_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $stage + * Output only. Current step of the installation process. + * @type string $message + * Output only. Message of what the user should do next to continue the + * installation. Empty string if the installation is already complete. + * @type string $action_uri + * Output only. Link to follow for next action. Empty string if the + * installation is already complete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getStage() + { + return $this->stage; + } + + /** + * Output only. Current step of the installation process. + * + * Generated from protobuf field .google.cloud.developerconnect.v1.InstallationState.Stage stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DeveloperConnect\V1\InstallationState\Stage::class); + $this->stage = $var; + + return $this; + } + + /** + * 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]; + * @return string + */ + public function getMessage() + { + return $this->message; + } + + /** + * 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]; + * @param string $var + * @return $this + */ + public function setMessage($var) + { + GPBUtil::checkString($var, True); + $this->message = $var; + + return $this; + } + + /** + * 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]; + * @return string + */ + public function getActionUri() + { + return $this->action_uri; + } + + /** + * 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]; + * @param string $var + * @return $this + */ + public function setActionUri($var) + { + GPBUtil::checkString($var, True); + $this->action_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState/Stage.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState/Stage.php new file mode 100644 index 000000000000..6e7a85ea9819 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/InstallationState/Stage.php @@ -0,0 +1,79 @@ +google.cloud.developerconnect.v1.InstallationState.Stage + */ +class Stage +{ + /** + * No stage specified. + * + * Generated from protobuf enum STAGE_UNSPECIFIED = 0; + */ + const STAGE_UNSPECIFIED = 0; + /** + * Only for GitHub Enterprise. An App creation has been requested. + * The user needs to confirm the creation in their GitHub enterprise host. + * + * Generated from protobuf enum PENDING_CREATE_APP = 1; + */ + const PENDING_CREATE_APP = 1; + /** + * User needs to authorize the GitHub (or Enterprise) App via OAuth. + * + * Generated from protobuf enum PENDING_USER_OAUTH = 2; + */ + const PENDING_USER_OAUTH = 2; + /** + * User needs to follow the link to install the GitHub (or Enterprise) App. + * + * Generated from protobuf enum PENDING_INSTALL_APP = 3; + */ + const PENDING_INSTALL_APP = 3; + /** + * Installation process has been completed. + * + * Generated from protobuf enum COMPLETE = 10; + */ + const COMPLETE = 10; + + private static $valueToName = [ + self::STAGE_UNSPECIFIED => 'STAGE_UNSPECIFIED', + self::PENDING_CREATE_APP => 'PENDING_CREATE_APP', + self::PENDING_USER_OAUTH => 'PENDING_USER_OAUTH', + self::PENDING_INSTALL_APP => 'PENDING_INSTALL_APP', + self::COMPLETE => 'COMPLETE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Stage::class, \Google\Cloud\DeveloperConnect\V1\InstallationState_Stage::class); + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/LinkableGitRepository.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/LinkableGitRepository.php new file mode 100644 index 000000000000..800ae7c1241a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/LinkableGitRepository.php @@ -0,0 +1,68 @@ +google.cloud.developerconnect.v1.LinkableGitRepository + */ +class LinkableGitRepository extends \Google\Protobuf\Internal\Message +{ + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + */ + protected $clone_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $clone_uri + * The clone uri of the repository. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + * @return string + */ + public function getCloneUri() + { + return $this->clone_uri; + } + + /** + * The clone uri of the repository. + * + * Generated from protobuf field string clone_uri = 1; + * @param string $var + * @return $this + */ + public function setCloneUri($var) + { + GPBUtil::checkString($var, True); + $this->clone_uri = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsRequest.php new file mode 100644 index 000000000000..d89bfd8b485b --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsRequest.php @@ -0,0 +1,221 @@ +google.cloud.developerconnect.v1.ListConnectionsRequest + */ +class ListConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListConnectionsRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListConnectionsRequest + * Please see {@see DeveloperConnectClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\ListConnectionsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListConnectionsRequest + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * @type string $order_by + * Optional. Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListConnectionsRequest + * + * 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. Parent value for ListConnectionsRequest + * + * 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; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsResponse.php new file mode 100644 index 000000000000..cfbb687e8868 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListConnectionsResponse.php @@ -0,0 +1,135 @@ +google.cloud.developerconnect.v1.ListConnectionsResponse + */ +class ListConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + */ + private $connections; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * The list of Connection + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * The list of Connection + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.Connection connections = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksRequest.php new file mode 100644 index 000000000000..181e7f962415 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksRequest.php @@ -0,0 +1,221 @@ +google.cloud.developerconnect.v1.ListGitRepositoryLinksRequest + */ +class ListGitRepositoryLinksRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Parent value for ListGitRepositoryLinksRequest + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. Parent value for ListGitRepositoryLinksRequest + * Please see {@see DeveloperConnectClient::connectionName()} for help formatting this field. + * + * @return \Google\Cloud\DeveloperConnect\V1\ListGitRepositoryLinksRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. Parent value for ListGitRepositoryLinksRequest + * @type int $page_size + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @type string $page_token + * Optional. A token identifying a page of results the server should return. + * @type string $filter + * Optional. Filtering results + * @type string $order_by + * Optional. Hint for how to order the results + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Parent value for ListGitRepositoryLinksRequest + * + * 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. Parent value for ListGitRepositoryLinksRequest + * + * 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; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A token identifying a page of results the server should return. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. Filtering results + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Hint for how to order the results + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksResponse.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksResponse.php new file mode 100644 index 000000000000..523f56db1fbc --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ListGitRepositoryLinksResponse.php @@ -0,0 +1,135 @@ +google.cloud.developerconnect.v1.ListGitRepositoryLinksResponse + */ +class ListGitRepositoryLinksResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + */ + private $git_repository_links; + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink>|\Google\Protobuf\Internal\RepeatedField $git_repository_links + * The list of GitRepositoryLinks + * @type string $next_page_token + * A token identifying a page of results the server should return. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getGitRepositoryLinks() + { + return $this->git_repository_links; + } + + /** + * The list of GitRepositoryLinks + * + * Generated from protobuf field repeated .google.cloud.developerconnect.v1.GitRepositoryLink git_repository_links = 1; + * @param array<\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setGitRepositoryLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DeveloperConnect\V1\GitRepositoryLink::class); + $this->git_repository_links = $arr; + + return $this; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A token identifying a page of results the server should return. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OAuthCredential.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OAuthCredential.php new file mode 100644 index 000000000000..9b16b9fb193a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OAuthCredential.php @@ -0,0 +1,106 @@ +google.cloud.developerconnect.v1.OAuthCredential + */ +class OAuthCredential extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $oauth_token_secret_version = ''; + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $oauth_token_secret_version + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * @type string $username + * Output only. The username associated with this token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getOauthTokenSecretVersion() + { + return $this->oauth_token_secret_version; + } + + /** + * Required. A SecretManager resource containing the OAuth token that + * authorizes the connection. Format: `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string oauth_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setOauthTokenSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->oauth_token_secret_version = $var; + + return $this; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OperationMetadata.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OperationMetadata.php new file mode 100644 index 000000000000..230685d22900 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/OperationMetadata.php @@ -0,0 +1,311 @@ +google.cloud.developerconnect.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have been cancelled successfully + * have + * [google.longrunning.Operation.error][google.longrunning.Operation.error] + * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ServiceDirectoryConfig.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ServiceDirectoryConfig.php new file mode 100644 index 000000000000..53b99355e074 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/ServiceDirectoryConfig.php @@ -0,0 +1,76 @@ +google.cloud.developerconnect.v1.ServiceDirectoryConfig + */ +class ServiceDirectoryConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. The Service Directory service name. + * Format: + * projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UpdateConnectionRequest.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UpdateConnectionRequest.php new file mode 100644 index 000000000000..3c303ba1de8c --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UpdateConnectionRequest.php @@ -0,0 +1,314 @@ +google.cloud.developerconnect.v1.UpdateConnectionRequest + */ +class UpdateConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $update_mask = null; + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $connection = null; + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + /** + * Optional. 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). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $allow_missing = false; + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $validate_only = false; + + /** + * @param \Google\Cloud\DeveloperConnect\V1\Connection $connection Required. The resource being updated + * @param \Google\Protobuf\FieldMask $updateMask Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * @return \Google\Cloud\DeveloperConnect\V1\UpdateConnectionRequest + * + * @experimental + */ + public static function build(\Google\Cloud\DeveloperConnect\V1\Connection $connection, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setConnection($connection) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @type \Google\Cloud\DeveloperConnect\V1\Connection $connection + * Required. The resource being updated + * @type string $request_id + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @type bool $allow_missing + * Optional. 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 bool $validate_only + * Optional. If set, validate the request, but do not actually post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Connection resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\DeveloperConnect\V1\Connection|null + */ + public function getConnection() + { + return $this->connection; + } + + public function hasConnection() + { + return isset($this->connection); + } + + public function clearConnection() + { + unset($this->connection); + } + + /** + * Required. The resource being updated + * + * Generated from protobuf field .google.cloud.developerconnect.v1.Connection connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\DeveloperConnect\V1\Connection $var + * @return $this + */ + public function setConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\DeveloperConnect\V1\Connection::class); + $this->connection = $var; + + return $this; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and the + * request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + + /** + * Optional. 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). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * Optional. If set to true, and 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). + * + * Generated from protobuf field bool allow_missing = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Optional. If set, validate the request, but do not actually post it. + * + * Generated from protobuf field bool validate_only = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UserCredential.php b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UserCredential.php new file mode 100644 index 000000000000..e8fa67e225e2 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/proto/src/Google/Cloud/DeveloperConnect/V1/UserCredential.php @@ -0,0 +1,110 @@ +google.cloud.developerconnect.v1.UserCredential + */ +class UserCredential extends \Google\Protobuf\Internal\Message +{ + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $user_token_secret_version = ''; + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $username = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $user_token_secret_version + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * @type string $username + * Output only. The username associated with this token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Developerconnect\V1\DeveloperConnect::initOnce(); + parent::__construct($data); + } + + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getUserTokenSecretVersion() + { + return $this->user_token_secret_version; + } + + /** + * Required. A SecretManager resource containing the user token that + * authorizes the Developer Connect connection. Format: + * `projects/*/secrets/*/versions/*`. + * + * Generated from protobuf field string user_token_secret_version = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setUserTokenSecretVersion($var) + { + GPBUtil::checkString($var, True); + $this->user_token_secret_version = $var; + + return $this; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUsername() + { + return $this->username; + } + + /** + * Output only. The username associated with this token. + * + * Generated from protobuf field string username = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUsername($var) + { + GPBUtil::checkString($var, True); + $this->username = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_connection.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_connection.php new file mode 100644 index 000000000000..cbb5d8f4c53d --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_connection.php @@ -0,0 +1,90 @@ +setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->createConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Connection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DeveloperConnectClient::locationName('[PROJECT]', '[LOCATION]'); + $connectionId = '[CONNECTION_ID]'; + + create_connection_sample($formattedParent, $connectionId); +} +// [END developerconnect_v1_generated_DeveloperConnect_CreateConnection_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_git_repository_link.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_git_repository_link.php new file mode 100644 index 000000000000..d9585bf6051d --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/create_git_repository_link.php @@ -0,0 +1,109 @@ +setCloneUri($gitRepositoryLinkCloneUri); + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->createGitRepositoryLink($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var GitRepositoryLink $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + $gitRepositoryLinkCloneUri = '[CLONE_URI]'; + $gitRepositoryLinkId = '[GIT_REPOSITORY_LINK_ID]'; + + create_git_repository_link_sample( + $formattedParent, + $gitRepositoryLinkCloneUri, + $gitRepositoryLinkId + ); +} +// [END developerconnect_v1_generated_DeveloperConnect_CreateGitRepositoryLink_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_connection.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_connection.php new file mode 100644 index 000000000000..14d6dfc8decf --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_connection.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->deleteConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DeveloperConnectClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + delete_connection_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_DeleteConnection_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_git_repository_link.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_git_repository_link.php new file mode 100644 index 000000000000..fa1acf4d24bd --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/delete_git_repository_link.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->deleteGitRepositoryLink($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + delete_git_repository_link_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_DeleteGitRepositoryLink_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php new file mode 100644 index 000000000000..a2ba9bab4bc6 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php @@ -0,0 +1,79 @@ +setConnection($formattedConnection); + + // Call the API and handle any network failures. + try { + /** @var FetchGitHubInstallationsResponse $response */ + $response = $developerConnectClient->fetchGitHubInstallations($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConnection = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + fetch_git_hub_installations_sample($formattedConnection); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchGitHubInstallations_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_refs.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_refs.php new file mode 100644 index 000000000000..797f6186828f --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_git_refs.php @@ -0,0 +1,85 @@ +setGitRepositoryLink($formattedGitRepositoryLink) + ->setRefType($refType); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->fetchGitRefs($request); + + /** @var string $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + $refType = RefType::REF_TYPE_UNSPECIFIED; + + fetch_git_refs_sample($formattedGitRepositoryLink, $refType); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchGitRefs_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php new file mode 100644 index 000000000000..a59f7407e797 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php @@ -0,0 +1,82 @@ +setConnection($formattedConnection); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->fetchLinkableGitRepositories($request); + + /** @var LinkableGitRepository $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedConnection = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + fetch_linkable_git_repositories_sample($formattedConnection); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchLinkableGitRepositories_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_token.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_token.php new file mode 100644 index 000000000000..024d996d0cbf --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_token.php @@ -0,0 +1,77 @@ +setGitRepositoryLink($formattedGitRepositoryLink); + + // Call the API and handle any network failures. + try { + /** @var FetchReadTokenResponse $response */ + $response = $developerConnectClient->fetchReadToken($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + fetch_read_token_sample($formattedGitRepositoryLink); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchReadToken_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_write_token.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_write_token.php new file mode 100644 index 000000000000..dbf90ac3ed8d --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/fetch_read_write_token.php @@ -0,0 +1,77 @@ +setGitRepositoryLink($formattedGitRepositoryLink); + + // Call the API and handle any network failures. + try { + /** @var FetchReadWriteTokenResponse $response */ + $response = $developerConnectClient->fetchReadWriteToken($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedGitRepositoryLink = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + fetch_read_write_token_sample($formattedGitRepositoryLink); +} +// [END developerconnect_v1_generated_DeveloperConnect_FetchReadWriteToken_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_connection.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_connection.php new file mode 100644 index 000000000000..62f8dad3980c --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_connection.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var Connection $response */ + $response = $developerConnectClient->getConnection($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DeveloperConnectClient::connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + + get_connection_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_GetConnection_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_git_repository_link.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_git_repository_link.php new file mode 100644 index 000000000000..7bc8921ff003 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_git_repository_link.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var GitRepositoryLink $response */ + $response = $developerConnectClient->getGitRepositoryLink($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = DeveloperConnectClient::gitRepositoryLinkName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]', + '[GIT_REPOSITORY_LINK]' + ); + + get_git_repository_link_sample($formattedName); +} +// [END developerconnect_v1_generated_DeveloperConnect_GetGitRepositoryLink_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_location.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_location.php new file mode 100644 index 000000000000..bbbaa9a5f5b4 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/get_location.php @@ -0,0 +1,57 @@ +getLocation($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_GetLocation_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_connections.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_connections.php new file mode 100644 index 000000000000..f3da4ef4ae9a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_connections.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->listConnections($request); + + /** @var Connection $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DeveloperConnectClient::locationName('[PROJECT]', '[LOCATION]'); + + list_connections_sample($formattedParent); +} +// [END developerconnect_v1_generated_DeveloperConnect_ListConnections_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_git_repository_links.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_git_repository_links.php new file mode 100644 index 000000000000..ec2696944caf --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_git_repository_links.php @@ -0,0 +1,80 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $developerConnectClient->listGitRepositoryLinks($request); + + /** @var GitRepositoryLink $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = DeveloperConnectClient::connectionName( + '[PROJECT]', + '[LOCATION]', + '[CONNECTION]' + ); + + list_git_repository_links_sample($formattedParent); +} +// [END developerconnect_v1_generated_DeveloperConnect_ListGitRepositoryLinks_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_locations.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_locations.php new file mode 100644 index 000000000000..4cd5195a5ff9 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/list_locations.php @@ -0,0 +1,62 @@ +listLocations($request); + + /** @var Location $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_ListLocations_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/update_connection.php b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/update_connection.php new file mode 100644 index 000000000000..99ac0c315fba --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/samples/V1/DeveloperConnectClient/update_connection.php @@ -0,0 +1,74 @@ +setUpdateMask($updateMask) + ->setConnection($connection); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $developerConnectClient->updateConnection($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Connection $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END developerconnect_v1_generated_DeveloperConnect_UpdateConnection_sync] diff --git a/owl-bot-staging/DeveloperConnect/v1/src/V1/Client/DeveloperConnectClient.php b/owl-bot-staging/DeveloperConnect/v1/src/V1/Client/DeveloperConnectClient.php new file mode 100644 index 000000000000..9d6de85a251a --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/src/V1/Client/DeveloperConnectClient.php @@ -0,0 +1,837 @@ + createConnectionAsync(CreateConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface createGitRepositoryLinkAsync(CreateGitRepositoryLinkRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteConnectionAsync(DeleteConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteGitRepositoryLinkAsync(DeleteGitRepositoryLinkRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchGitHubInstallationsAsync(FetchGitHubInstallationsRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchGitRefsAsync(FetchGitRefsRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchLinkableGitRepositoriesAsync(FetchLinkableGitRepositoriesRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchReadTokenAsync(FetchReadTokenRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchReadWriteTokenAsync(FetchReadWriteTokenRequest $request, array $optionalArgs = []) + * @method PromiseInterface getConnectionAsync(GetConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getGitRepositoryLinkAsync(GetGitRepositoryLinkRequest $request, array $optionalArgs = []) + * @method PromiseInterface listConnectionsAsync(ListConnectionsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listGitRepositoryLinksAsync(ListGitRepositoryLinksRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateConnectionAsync(UpdateConnectionRequest $request, array $optionalArgs = []) + * @method PromiseInterface getLocationAsync(GetLocationRequest $request, array $optionalArgs = []) + * @method PromiseInterface listLocationsAsync(ListLocationsRequest $request, array $optionalArgs = []) + */ +final class DeveloperConnectClient +{ + use GapicClientTrait; + use ResourceHelperTrait; + + /** The name of the service. */ + private const SERVICE_NAME = 'google.cloud.developerconnect.v1.DeveloperConnect'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + private const SERVICE_ADDRESS = 'developerconnect.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'developerconnect.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + private const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + private const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/developer_connect_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/developer_connect_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/developer_connect_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/developer_connect_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Create the default operation client for the service. + * + * @param array $options ClientOptions for the client. + * + * @return OperationsClient + */ + private function createOperationsClient(array $options) + { + // Unset client-specific configuration options + unset($options['serviceName'], $options['clientConfig'], $options['descriptorsConfigPath']); + + if (isset($options['operationsClient'])) { + return $options['operationsClient']; + } + + return new OperationsClient($options); + } + + /** + * Formats a string containing the fully-qualified path to represent a connection + * resource. + * + * @param string $project + * @param string $location + * @param string $connection + * + * @return string The formatted connection resource. + */ + public static function connectionName(string $project, string $location, string $connection): string + { + return self::getPathTemplate('connection')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * git_repository_link resource. + * + * @param string $project + * @param string $location + * @param string $connection + * @param string $gitRepositoryLink + * + * @return string The formatted git_repository_link resource. + */ + public static function gitRepositoryLinkName(string $project, string $location, string $connection, string $gitRepositoryLink): string + { + return self::getPathTemplate('gitRepositoryLink')->render([ + 'project' => $project, + 'location' => $location, + 'connection' => $connection, + 'git_repository_link' => $gitRepositoryLink, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName(string $project, string $location): string + { + return self::getPathTemplate('location')->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * secret_version resource. + * + * @param string $project + * @param string $secret + * @param string $secretVersion + * + * @return string The formatted secret_version resource. + */ + public static function secretVersionName(string $project, string $secret, string $secretVersion): string + { + return self::getPathTemplate('secretVersion')->render([ + 'project' => $project, + 'secret' => $secret, + 'secret_version' => $secretVersion, + ]); + } + + /** + * 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(string $project, string $location, string $namespace, string $service): string + { + return self::getPathTemplate('service')->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} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} + * - gitRepositoryLink: projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link} + * - location: projects/{project}/locations/{location} + * - secretVersion: projects/{project}/secrets/{secret}/versions/{secret_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(string $formattedName, string $template = null): array + { + return self::parseFormattedName($formattedName, $template); + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'developerconnect.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Creates a new Connection in a given project and location. + * + * The async variant is {@see DeveloperConnectClient::createConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/create_connection.php + * + * @param CreateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createConnection(CreateConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateConnection', $request, $callOptions)->wait(); + } + + /** + * Creates a GitRepositoryLink. Upon linking a Git Repository, Developer + * Connect will configure the Git Repository to send webhook events to + * Developer Connect. Connections that use Firebase GitHub Application will + * have events forwarded to the Firebase service. All other Connections will + * have events forwarded to Cloud Build. + * + * The async variant is + * {@see DeveloperConnectClient::createGitRepositoryLinkAsync()} . + * + * @example samples/V1/DeveloperConnectClient/create_git_repository_link.php + * + * @param CreateGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createGitRepositoryLink(CreateGitRepositoryLinkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * Deletes a single Connection. + * + * The async variant is {@see DeveloperConnectClient::deleteConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/delete_connection.php + * + * @param DeleteConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteConnection(DeleteConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteConnection', $request, $callOptions)->wait(); + } + + /** + * Deletes a single GitRepositoryLink. + * + * The async variant is + * {@see DeveloperConnectClient::deleteGitRepositoryLinkAsync()} . + * + * @example samples/V1/DeveloperConnectClient/delete_git_repository_link.php + * + * @param DeleteGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteGitRepositoryLink(DeleteGitRepositoryLinkRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * FetchGitHubInstallations returns the list of GitHub Installations that + * are available to be added to a Connection. + * For github.com, only installations accessible to the authorizer token + * are returned. For GitHub Enterprise, all installations are returned. + * + * The async variant is + * {@see DeveloperConnectClient::fetchGitHubInstallationsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_git_hub_installations.php + * + * @param FetchGitHubInstallationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchGitHubInstallationsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchGitHubInstallations(FetchGitHubInstallationsRequest $request, array $callOptions = []): FetchGitHubInstallationsResponse + { + return $this->startApiCall('FetchGitHubInstallations', $request, $callOptions)->wait(); + } + + /** + * Fetch the list of branches or tags for a given repository. + * + * The async variant is {@see DeveloperConnectClient::fetchGitRefsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_git_refs.php + * + * @param FetchGitRefsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchGitRefs(FetchGitRefsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('FetchGitRefs', $request, $callOptions); + } + + /** + * FetchLinkableGitRepositories returns a list of git repositories from an SCM + * that are available to be added to a Connection. + * + * The async variant is + * {@see DeveloperConnectClient::fetchLinkableGitRepositoriesAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_linkable_git_repositories.php + * + * @param FetchLinkableGitRepositoriesRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchLinkableGitRepositories(FetchLinkableGitRepositoriesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('FetchLinkableGitRepositories', $request, $callOptions); + } + + /** + * Fetches read token of a given gitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::fetchReadTokenAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_read_token.php + * + * @param FetchReadTokenRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchReadTokenResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchReadToken(FetchReadTokenRequest $request, array $callOptions = []): FetchReadTokenResponse + { + return $this->startApiCall('FetchReadToken', $request, $callOptions)->wait(); + } + + /** + * Fetches read/write token of a given gitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::fetchReadWriteTokenAsync()} . + * + * @example samples/V1/DeveloperConnectClient/fetch_read_write_token.php + * + * @param FetchReadWriteTokenRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return FetchReadWriteTokenResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchReadWriteToken(FetchReadWriteTokenRequest $request, array $callOptions = []): FetchReadWriteTokenResponse + { + return $this->startApiCall('FetchReadWriteToken', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single Connection. + * + * The async variant is {@see DeveloperConnectClient::getConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/get_connection.php + * + * @param GetConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Connection + * + * @throws ApiException Thrown if the API call fails. + */ + public function getConnection(GetConnectionRequest $request, array $callOptions = []): Connection + { + return $this->startApiCall('GetConnection', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single GitRepositoryLink. + * + * The async variant is {@see DeveloperConnectClient::getGitRepositoryLinkAsync()} + * . + * + * @example samples/V1/DeveloperConnectClient/get_git_repository_link.php + * + * @param GetGitRepositoryLinkRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return GitRepositoryLink + * + * @throws ApiException Thrown if the API call fails. + */ + public function getGitRepositoryLink(GetGitRepositoryLinkRequest $request, array $callOptions = []): GitRepositoryLink + { + return $this->startApiCall('GetGitRepositoryLink', $request, $callOptions)->wait(); + } + + /** + * Lists Connections in a given project and location. + * + * The async variant is {@see DeveloperConnectClient::listConnectionsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_connections.php + * + * @param ListConnectionsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listConnections(ListConnectionsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListConnections', $request, $callOptions); + } + + /** + * Lists GitRepositoryLinks in a given project, location, and connection. + * + * The async variant is + * {@see DeveloperConnectClient::listGitRepositoryLinksAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_git_repository_links.php + * + * @param ListGitRepositoryLinksRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listGitRepositoryLinks(ListGitRepositoryLinksRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListGitRepositoryLinks', $request, $callOptions); + } + + /** + * Updates the parameters of a single Connection. + * + * The async variant is {@see DeveloperConnectClient::updateConnectionAsync()} . + * + * @example samples/V1/DeveloperConnectClient/update_connection.php + * + * @param UpdateConnectionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateConnection(UpdateConnectionRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('UpdateConnection', $request, $callOptions)->wait(); + } + + /** + * Gets information about a location. + * + * The async variant is {@see DeveloperConnectClient::getLocationAsync()} . + * + * @example samples/V1/DeveloperConnectClient/get_location.php + * + * @param GetLocationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return Location + * + * @throws ApiException Thrown if the API call fails. + */ + public function getLocation(GetLocationRequest $request, array $callOptions = []): Location + { + return $this->startApiCall('GetLocation', $request, $callOptions)->wait(); + } + + /** + * Lists information about the supported locations for this service. + * + * The async variant is {@see DeveloperConnectClient::listLocationsAsync()} . + * + * @example samples/V1/DeveloperConnectClient/list_locations.php + * + * @param ListLocationsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listLocations(ListLocationsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListLocations', $request, $callOptions); + } +} diff --git a/owl-bot-staging/DeveloperConnect/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DeveloperConnect/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..5608238a31fe --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/src/V1/gapic_metadata.json @@ -0,0 +1,98 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.developerconnect.v1", + "libraryPackage": "Google\\Cloud\\DeveloperConnect\\V1", + "services": { + "DeveloperConnect": { + "clients": { + "grpc": { + "libraryClient": "DeveloperConnectGapicClient", + "rpcs": { + "CreateConnection": { + "methods": [ + "createConnection" + ] + }, + "CreateGitRepositoryLink": { + "methods": [ + "createGitRepositoryLink" + ] + }, + "DeleteConnection": { + "methods": [ + "deleteConnection" + ] + }, + "DeleteGitRepositoryLink": { + "methods": [ + "deleteGitRepositoryLink" + ] + }, + "FetchGitHubInstallations": { + "methods": [ + "fetchGitHubInstallations" + ] + }, + "FetchGitRefs": { + "methods": [ + "fetchGitRefs" + ] + }, + "FetchLinkableGitRepositories": { + "methods": [ + "fetchLinkableGitRepositories" + ] + }, + "FetchReadToken": { + "methods": [ + "fetchReadToken" + ] + }, + "FetchReadWriteToken": { + "methods": [ + "fetchReadWriteToken" + ] + }, + "GetConnection": { + "methods": [ + "getConnection" + ] + }, + "GetGitRepositoryLink": { + "methods": [ + "getGitRepositoryLink" + ] + }, + "ListConnections": { + "methods": [ + "listConnections" + ] + }, + "ListGitRepositoryLinks": { + "methods": [ + "listGitRepositoryLinks" + ] + }, + "UpdateConnection": { + "methods": [ + "updateConnection" + ] + }, + "GetLocation": { + "methods": [ + "getLocation" + ] + }, + "ListLocations": { + "methods": [ + "listLocations" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_client_config.json b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_client_config.json new file mode 100644 index 000000000000..06fd6f7d2aec --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_client_config.json @@ -0,0 +1,114 @@ +{ + "interfaces": { + "google.cloud.developerconnect.v1.DeveloperConnect": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + } + }, + "methods": { + "CreateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "CreateGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "DeleteGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchGitHubInstallations": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchGitRefs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "FetchLinkableGitRepositories": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchReadToken": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "FetchReadWriteToken": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetGitRepositoryLink": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListConnections": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ListGitRepositoryLinks": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateConnection": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "GetLocation": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListLocations": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_descriptor_config.php b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_descriptor_config.php new file mode 100644 index 000000000000..a0ff262b35ef --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_descriptor_config.php @@ -0,0 +1,306 @@ + [ + 'google.cloud.developerconnect.v1.DeveloperConnect' => [ + 'CreateConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\Connection', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'CreateGitRepositoryLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\GitRepositoryLink', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'DeleteConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGitRepositoryLink' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\DeveloperConnect\V1\Connection', + 'metadataReturnType' => '\Google\Cloud\DeveloperConnect\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'connection.name', + 'fieldAccessors' => [ + 'getConnection', + 'getName', + ], + ], + ], + ], + 'FetchGitHubInstallations' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchGitHubInstallationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'connection', + 'fieldAccessors' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchGitRefs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getRefNames', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchGitRefsResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchLinkableGitRepositories' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLinkableGitRepositories', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchLinkableGitRepositoriesResponse', + 'headerParams' => [ + [ + 'keyName' => 'connection', + 'fieldAccessors' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchReadToken' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchReadTokenResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchReadWriteToken' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\FetchReadWriteTokenResponse', + 'headerParams' => [ + [ + 'keyName' => 'git_repository_link', + 'fieldAccessors' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'GetConnection' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\Connection', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetGitRepositoryLink' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\GitRepositoryLink', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'ListConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\ListConnectionsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListGitRepositoryLinks' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getGitRepositoryLinks', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\DeveloperConnect\V1\ListGitRepositoryLinksResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'GetLocation' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Location\Location', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'ListLocations' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getLocations', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Location\ListLocationsResponse', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + 'interfaceOverride' => 'google.cloud.location.Locations', + ], + 'templateMap' => [ + 'connection' => 'projects/{project}/locations/{location}/connections/{connection}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', + 'gitRepositoryLink' => 'projects/{project}/locations/{location}/connections/{connection}/gitRepositoryLinks/{git_repository_link}', + 'location' => 'projects/{project}/locations/{location}', + 'secretVersion' => 'projects/{project}/secrets/{secret}/versions/{secret_version}', + 'service' => 'projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}', + ], + ], + ], +]; diff --git a/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_rest_client_config.php b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_rest_client_config.php new file mode 100644 index 000000000000..d9554a9a05f1 --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/src/V1/resources/developer_connect_rest_client_config.php @@ -0,0 +1,269 @@ + [ + 'google.cloud.developerconnect.v1.DeveloperConnect' => [ + 'CreateConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'body' => 'connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'connection_id', + ], + ], + 'CreateGitRepositoryLink' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/connections/*}/gitRepositoryLinks', + 'body' => 'git_repository_link', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'git_repository_link_id', + ], + ], + 'DeleteConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteGitRepositoryLink' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'FetchGitHubInstallations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{connection=projects/*/locations/*/connections/*}:fetchGitHubInstallations', + 'placeholders' => [ + 'connection' => [ + 'getters' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchGitRefs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchGitRefs', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchLinkableGitRepositories' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{connection=projects/*/locations/*/connections/*}:fetchLinkableGitRepositories', + 'placeholders' => [ + 'connection' => [ + 'getters' => [ + 'getConnection', + ], + ], + ], + ], + 'FetchReadToken' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchReadToken', + 'body' => '*', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'FetchReadWriteToken' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{git_repository_link=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchReadWriteToken', + 'body' => '*', + 'placeholders' => [ + 'git_repository_link' => [ + 'getters' => [ + 'getGitRepositoryLink', + ], + ], + ], + ], + 'GetConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetGitRepositoryLink' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/connections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListGitRepositoryLinks' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/connections/*}/gitRepositoryLinks', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateConnection' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{connection.name=projects/*/locations/*/connections/*}', + 'body' => 'connection', + 'placeholders' => [ + 'connection.name' => [ + 'getters' => [ + 'getConnection', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'update_mask', + ], + ], + ], + 'google.cloud.location.Locations' => [ + 'GetLocation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListLocations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/locations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/DeveloperConnect/v1/tests/Unit/V1/Client/DeveloperConnectClientTest.php b/owl-bot-staging/DeveloperConnect/v1/tests/Unit/V1/Client/DeveloperConnectClientTest.php new file mode 100644 index 000000000000..8bc713e940cc --- /dev/null +++ b/owl-bot-staging/DeveloperConnect/v1/tests/Unit/V1/Client/DeveloperConnectClientTest.php @@ -0,0 +1,1606 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DeveloperConnectClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DeveloperConnectClient($options); + } + + /** @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'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $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]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/CreateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConnectionId(); + $this->assertProtobufEquals($connectionId, $actualValue); + $actualValue = $actualApiRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $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]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnection($request); + $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 createGitRepositoryLinkTest() + { + $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/createGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $cloneUri = 'cloneUri-625288310'; + $etag = 'etag3123477'; + $reconciling = false; + $uid = 'uid115792'; + $webhookId = 'webhookId311874531'; + $expectedResponse = new GitRepositoryLink(); + $expectedResponse->setName($name); + $expectedResponse->setCloneUri($cloneUri); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setUid($uid); + $expectedResponse->setWebhookId($webhookId); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGitRepositoryLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gitRepositoryLink = new GitRepositoryLink(); + $gitRepositoryLinkCloneUri = 'gitRepositoryLinkCloneUri754275269'; + $gitRepositoryLink->setCloneUri($gitRepositoryLinkCloneUri); + $gitRepositoryLinkId = 'gitRepositoryLinkId1580978456'; + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + $response = $gapicClient->createGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/CreateGitRepositoryLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($gitRepositoryLink, $actualValue); + $actualValue = $actualApiRequestObject->getGitRepositoryLinkId(); + $this->assertProtobufEquals($gitRepositoryLinkId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGitRepositoryLinkTest'); + $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 createGitRepositoryLinkExceptionTest() + { + $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/createGitRepositoryLinkTest'); + $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]'); + $gitRepositoryLink = new GitRepositoryLink(); + $gitRepositoryLinkCloneUri = 'gitRepositoryLinkCloneUri754275269'; + $gitRepositoryLink->setCloneUri($gitRepositoryLinkCloneUri); + $gitRepositoryLinkId = 'gitRepositoryLinkId1580978456'; + $request = (new CreateGitRepositoryLinkRequest()) + ->setParent($formattedParent) + ->setGitRepositoryLink($gitRepositoryLink) + ->setGitRepositoryLinkId($gitRepositoryLinkId); + $response = $gapicClient->createGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGitRepositoryLinkTest'); + 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]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/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]'); + $request = (new DeleteConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteConnection($request); + $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 deleteGitRepositoryLinkTest() + { + $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/deleteGitRepositoryLinkTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteGitRepositoryLinkTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new DeleteGitRepositoryLinkRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/DeleteGitRepositoryLink', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGitRepositoryLinkTest'); + $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 deleteGitRepositoryLinkExceptionTest() + { + $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/deleteGitRepositoryLinkTest'); + $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->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new DeleteGitRepositoryLinkRequest()) + ->setName($formattedName); + $response = $gapicClient->deleteGitRepositoryLink($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteGitRepositoryLinkTest'); + 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 fetchGitHubInstallationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FetchGitHubInstallationsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchGitHubInstallationsRequest()) + ->setConnection($formattedConnection); + $response = $gapicClient->fetchGitHubInstallations($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchGitHubInstallations', $actualFuncCall); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($formattedConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchGitHubInstallationsExceptionTest() + { + $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]'); + $request = (new FetchGitHubInstallationsRequest()) + ->setConnection($formattedConnection); + try { + $gapicClient->fetchGitHubInstallations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchGitRefsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $refNamesElement = 'refNamesElement2048025177'; + $refNames = [ + $refNamesElement, + ]; + $expectedResponse = new FetchGitRefsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setRefNames($refNames); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $refType = RefType::REF_TYPE_UNSPECIFIED; + $request = (new FetchGitRefsRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink) + ->setRefType($refType); + $response = $gapicClient->fetchGitRefs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getRefNames()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchGitRefs', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $actualValue); + $actualValue = $actualRequestObject->getRefType(); + $this->assertProtobufEquals($refType, $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 + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $refType = RefType::REF_TYPE_UNSPECIFIED; + $request = (new FetchGitRefsRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink) + ->setRefType($refType); + try { + $gapicClient->fetchGitRefs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchLinkableGitRepositoriesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $linkableGitRepositoriesElement = new LinkableGitRepository(); + $linkableGitRepositories = [ + $linkableGitRepositoriesElement, + ]; + $expectedResponse = new FetchLinkableGitRepositoriesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLinkableGitRepositories($linkableGitRepositories); + $transport->addResponse($expectedResponse); + // Mock request + $formattedConnection = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new FetchLinkableGitRepositoriesRequest()) + ->setConnection($formattedConnection); + $response = $gapicClient->fetchLinkableGitRepositories($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLinkableGitRepositories()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchLinkableGitRepositories', $actualFuncCall); + $actualValue = $actualRequestObject->getConnection(); + $this->assertProtobufEquals($formattedConnection, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchLinkableGitRepositoriesExceptionTest() + { + $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]'); + $request = (new FetchLinkableGitRepositoriesRequest()) + ->setConnection($formattedConnection); + try { + $gapicClient->fetchLinkableGitRepositories($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadTokenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $token = 'token110541305'; + $gitUsername = 'gitUsername-786639197'; + $expectedResponse = new FetchReadTokenResponse(); + $expectedResponse->setToken($token); + $expectedResponse->setGitUsername($gitUsername); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new FetchReadTokenRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink); + $response = $gapicClient->fetchReadToken($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchReadToken', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $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 + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new FetchReadTokenRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink); + try { + $gapicClient->fetchReadToken($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchReadWriteTokenTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $token = 'token110541305'; + $gitUsername = 'gitUsername-786639197'; + $expectedResponse = new FetchReadWriteTokenResponse(); + $expectedResponse->setToken($token); + $expectedResponse->setGitUsername($gitUsername); + $transport->addResponse($expectedResponse); + // Mock request + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new FetchReadWriteTokenRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink); + $response = $gapicClient->fetchReadWriteToken($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/FetchReadWriteToken', $actualFuncCall); + $actualValue = $actualRequestObject->getGitRepositoryLink(); + $this->assertProtobufEquals($formattedGitRepositoryLink, $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 + $formattedGitRepositoryLink = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new FetchReadWriteTokenRequest()) + ->setGitRepositoryLink($formattedGitRepositoryLink); + try { + $gapicClient->fetchReadWriteToken($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $disabled = true; + $reconciling = false; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + $response = $gapicClient->getConnection($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/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]'); + $request = (new GetConnectionRequest()) + ->setName($formattedName); + try { + $gapicClient->getConnection($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGitRepositoryLinkTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $cloneUri = 'cloneUri-625288310'; + $etag = 'etag3123477'; + $reconciling = false; + $uid = 'uid115792'; + $webhookId = 'webhookId311874531'; + $expectedResponse = new GitRepositoryLink(); + $expectedResponse->setName($name2); + $expectedResponse->setCloneUri($cloneUri); + $expectedResponse->setEtag($etag); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setUid($uid); + $expectedResponse->setWebhookId($webhookId); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new GetGitRepositoryLinkRequest()) + ->setName($formattedName); + $response = $gapicClient->getGitRepositoryLink($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/GetGitRepositoryLink', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGitRepositoryLinkExceptionTest() + { + $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->gitRepositoryLinkName('[PROJECT]', '[LOCATION]', '[CONNECTION]', '[GIT_REPOSITORY_LINK]'); + $request = (new GetGitRepositoryLinkRequest()) + ->setName($formattedName); + try { + $gapicClient->getGitRepositoryLink($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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]'); + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listConnections($request); + $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.cloud.developerconnect.v1.DeveloperConnect/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]'); + $request = (new ListConnectionsRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listConnections($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGitRepositoryLinksTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $gitRepositoryLinksElement = new GitRepositoryLink(); + $gitRepositoryLinks = [ + $gitRepositoryLinksElement, + ]; + $expectedResponse = new ListGitRepositoryLinksResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGitRepositoryLinks($gitRepositoryLinks); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $request = (new ListGitRepositoryLinksRequest()) + ->setParent($formattedParent); + $response = $gapicClient->listGitRepositoryLinks($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGitRepositoryLinks()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/ListGitRepositoryLinks', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGitRepositoryLinksExceptionTest() + { + $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]'); + $request = (new ListGitRepositoryLinksRequest()) + ->setParent($formattedParent); + try { + $gapicClient->listGitRepositoryLinks($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function 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; + $etag = 'etag3123477'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $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 + $updateMask = new FieldMask(); + $connection = new Connection(); + $request = (new UpdateConnectionRequest()) + ->setUpdateMask($updateMask) + ->setConnection($connection); + $response = $gapicClient->updateConnection($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/UpdateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getUpdateMask(); + $this->assertProtobufEquals($updateMask, $actualValue); + $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 + $updateMask = new FieldMask(); + $connection = new Connection(); + $request = (new UpdateConnectionRequest()) + ->setUpdateMask($updateMask) + ->setConnection($connection); + $response = $gapicClient->updateConnection($request); + $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 getLocationTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $locationId = 'locationId552319461'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Location(); + $expectedResponse->setName($name2); + $expectedResponse->setLocationId($locationId); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + $request = new GetLocationRequest(); + $response = $gapicClient->getLocation($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/GetLocation', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getLocationExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new GetLocationRequest(); + try { + $gapicClient->getLocation($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $locationsElement = new Location(); + $locations = [ + $locationsElement, + ]; + $expectedResponse = new ListLocationsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setLocations($locations); + $transport->addResponse($expectedResponse); + $request = new ListLocationsRequest(); + $response = $gapicClient->listLocations($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getLocations()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.location.Locations/ListLocations', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listLocationsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + $request = new ListLocationsRequest(); + try { + $gapicClient->listLocations($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function createConnectionAsyncTest() + { + $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'; + $uid = 'uid115792'; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setDisabled($disabled); + $expectedResponse->setReconciling($reconciling); + $expectedResponse->setEtag($etag); + $expectedResponse->setUid($uid); + $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]'); + $connectionId = 'connectionId-513204708'; + $connection = new Connection(); + $request = (new CreateConnectionRequest()) + ->setParent($formattedParent) + ->setConnectionId($connectionId) + ->setConnection($connection); + $response = $gapicClient->createConnectionAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.developerconnect.v1.DeveloperConnect/CreateConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getConnectionId(); + $this->assertProtobufEquals($connectionId, $actualValue); + $actualValue = $actualApiRequestObject->getConnection(); + $this->assertProtobufEquals($connection, $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()); + } +}