From 51aff29602c3eb4c18f001ce6fb3178a80bf0020 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 May 2022 17:55:54 +0000 Subject: [PATCH 1/2] chore: remove unused imports PiperOrigin-RevId: 446472466 Source-Link: https://github.com/googleapis/googleapis/commit/9911f3438e504db47fd552a65937194e4e5ccd4e Source-Link: https://github.com/googleapis/googleapis-gen/commit/a82ecd7f5cfdbdee7a7f5e4d34cb5a354893b945 Copy-Tag: eyJwIjoiRXZlbnRhcmMvLk93bEJvdC55YW1sIiwiaCI6ImE4MmVjZDdmNWNmZGJkZWU3YTdmNWU0ZDM0Y2I1YTM1NDg5M2I5NDUifQ== --- .../Google/Cloud/Eventarc/V1/Channel.php | Bin 0 -> 1556 bytes .../Cloud/Eventarc/V1/ChannelConnection.php | 39 + .../Google/Cloud/Eventarc/V1/Eventarc.php | 146 ++ .../Google/Cloud/Eventarc/V1/Trigger.php | Bin 0 -> 2547 bytes .../src/Google/Cloud/Eventarc/V1/Channel.php | 370 ++++ .../Cloud/Eventarc/V1/Channel/State.php | 82 + .../Cloud/Eventarc/V1/ChannelConnection.php | 284 +++ .../Cloud/Eventarc/V1/Channel_State.php | 16 + .../src/Google/Cloud/Eventarc/V1/CloudRun.php | 155 ++ .../V1/CreateChannelConnectionRequest.php | 145 ++ .../Eventarc/V1/CreateChannelRequest.php | 183 ++ .../Eventarc/V1/CreateTriggerRequest.php | 183 ++ .../V1/DeleteChannelConnectionRequest.php | 67 + .../Eventarc/V1/DeleteChannelRequest.php | 105 ++ .../Eventarc/V1/DeleteTriggerRequest.php | 181 ++ .../Google/Cloud/Eventarc/V1/Destination.php | 150 ++ .../Google/Cloud/Eventarc/V1/EventFilter.php | 155 ++ .../Cloud/Eventarc/V1/EventarcGrpcClient.php | 246 +++ .../src/Google/Cloud/Eventarc/V1/GKE.php | 223 +++ .../V1/GetChannelConnectionRequest.php | 67 + .../Cloud/Eventarc/V1/GetChannelRequest.php | 67 + .../Cloud/Eventarc/V1/GetTriggerRequest.php | 67 + .../V1/ListChannelConnectionsRequest.php | 151 ++ .../V1/ListChannelConnectionsResponse.php | 147 ++ .../Cloud/Eventarc/V1/ListChannelsRequest.php | 197 ++ .../Eventarc/V1/ListChannelsResponse.php | 139 ++ .../Cloud/Eventarc/V1/ListTriggersRequest.php | 197 ++ .../Eventarc/V1/ListTriggersResponse.php | 139 ++ .../Cloud/Eventarc/V1/OperationMetadata.php | 303 +++ .../src/Google/Cloud/Eventarc/V1/Pubsub.php | 129 ++ .../Google/Cloud/Eventarc/V1/Transport.php | 79 + .../src/Google/Cloud/Eventarc/V1/Trigger.php | 535 ++++++ .../Eventarc/V1/UpdateChannelRequest.php | 167 ++ .../Eventarc/V1/UpdateTriggerRequest.php | 205 +++ .../Eventarc/v1/src/V1/EventarcClient.php | 34 + .../v1/src/V1/Gapic/EventarcGapicClient.php | 1410 ++++++++++++++ .../Eventarc/v1/src/V1/gapic_metadata.json | 88 + .../V1/resources/eventarc_client_config.json | 92 + .../resources/eventarc_descriptor_config.php | 118 ++ .../resources/eventarc_rest_client_config.php | 334 ++++ .../v1/tests/Unit/V1/EventarcClientTest.php | 1622 +++++++++++++++++ 41 files changed, 9017 insertions(+) create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/ChannelConnection.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CloudRun.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/Gapic/EventarcGapicClient.php create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php create mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php create mode 100644 owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php new file mode 100644 index 0000000000000000000000000000000000000000..7f8a693bb823291fd60bac23dfe4ec6fa3ecc54e GIT binary patch literal 1556 zcma)6-EPw`7+qVob>4)!NRz?_ni+_72oiO0l`^1RyV47~ij`iVNR#Wjts%1`$EgHU zUx?R$E1rVu-SPrBiIYz1CapJh?C%_(@5krOJAdMXC$L2r5lE6D9DIjzLZC0WJec<*f@oq(;jR#+P%jL8t_nH;=nQIV~^O_&{v7H|om`uX9&qZkGf zN%i-X2IrJfNs&i?s2q;q2zdcf*u~gU$grfG!3c25Fex9vgfohL>T{Lz5lr=TqcW%x zxNRnhV90YDB*23Dl8deib(}GgS@EKs@`1iKqN5{NPBc2sg2*E%MM$pS4xu126s#KS zjtFMi%DtglHJ`dClz78BnV>1VecSdF9=uy=~i7xz`Z;Z?M@-5Xx zs||-)jZV}Qm9wm(9QVPm74YnC<71dfoE49mm5!M;t!zKg49KUp(3vGOx4o;6;t5pU zv}Gzk3E2Br0IPbyj7@Ma8c{O`bLF*q;cqQ(lt3Y*Lo=W56pYtk9Sfo!%y~p*E~}IE z!);58OYgC=GDSQwD)iO3Yt+i!P+Op=2&Z&Ngt?kZ$QwIgL%o6^9Gpw;Q*0K~qr!(J zqY9Rzxg+M9+P#11?x)fg>SpP@t+OaT(fJ6Jka{Fj^|&}w^xp_GK}NsV1j})-u?05I zdbM8j{B!55+dOWcw4066lCcg}yUk9c-D#C_1^_Fy<6gVpEai<2P;7VfSHTIcYChP_ zTA0*MbuX}#+1P129F_Z5f@NS|>ebBlIF6;My>vNCZAR_k#42Xbi+U9tuIg2N9jr-# zSm1LZ>%Vj0p}OnV+SE6+if&{B-Q1V=y1`@aAvU(S7~5mQlrG8bx&B2DtfpE1%$u#) z>8#l4tkmhOe&tVk-tl`yu_OMinternalAddGeneratedFile( + ' +Œ +1google/cloud/eventarc/v1/channel_connection.protogoogle.cloud.eventarc.v1google/api/resource.protogoogle/protobuf/timestamp.proto"§ +ChannelConnection +name ( BàA +uid ( BàA8 +channel ( B\'àAúA! +eventarc.googleapis.com/Channel4 + create_time ( 2.google.protobuf.TimestampBàA4 + update_time ( 2.google.protobuf.TimestampBàA +activation_token ( BàA:§êA£ +)eventarc.googleapis.com/ChannelConnectionOprojects/{project}/locations/{location}/channelConnections/{channel_connection}*channelConnections2channelConnectionBÎ +com.google.cloud.eventarc.v1BChannelConnectionProtoPZ@google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarcªGoogle.Cloud.Eventarc.V1ÊGoogle\\Cloud\\Eventarc\\V1êGoogle::Cloud::Eventarc::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php new file mode 100644 index 000000000000..a02b576e6a2a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php @@ -0,0 +1,146 @@ +internalAddGeneratedFile( + ' +0 +\'google/cloud/eventarc/v1/eventarc.protogoogle.cloud.eventarc.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/eventarc/v1/channel.proto1google/cloud/eventarc/v1/channel_connection.proto&google/cloud/eventarc/v1/trigger.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"J +GetTriggerRequest5 +name ( B\'àAúA! +eventarc.googleapis.com/Trigger"‡ +ListTriggersRequest7 +parent ( B\'àAúA!eventarc.googleapis.com/Trigger + page_size ( + +page_token (  +order_by ( "y +ListTriggersResponse3 +triggers ( 2!.google.cloud.eventarc.v1.Trigger +next_page_token (  + unreachable ( "½ +CreateTriggerRequest7 +parent ( B\'àAúA!eventarc.googleapis.com/Trigger7 +trigger ( 2!.google.cloud.eventarc.v1.TriggerBàA + +trigger_id ( BàA + validate_only (BàA"® +UpdateTriggerRequest2 +trigger ( 2!.google.cloud.eventarc.v1.Trigger/ + update_mask ( 2.google.protobuf.FieldMask + allow_missing ( + validate_only (BàA"Ž +DeleteTriggerRequest5 +name ( B\'àAúA! +eventarc.googleapis.com/Trigger +etag (  + allow_missing ( + validate_only (BàA"J +GetChannelRequest5 +name ( B\'àAúA! +eventarc.googleapis.com/Channel"‡ +ListChannelsRequest7 +parent ( B\'àAúA!eventarc.googleapis.com/Channel + page_size ( + +page_token (  +order_by ( "y +ListChannelsResponse3 +channels ( 2!.google.cloud.eventarc.v1.Channel +next_page_token (  + unreachable ( "½ +CreateChannelRequest7 +parent ( B\'àAúA!eventarc.googleapis.com/Channel7 +channel ( 2!.google.cloud.eventarc.v1.ChannelBàA + +channel_id ( BàA + validate_only (BàA"— +UpdateChannelRequest2 +channel ( 2!.google.cloud.eventarc.v1.Channel/ + update_mask ( 2.google.protobuf.FieldMask + validate_only (BàA"i +DeleteChannelRequest5 +name ( B\'àAúA! +eventarc.googleapis.com/Channel + validate_only (BàA"^ +GetChannelConnectionRequest? +name ( B1àAúA+ +)eventarc.googleapis.com/ChannelConnection"‰ +ListChannelConnectionsRequestA +parent ( B1àAúA+)eventarc.googleapis.com/ChannelConnection + page_size ( + +page_token ( "˜ +ListChannelConnectionsResponseH +channel_connections ( 2+.google.cloud.eventarc.v1.ChannelConnection +next_page_token (  + unreachable ( "Õ +CreateChannelConnectionRequestA +parent ( B1àAúA+)eventarc.googleapis.com/ChannelConnectionL +channel_connection ( 2+.google.cloud.eventarc.v1.ChannelConnectionBàA" +channel_connection_id ( BàA"a +DeleteChannelConnectionRequest? +name ( B1àAúA+ +)eventarc.googleapis.com/ChannelConnection"€ +OperationMetadata4 + create_time ( 2.google.protobuf.TimestampBàA1 +end_time ( 2.google.protobuf.TimestampBàA +target ( BàA +verb ( BàA +status_message ( BàA# +requested_cancellation (BàA + api_version ( BàA2™ +Eventarc™ + +GetTrigger+.google.cloud.eventarc.v1.GetTriggerRequest!.google.cloud.eventarc.v1.Trigger";‚Óä“.,/v1/{name=projects/*/locations/*/triggers/*}ÚAname¬ + ListTriggers-.google.cloud.eventarc.v1.ListTriggersRequest..google.cloud.eventarc.v1.ListTriggersResponse"=‚Óä“.,/v1/{parent=projects/*/locations/*}/triggersÚAparentØ + CreateTrigger..google.cloud.eventarc.v1.CreateTriggerRequest.google.longrunning.Operation"x‚Óä“7",/v1/{parent=projects/*/locations/*}/triggers:triggerÚAparent,trigger,trigger_idÊA +TriggerOperationMetadataé + UpdateTrigger..google.cloud.eventarc.v1.UpdateTriggerRequest.google.longrunning.Operation"ˆ‚Óä“?24/v1/{trigger.name=projects/*/locations/*/triggers/*}:triggerÚA!trigger,update_mask,allow_missingÊA +TriggerOperationMetadataÈ + DeleteTrigger..google.cloud.eventarc.v1.DeleteTriggerRequest.google.longrunning.Operation"h‚Óä“.*,/v1/{name=projects/*/locations/*/triggers/*}ÚAname,allow_missingÊA +TriggerOperationMetadata™ + +GetChannel+.google.cloud.eventarc.v1.GetChannelRequest!.google.cloud.eventarc.v1.Channel";‚Óä“.,/v1/{name=projects/*/locations/*/channels/*}ÚAname¬ + ListChannels-.google.cloud.eventarc.v1.ListChannelsRequest..google.cloud.eventarc.v1.ListChannelsResponse"=‚Óä“.,/v1/{parent=projects/*/locations/*}/channelsÚAparentØ + CreateChannel..google.cloud.eventarc.v1.CreateChannelRequest.google.longrunning.Operation"x‚Óä“7",/v1/{parent=projects/*/locations/*}/channels:channelÚAparent,channel,channel_idÊA +ChannelOperationMetadataÚ + UpdateChannel..google.cloud.eventarc.v1.UpdateChannelRequest.google.longrunning.Operation"z‚Óä“?24/v1/{channel.name=projects/*/locations/*/channels/*}:channelÚAchannel,update_maskÊA +ChannelOperationMetadataº + DeleteChannel..google.cloud.eventarc.v1.DeleteChannelRequest.google.longrunning.Operation"Z‚Óä“.*,/v1/{name=projects/*/locations/*/channels/*}ÚAnameÊA +ChannelOperationMetadataÁ +GetChannelConnection5.google.cloud.eventarc.v1.GetChannelConnectionRequest+.google.cloud.eventarc.v1.ChannelConnection"E‚Óä“86/v1/{name=projects/*/locations/*/channelConnections/*}ÚAnameÔ +ListChannelConnections7.google.cloud.eventarc.v1.ListChannelConnectionsRequest8.google.cloud.eventarc.v1.ListChannelConnectionsResponse"G‚Óä“86/v1/{parent=projects/*/locations/*}/channelConnectionsÚAparent¢ +CreateChannelConnection8.google.cloud.eventarc.v1.CreateChannelConnectionRequest.google.longrunning.Operation"­‚Óä“L"6/v1/{parent=projects/*/locations/*}/channelConnections:channel_connectionÚA/parent,channel_connection,channel_connection_idÊA& +ChannelConnectionOperationMetadataâ +DeleteChannelConnection8.google.cloud.eventarc.v1.DeleteChannelConnectionRequest.google.longrunning.Operation"n‚Óä“8*6/v1/{name=projects/*/locations/*/channelConnections/*}ÚAnameÊA& +ChannelConnectionOperationMetadataKÊAeventarc.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÅ +com.google.cloud.eventarc.v1B EventarcProtoPZ@google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarcªGoogle.Cloud.Eventarc.V1ÊGoogle\\Cloud\\Eventarc\\V1êGoogle::Cloud::Eventarc::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php new file mode 100644 index 0000000000000000000000000000000000000000..213b42feec665681cca41206bccdc8e7be464cea GIT binary patch literal 2547 zcmb7GZBH9V5YE}b;4#ql`l1U;#m1x!q`_B6q*Nv}J(riHZ&;~Ssg)(PKCh20$K7df z&k{xcJN*OwAN>XWz-N8}pE|dndeHzE4 zlSP3uAov$0J)gTImQ>=uhde&y0hgTm{4cCwn+&KQGxWV`J4gao@-QH&!$IJ()isjE zOl==VA=bQ2@_gDU3BQ;J#!F;=Us^0`woKZJ6^`&KF6 zDVxur<_d-bbC`y*X7EdGbE%<|%g<>PFr{&nR}vxJwO8eKUOTX$>O359A4wQnbEJ%? zeUYDb1&W569|Rh$Ta|MMexM}nt*WYL?c6agofUY%>4^@B5XKFh zc>CAP!^s@Xmr(0t+j)Rf7X}un{BOtuXC*hzfZT$r6f}sVP)Mt$+*hWT(aB9yX9Fv! z__W9T*qT=Wtl#9BNzPBoem9WfG>h>G%(_Q32$*jzsOnW@Y&q(XXSw-Sd1)PL6V7H0 z%E#<9zC}7N~)kI?a$y^!RXL>cV{m@lt;$FTS z<&ueeT0BRO=kzMxoYkv(8)_4sHa~+ZmH4ff$hX*QzLjp)h)-cIj8er9g;mb0HtPQx zP@8C)`5dZ>U56qGRPnXV`gGKlc)v-4S9i=GU@>#dgoogle.cloud.eventarc.v1.Channel + */ +class Channel extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the channel. Must be unique within the location + * on the project and must be in + * `projects/{project}/locations/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server assigned unique identifier for the channel. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + * with the channel. This provider will be granted permissions to publish + * events to the channel. Format: + * `projects/{project}/locations/{location}/providers/{provider_id}`. + * + * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $provider = ''; + /** + * Output only. The state of a Channel. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The activation token for the channel. The token must be used by the + * provider to register the channel for publishing. + * + * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $activation_token = ''; + protected $transport; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the channel. Must be unique within the location + * on the project and must be in + * `projects/{project}/locations/{location}/channels/{channel_id}` format. + * @type string $uid + * Output only. Server assigned unique identifier for the channel. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type string $provider + * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + * with the channel. This provider will be granted permissions to publish + * events to the channel. Format: + * `projects/{project}/locations/{location}/providers/{provider_id}`. + * @type string $pubsub_topic + * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as + * a transport for the event delivery. Format: + * `projects/{project}/topics/{topic_id}`. + * @type int $state + * Output only. The state of a Channel. + * @type string $activation_token + * Output only. The activation token for the channel. The token must be used by the + * provider to register the channel for publishing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Channel::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the channel. Must be unique within the location + * on the project and must be in + * `projects/{project}/locations/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the channel. Must be unique within the location + * on the project and must be in + * `projects/{project}/locations/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned unique identifier for the channel. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned unique identifier for the channel. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + * with the channel. This provider will be granted permissions to publish + * events to the channel. Format: + * `projects/{project}/locations/{location}/providers/{provider_id}`. + * + * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProvider() + { + return $this->provider; + } + + /** + * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + * with the channel. This provider will be granted permissions to publish + * events to the channel. Format: + * `projects/{project}/locations/{location}/providers/{provider_id}`. + * + * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProvider($var) + { + GPBUtil::checkString($var, True); + $this->provider = $var; + + return $this; + } + + /** + * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as + * a transport for the event delivery. Format: + * `projects/{project}/topics/{topic_id}`. + * + * Generated from protobuf field string pubsub_topic = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getPubsubTopic() + { + return $this->readOneof(8); + } + + public function hasPubsubTopic() + { + return $this->hasOneof(8); + } + + /** + * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as + * a transport for the event delivery. Format: + * `projects/{project}/topics/{topic_id}`. + * + * Generated from protobuf field string pubsub_topic = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setPubsubTopic($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Output only. The state of a Channel. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of a Channel. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Eventarc\V1\Channel\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The activation token for the channel. The token must be used by the + * provider to register the channel for publishing. + * + * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getActivationToken() + { + return $this->activation_token; + } + + /** + * Output only. The activation token for the channel. The token must be used by the + * provider to register the channel for publishing. + * + * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActivationToken($var) + { + GPBUtil::checkString($var, True); + $this->activation_token = $var; + + return $this; + } + + /** + * @return string + */ + public function getTransport() + { + return $this->whichOneof("transport"); + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php new file mode 100644 index 000000000000..a7be8b4fc092 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php @@ -0,0 +1,82 @@ +google.cloud.eventarc.v1.Channel.State + */ +class State +{ + /** + * Default value. This value is unused. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The PENDING state indicates that a Channel has been created successfully + * and there is a new activation token available for the subscriber to use + * to convey the Channel to the provider in order to create a Connection. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The ACTIVE state indicates that a Channel has been successfully + * connected with the event provider. + * An ACTIVE Channel is ready to receive and route events from the + * event provider. + * + * Generated from protobuf enum ACTIVE = 2; + */ + const ACTIVE = 2; + /** + * The INACTIVE state means that the Channel cannot receive events + * permanently. There are two possible cases this state can happen: + * 1. The SaaS provider disconnected from this Channel. + * 2. The Channel activation token has expired but the SaaS provider + * wasn't connected. + * To re-establish a Connection with a provider, the subscriber + * should create a new Channel and give it to the provider. + * + * Generated from protobuf enum INACTIVE = 3; + */ + const INACTIVE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::ACTIVE => 'ACTIVE', + self::INACTIVE => 'INACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(State::class, \Google\Cloud\Eventarc\V1\Channel_State::class); + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php new file mode 100644 index 000000000000..1478f29772d9 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php @@ -0,0 +1,284 @@ +google.cloud.eventarc.v1.ChannelConnection + */ +class ChannelConnection extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the connection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server assigned ID of the resource. + * The server guarantees uniqueness and immutability until deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Required. The name of the connected subscriber Channel. + * This is a weak reference to avoid cross project and cross accounts + * references. This must be in + * `projects/{project}/location/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $channel = ''; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Input only. Activation token for the channel. The token will be used + * during the creation of ChannelConnection to bind the channel with the + * provider project. This field will not be stored in the provider resource. + * + * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $activation_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the connection. + * @type string $uid + * Output only. Server assigned ID of the resource. + * The server guarantees uniqueness and immutability until deleted. + * @type string $channel + * Required. The name of the connected subscriber Channel. + * This is a weak reference to avoid cross project and cross accounts + * references. This must be in + * `projects/{project}/location/{location}/channels/{channel_id}` format. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type string $activation_token + * Input only. Activation token for the channel. The token will be used + * during the creation of ChannelConnection to bind the channel with the + * provider project. This field will not be stored in the provider resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\ChannelConnection::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the connection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the connection. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server assigned ID of the resource. + * The server guarantees uniqueness and immutability until deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server assigned ID of the resource. + * The server guarantees uniqueness and immutability until deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Required. The name of the connected subscriber Channel. + * This is a weak reference to avoid cross project and cross accounts + * references. This must be in + * `projects/{project}/location/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getChannel() + { + return $this->channel; + } + + /** + * Required. The name of the connected subscriber Channel. + * This is a weak reference to avoid cross project and cross accounts + * references. This must be in + * `projects/{project}/location/{location}/channels/{channel_id}` format. + * + * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkString($var, True); + $this->channel = $var; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Input only. Activation token for the channel. The token will be used + * during the creation of ChannelConnection to bind the channel with the + * provider project. This field will not be stored in the provider resource. + * + * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getActivationToken() + { + return $this->activation_token; + } + + /** + * Input only. Activation token for the channel. The token will be used + * during the creation of ChannelConnection to bind the channel with the + * provider project. This field will not be stored in the provider resource. + * + * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setActivationToken($var) + { + GPBUtil::checkString($var, True); + $this->activation_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php new file mode 100644 index 000000000000..f91006931d59 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php @@ -0,0 +1,16 @@ +google.cloud.eventarc.v1.CloudRun + */ +class CloudRun extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Cloud Run service being addressed. See + * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. + * Only services located in the same project as the trigger object + * can be addressed. + * + * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $service = ''; + /** + * Optional. The relative path on the Cloud Run service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + /** + * Required. The region the Cloud Run service is deployed in. + * + * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $region = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $service + * Required. The name of the Cloud Run service being addressed. See + * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. + * Only services located in the same project as the trigger object + * can be addressed. + * @type string $path + * Optional. The relative path on the Cloud Run service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * @type string $region + * Required. The region the Cloud Run service is deployed in. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Cloud Run service being addressed. See + * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. + * Only services located in the same project as the trigger object + * can be addressed. + * + * 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 name of the Cloud Run service being addressed. See + * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. + * Only services located in the same project as the trigger object + * can be addressed. + * + * 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; + } + + /** + * Optional. The relative path on the Cloud Run service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. The relative path on the Cloud Run service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + + /** + * Required. The region the Cloud Run service is deployed in. + * + * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getRegion() + { + return $this->region; + } + + /** + * Required. The region the Cloud Run service is deployed in. + * + * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setRegion($var) + { + GPBUtil::checkString($var, True); + $this->region = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php new file mode 100644 index 000000000000..7935f51e19a7 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php @@ -0,0 +1,145 @@ +google.cloud.eventarc.v1.CreateChannelConnectionRequest + */ +class CreateChannelConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which to add this channel connection. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. Channel connection to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $channel_connection = null; + /** + * Required. The user-provided ID to be assigned to the channel connection. + * + * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $channel_connection_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which to add this channel connection. + * @type \Google\Cloud\Eventarc\V1\ChannelConnection $channel_connection + * Required. Channel connection to create. + * @type string $channel_connection_id + * Required. The user-provided ID to be assigned to the channel connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which to add this channel connection. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which to add this channel connection. + * + * 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. Channel connection to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Eventarc\V1\ChannelConnection|null + */ + public function getChannelConnection() + { + return $this->channel_connection; + } + + public function hasChannelConnection() + { + return isset($this->channel_connection); + } + + public function clearChannelConnection() + { + unset($this->channel_connection); + } + + /** + * Required. Channel connection to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Eventarc\V1\ChannelConnection $var + * @return $this + */ + public function setChannelConnection($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\ChannelConnection::class); + $this->channel_connection = $var; + + return $this; + } + + /** + * Required. The user-provided ID to be assigned to the channel connection. + * + * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getChannelConnectionId() + { + return $this->channel_connection_id; + } + + /** + * Required. The user-provided ID to be assigned to the channel connection. + * + * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setChannelConnectionId($var) + { + GPBUtil::checkString($var, True); + $this->channel_connection_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php new file mode 100644 index 000000000000..751a74b4f102 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php @@ -0,0 +1,183 @@ +google.cloud.eventarc.v1.CreateChannelRequest + */ +class CreateChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which to add this channel. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The channel to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $channel = null; + /** + * Required. The user-provided ID to be assigned to the channel. + * + * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $channel_id = ''; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which to add this channel. + * @type \Google\Cloud\Eventarc\V1\Channel $channel + * Required. The channel to create. + * @type string $channel_id + * Required. The user-provided ID to be assigned to the channel. + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which to add this channel. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which to add this channel. + * + * 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 channel to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Eventarc\V1\Channel|null + */ + public function getChannel() + { + return $this->channel; + } + + public function hasChannel() + { + return isset($this->channel); + } + + public function clearChannel() + { + unset($this->channel); + } + + /** + * Required. The channel to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Eventarc\V1\Channel $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Channel::class); + $this->channel = $var; + + return $this; + } + + /** + * Required. The user-provided ID to be assigned to the channel. + * + * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getChannelId() + { + return $this->channel_id; + } + + /** + * Required. The user-provided ID to be assigned to the channel. + * + * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setChannelId($var) + { + GPBUtil::checkString($var, True); + $this->channel_id = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php new file mode 100644 index 000000000000..f7e0fb54cf2b --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php @@ -0,0 +1,183 @@ +google.cloud.eventarc.v1.CreateTriggerRequest + */ +class CreateTriggerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection in which to add this trigger. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The trigger to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trigger = null; + /** + * Required. The user-provided ID to be assigned to the trigger. + * + * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $trigger_id = ''; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection in which to add this trigger. + * @type \Google\Cloud\Eventarc\V1\Trigger $trigger + * Required. The trigger to create. + * @type string $trigger_id + * Required. The user-provided ID to be assigned to the trigger. + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection in which to add this trigger. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection in which to add this trigger. + * + * 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 trigger to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Eventarc\V1\Trigger|null + */ + public function getTrigger() + { + return $this->trigger; + } + + public function hasTrigger() + { + return isset($this->trigger); + } + + public function clearTrigger() + { + unset($this->trigger); + } + + /** + * Required. The trigger to create. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Eventarc\V1\Trigger $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Trigger::class); + $this->trigger = $var; + + return $this; + } + + /** + * Required. The user-provided ID to be assigned to the trigger. + * + * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTriggerId() + { + return $this->trigger_id; + } + + /** + * Required. The user-provided ID to be assigned to the trigger. + * + * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTriggerId($var) + { + GPBUtil::checkString($var, True); + $this->trigger_id = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php new file mode 100644 index 000000000000..05118ef90569 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php @@ -0,0 +1,67 @@ +google.cloud.eventarc.v1.DeleteChannelConnectionRequest + */ +class DeleteChannelConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the channel connection to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the channel connection to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the channel connection to delete. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the channel connection to delete. + * + * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php new file mode 100644 index 000000000000..96942e292e99 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php @@ -0,0 +1,105 @@ +google.cloud.eventarc.v1.DeleteChannelRequest + */ +class DeleteChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the channel to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the channel to be deleted. + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the channel to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the channel to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php new file mode 100644 index 000000000000..88ac83e8d2fb --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php @@ -0,0 +1,181 @@ +google.cloud.eventarc.v1.DeleteTriggerRequest + */ +class DeleteTriggerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the trigger to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * If provided, the trigger will only be deleted if the etag matches the + * current etag on the resource. + * + * Generated from protobuf field string etag = 2; + */ + protected $etag = ''; + /** + * If set to true, and the trigger is not found, the request will succeed + * but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the trigger to be deleted. + * @type string $etag + * If provided, the trigger will only be deleted if the etag matches the + * current etag on the resource. + * @type bool $allow_missing + * If set to true, and the trigger is not found, the request will succeed + * but no action will be taken on the server. + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the trigger to be deleted. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the trigger to be deleted. + * + * 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; + } + + /** + * If provided, the trigger will only be deleted if the etag matches the + * current etag on the resource. + * + * Generated from protobuf field string etag = 2; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * If provided, the trigger will only be deleted if the etag matches the + * current etag on the resource. + * + * Generated from protobuf field string etag = 2; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + + /** + * If set to true, and the trigger is not found, the request will succeed + * but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the trigger is not found, the request will succeed + * but no action will be taken on the server. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php new file mode 100644 index 000000000000..22e3208c1dbc --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php @@ -0,0 +1,150 @@ +google.cloud.eventarc.v1.Destination + */ +class Destination extends \Google\Protobuf\Internal\Message +{ + protected $descriptor; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\CloudRun $cloud_run + * Cloud Run fully-managed resource that receives the events. The resource + * should be in the same project as the trigger. + * @type string $cloud_function + * The Cloud Function resource name. Only Cloud Functions V2 is supported. + * Format: `projects/{project}/locations/{location}/functions/{function}` + * @type \Google\Cloud\Eventarc\V1\GKE $gke + * A GKE service capable of receiving events. The service should be running + * in the same project as the trigger. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Cloud Run fully-managed resource that receives the events. The resource + * should be in the same project as the trigger. + * + * Generated from protobuf field .google.cloud.eventarc.v1.CloudRun cloud_run = 1; + * @return \Google\Cloud\Eventarc\V1\CloudRun|null + */ + public function getCloudRun() + { + return $this->readOneof(1); + } + + public function hasCloudRun() + { + return $this->hasOneof(1); + } + + /** + * Cloud Run fully-managed resource that receives the events. The resource + * should be in the same project as the trigger. + * + * Generated from protobuf field .google.cloud.eventarc.v1.CloudRun cloud_run = 1; + * @param \Google\Cloud\Eventarc\V1\CloudRun $var + * @return $this + */ + public function setCloudRun($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\CloudRun::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The Cloud Function resource name. Only Cloud Functions V2 is supported. + * Format: `projects/{project}/locations/{location}/functions/{function}` + * + * Generated from protobuf field string cloud_function = 2 [(.google.api.resource_reference) = { + * @return string + */ + public function getCloudFunction() + { + return $this->readOneof(2); + } + + public function hasCloudFunction() + { + return $this->hasOneof(2); + } + + /** + * The Cloud Function resource name. Only Cloud Functions V2 is supported. + * Format: `projects/{project}/locations/{location}/functions/{function}` + * + * Generated from protobuf field string cloud_function = 2 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setCloudFunction($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A GKE service capable of receiving events. The service should be running + * in the same project as the trigger. + * + * Generated from protobuf field .google.cloud.eventarc.v1.GKE gke = 3; + * @return \Google\Cloud\Eventarc\V1\GKE|null + */ + public function getGke() + { + return $this->readOneof(3); + } + + public function hasGke() + { + return $this->hasOneof(3); + } + + /** + * A GKE service capable of receiving events. The service should be running + * in the same project as the trigger. + * + * Generated from protobuf field .google.cloud.eventarc.v1.GKE gke = 3; + * @param \Google\Cloud\Eventarc\V1\GKE $var + * @return $this + */ + public function setGke($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\GKE::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getDescriptor() + { + return $this->whichOneof("descriptor"); + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php new file mode 100644 index 000000000000..f4f75630fc18 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php @@ -0,0 +1,155 @@ +google.cloud.eventarc.v1.EventFilter + */ +class EventFilter extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes + * are supported for filtering. + * All triggers MUST provide a filter for the 'type' attribute. + * + * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $attribute = ''; + /** + * Required. The value for the attribute. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $value = ''; + /** + * Optional. The operator used for matching the events with the value of the + * filter. If not specified, only events that have an exact key-value pair + * specified in the filter are matched. The only allowed value is + * `match-path-pattern`. + * + * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $operator = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $attribute + * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes + * are supported for filtering. + * All triggers MUST provide a filter for the 'type' attribute. + * @type string $value + * Required. The value for the attribute. + * @type string $operator + * Optional. The operator used for matching the events with the value of the + * filter. If not specified, only events that have an exact key-value pair + * specified in the filter are matched. The only allowed value is + * `match-path-pattern`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes + * are supported for filtering. + * All triggers MUST provide a filter for the 'type' attribute. + * + * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getAttribute() + { + return $this->attribute; + } + + /** + * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes + * are supported for filtering. + * All triggers MUST provide a filter for the 'type' attribute. + * + * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setAttribute($var) + { + GPBUtil::checkString($var, True); + $this->attribute = $var; + + return $this; + } + + /** + * Required. The value for the attribute. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Required. The value for the attribute. + * + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + + /** + * Optional. The operator used for matching the events with the value of the + * filter. If not specified, only events that have an exact key-value pair + * specified in the filter are matched. The only allowed value is + * `match-path-pattern`. + * + * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOperator() + { + return $this->operator; + } + + /** + * Optional. The operator used for matching the events with the value of the + * filter. If not specified, only events that have an exact key-value pair + * specified in the filter are matched. The only allowed value is + * `match-path-pattern`. + * + * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOperator($var) + { + GPBUtil::checkString($var, True); + $this->operator = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php new file mode 100644 index 000000000000..30ad258bb94a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php @@ -0,0 +1,246 @@ +_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetTrigger', + $argument, + ['\Google\Cloud\Eventarc\V1\Trigger', 'decode'], + $metadata, $options); + } + + /** + * List triggers. + * @param \Google\Cloud\Eventarc\V1\ListTriggersRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListTriggers(\Google\Cloud\Eventarc\V1\ListTriggersRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListTriggers', + $argument, + ['\Google\Cloud\Eventarc\V1\ListTriggersResponse', 'decode'], + $metadata, $options); + } + + /** + * Create a new trigger in a particular project and location. + * @param \Google\Cloud\Eventarc\V1\CreateTriggerRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateTrigger(\Google\Cloud\Eventarc\V1\CreateTriggerRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateTrigger', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Update a single trigger. + * @param \Google\Cloud\Eventarc\V1\UpdateTriggerRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateTrigger(\Google\Cloud\Eventarc\V1\UpdateTriggerRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/UpdateTrigger', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Delete a single trigger. + * @param \Google\Cloud\Eventarc\V1\DeleteTriggerRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteTrigger(\Google\Cloud\Eventarc\V1\DeleteTriggerRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteTrigger', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Get a single Channel. + * @param \Google\Cloud\Eventarc\V1\GetChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetChannel(\Google\Cloud\Eventarc\V1\GetChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetChannel', + $argument, + ['\Google\Cloud\Eventarc\V1\Channel', 'decode'], + $metadata, $options); + } + + /** + * List channels. + * @param \Google\Cloud\Eventarc\V1\ListChannelsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListChannels(\Google\Cloud\Eventarc\V1\ListChannelsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListChannels', + $argument, + ['\Google\Cloud\Eventarc\V1\ListChannelsResponse', 'decode'], + $metadata, $options); + } + + /** + * Create a new channel in a particular project and location. + * @param \Google\Cloud\Eventarc\V1\CreateChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateChannel(\Google\Cloud\Eventarc\V1\CreateChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateChannel', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Update a single channel. + * @param \Google\Cloud\Eventarc\V1\UpdateChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateChannel(\Google\Cloud\Eventarc\V1\UpdateChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/UpdateChannel', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Delete a single channel. + * @param \Google\Cloud\Eventarc\V1\DeleteChannelRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteChannel(\Google\Cloud\Eventarc\V1\DeleteChannelRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteChannel', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Get a single ChannelConnection. + * @param \Google\Cloud\Eventarc\V1\GetChannelConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetChannelConnection(\Google\Cloud\Eventarc\V1\GetChannelConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetChannelConnection', + $argument, + ['\Google\Cloud\Eventarc\V1\ChannelConnection', 'decode'], + $metadata, $options); + } + + /** + * List channel connections. + * @param \Google\Cloud\Eventarc\V1\ListChannelConnectionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListChannelConnections(\Google\Cloud\Eventarc\V1\ListChannelConnectionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListChannelConnections', + $argument, + ['\Google\Cloud\Eventarc\V1\ListChannelConnectionsResponse', 'decode'], + $metadata, $options); + } + + /** + * Create a new ChannelConnection in a particular project and location. + * @param \Google\Cloud\Eventarc\V1\CreateChannelConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function CreateChannelConnection(\Google\Cloud\Eventarc\V1\CreateChannelConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateChannelConnection', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + + /** + * Delete a single ChannelConnection. + * @param \Google\Cloud\Eventarc\V1\DeleteChannelConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteChannelConnection(\Google\Cloud\Eventarc\V1\DeleteChannelConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection', + $argument, + ['\Google\LongRunning\Operation', 'decode'], + $metadata, $options); + } + +} diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php new file mode 100644 index 000000000000..205d41d90ddc --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php @@ -0,0 +1,223 @@ +google.cloud.eventarc.v1.GKE + */ +class GKE extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the cluster the GKE service is running in. The cluster must be + * running in the same project as the trigger being created. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $cluster = ''; + /** + * Required. The name of the Google Compute Engine in which the cluster resides, which + * can either be compute zone (for example, us-central1-a) for the zonal + * clusters or region (for example, us-central1) for regional clusters. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $location = ''; + /** + * Required. The namespace the GKE service is running in. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $namespace = ''; + /** + * Required. Name of the GKE service. + * + * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $service = ''; + /** + * Optional. The relative path on the GKE service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $path = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cluster + * Required. The name of the cluster the GKE service is running in. The cluster must be + * running in the same project as the trigger being created. + * @type string $location + * Required. The name of the Google Compute Engine in which the cluster resides, which + * can either be compute zone (for example, us-central1-a) for the zonal + * clusters or region (for example, us-central1) for regional clusters. + * @type string $namespace + * Required. The namespace the GKE service is running in. + * @type string $service + * Required. Name of the GKE service. + * @type string $path + * Optional. The relative path on the GKE service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the cluster the GKE service is running in. The cluster must be + * running in the same project as the trigger being created. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getCluster() + { + return $this->cluster; + } + + /** + * Required. The name of the cluster the GKE service is running in. The cluster must be + * running in the same project as the trigger being created. + * + * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setCluster($var) + { + GPBUtil::checkString($var, True); + $this->cluster = $var; + + return $this; + } + + /** + * Required. The name of the Google Compute Engine in which the cluster resides, which + * can either be compute zone (for example, us-central1-a) for the zonal + * clusters or region (for example, us-central1) for regional clusters. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLocation() + { + return $this->location; + } + + /** + * Required. The name of the Google Compute Engine in which the cluster resides, which + * can either be compute zone (for example, us-central1-a) for the zonal + * clusters or region (for example, us-central1) for regional clusters. + * + * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLocation($var) + { + GPBUtil::checkString($var, True); + $this->location = $var; + + return $this; + } + + /** + * Required. The namespace the GKE service is running in. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Required. The namespace the GKE service is running in. + * + * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setNamespace($var) + { + GPBUtil::checkString($var, True); + $this->namespace = $var; + + return $this; + } + + /** + * Required. Name of the GKE service. + * + * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getService() + { + return $this->service; + } + + /** + * Required. Name of the GKE service. + * + * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setService($var) + { + GPBUtil::checkString($var, True); + $this->service = $var; + + return $this; + } + + /** + * Optional. The relative path on the GKE service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Optional. The relative path on the GKE service the events should be sent to. + * The value must conform to the definition of a URI path segment (section 3.3 + * of RFC2396). Examples: "/route", "route", "route/subroute". + * + * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPath($var) + { + GPBUtil::checkString($var, True); + $this->path = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php new file mode 100644 index 000000000000..9f7938c96631 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php @@ -0,0 +1,67 @@ +google.cloud.eventarc.v1.GetChannelConnectionRequest + */ +class GetChannelConnectionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the channel connection to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the channel connection to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the channel connection to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the channel connection to get. + * + * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php new file mode 100644 index 000000000000..ebde4f2d3857 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php @@ -0,0 +1,67 @@ +google.cloud.eventarc.v1.GetChannelRequest + */ +class GetChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the channel to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the channel to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the channel to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the channel to get. + * + * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php new file mode 100644 index 000000000000..1a6f9e0fe07a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php @@ -0,0 +1,67 @@ +google.cloud.eventarc.v1.GetTriggerRequest + */ +class GetTriggerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the trigger to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the trigger to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the trigger to get. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the trigger to get. + * + * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php new file mode 100644 index 000000000000..f84598beb531 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php @@ -0,0 +1,151 @@ +google.cloud.eventarc.v1.ListChannelConnectionsRequest + */ +class ListChannelConnectionsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection from which to list channel connections. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of channel connections to return on each page. + * Note: The service may send fewer responses. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannelConnections` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannelConnetions` + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection from which to list channel connections. + * @type int $page_size + * The maximum number of channel connections to return on each page. + * Note: The service may send fewer responses. + * @type string $page_token + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannelConnections` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannelConnetions` + * match the call that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection from which to list channel connections. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection from which to list channel connections. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of channel connections to return on each page. + * Note: The service may send fewer responses. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of channel connections to return on each page. + * Note: The service may send fewer responses. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannelConnections` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannelConnetions` + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannelConnections` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannelConnetions` + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php new file mode 100644 index 000000000000..c80fb79b700a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php @@ -0,0 +1,147 @@ +google.cloud.eventarc.v1.ListChannelConnectionsResponse + */ +class ListChannelConnectionsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The requested channel connections, up to the number specified in + * `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; + */ + private $channel_connections; + /** + * A page token that can be sent to ListChannelConnections to request the + * next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\ChannelConnection[]|\Google\Protobuf\Internal\RepeatedField $channel_connections + * The requested channel connections, up to the number specified in + * `page_size`. + * @type string $next_page_token + * A page token that can be sent to ListChannelConnections to request the + * next page. + * If this is empty, then there are no more pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Unreachable resources, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * The requested channel connections, up to the number specified in + * `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChannelConnections() + { + return $this->channel_connections; + } + + /** + * The requested channel connections, up to the number specified in + * `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; + * @param \Google\Cloud\Eventarc\V1\ChannelConnection[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChannelConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\ChannelConnection::class); + $this->channel_connections = $arr; + + return $this; + } + + /** + * A page token that can be sent to ListChannelConnections to request the + * next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that can be sent to ListChannelConnections to request the + * next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php new file mode 100644 index 000000000000..c57add9d02f4 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php @@ -0,0 +1,197 @@ +google.cloud.eventarc.v1.ListChannelsRequest + */ +class ListChannelsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection to list channels on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of channels to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannels` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannels` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, channel_id`. + * + * Generated from protobuf field string order_by = 4; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection to list channels on. + * @type int $page_size + * The maximum number of channels to return on each page. + * Note: The service may send fewer. + * @type string $page_token + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannels` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannels` must + * match the call that provided the page token. + * @type string $order_by + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, channel_id`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection to list channels on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection to list channels on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of channels to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of channels to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannels` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannels` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListChannels` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListChannels` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, channel_id`. + * + * Generated from protobuf field string order_by = 4; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, channel_id`. + * + * Generated from protobuf field string order_by = 4; + * @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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php new file mode 100644 index 000000000000..d76a26d0603a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php @@ -0,0 +1,139 @@ +google.cloud.eventarc.v1.ListChannelsResponse + */ +class ListChannelsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The requested channels, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; + */ + private $channels; + /** + * A page token that can be sent to ListChannels to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\Channel[]|\Google\Protobuf\Internal\RepeatedField $channels + * The requested channels, up to the number specified in `page_size`. + * @type string $next_page_token + * A page token that can be sent to ListChannels to request the next page. + * If this is empty, then there are no more pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Unreachable resources, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * The requested channels, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getChannels() + { + return $this->channels; + } + + /** + * The requested channels, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; + * @param \Google\Cloud\Eventarc\V1\Channel[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setChannels($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\Channel::class); + $this->channels = $arr; + + return $this; + } + + /** + * A page token that can be sent to ListChannels to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that can be sent to ListChannels to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php new file mode 100644 index 000000000000..474f35d8569a --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php @@ -0,0 +1,197 @@ +google.cloud.eventarc.v1.ListTriggersRequest + */ +class ListTriggersRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent collection to list triggers on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * The maximum number of triggers to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + */ + protected $page_size = 0; + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListTriggers` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTriggers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + */ + protected $page_token = ''; + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, trigger_id`. + * + * Generated from protobuf field string order_by = 4; + */ + protected $order_by = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent collection to list triggers on. + * @type int $page_size + * The maximum number of triggers to return on each page. + * Note: The service may send fewer. + * @type string $page_token + * The page token; provide the value from the `next_page_token` field in a + * previous `ListTriggers` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTriggers` must match + * the call that provided the page token. + * @type string $order_by + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, trigger_id`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent collection to list triggers on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent collection to list triggers on. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * The maximum number of triggers to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of triggers to return on each page. + * Note: The service may send fewer. + * + * Generated from protobuf field int32 page_size = 2; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListTriggers` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTriggers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The page token; provide the value from the `next_page_token` field in a + * previous `ListTriggers` call to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListTriggers` must match + * the call that provided the page token. + * + * Generated from protobuf field string page_token = 3; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, trigger_id`. + * + * Generated from protobuf field string order_by = 4; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, trigger_id`. + * + * Generated from protobuf field string order_by = 4; + * @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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php new file mode 100644 index 000000000000..d755f69484a1 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php @@ -0,0 +1,139 @@ +google.cloud.eventarc.v1.ListTriggersResponse + */ +class ListTriggersResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The requested triggers, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; + */ + private $triggers; + /** + * A page token that can be sent to ListTriggers to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\Trigger[]|\Google\Protobuf\Internal\RepeatedField $triggers + * The requested triggers, up to the number specified in `page_size`. + * @type string $next_page_token + * A page token that can be sent to ListTriggers to request the next page. + * If this is empty, then there are no more pages. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable + * Unreachable resources, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * The requested triggers, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTriggers() + { + return $this->triggers; + } + + /** + * The requested triggers, up to the number specified in `page_size`. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; + * @param \Google\Cloud\Eventarc\V1\Trigger[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTriggers($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\Trigger::class); + $this->triggers = $arr; + + return $this; + } + + /** + * A page token that can be sent to ListTriggers to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * A page token that can be sent to ListTriggers to request the next page. + * If this is empty, then there are no more pages. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Unreachable resources, if any. + * + * Generated from protobuf field repeated string unreachable = 3; + * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php new file mode 100644 index 000000000000..5e68aca2f8c3 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php @@ -0,0 +1,303 @@ +google.cloud.eventarc.v1.OperationMetadata + */ +class OperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $target = ''; + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $verb = ''; + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $status_message = ''; + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $requested_cancellation = false; + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $api_version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the operation was created. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the operation finished running. + * @type string $target + * Output only. Server-defined resource path for the target of the operation. + * @type string $verb + * Output only. Name of the verb executed by the operation. + * @type string $status_message + * Output only. Human-readable status of the operation, if any. + * @type bool $requested_cancellation + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * @type string $api_version + * Output only. API version used to start the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the operation was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the operation finished running. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getTarget() + { + return $this->target; + } + + /** + * Output only. Server-defined resource path for the target of the operation. + * + * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setTarget($var) + { + GPBUtil::checkString($var, True); + $this->target = $var; + + return $this; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVerb() + { + return $this->verb; + } + + /** + * Output only. Name of the verb executed by the operation. + * + * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVerb($var) + { + GPBUtil::checkString($var, True); + $this->verb = $var; + + return $this; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getStatusMessage() + { + return $this->status_message; + } + + /** + * Output only. Human-readable status of the operation, if any. + * + * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setStatusMessage($var) + { + GPBUtil::checkString($var, True); + $this->status_message = $var; + + return $this; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getRequestedCancellation() + { + return $this->requested_cancellation; + } + + /** + * Output only. Identifies whether the user has requested cancellation + * of the operation. Operations that have successfully been cancelled + * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + * corresponding to `Code.CANCELLED`. + * + * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setRequestedCancellation($var) + { + GPBUtil::checkBool($var); + $this->requested_cancellation = $var; + + return $this; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApiVersion() + { + return $this->api_version; + } + + /** + * Output only. API version used to start the operation. + * + * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApiVersion($var) + { + GPBUtil::checkString($var, True); + $this->api_version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php new file mode 100644 index 000000000000..438692870f62 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php @@ -0,0 +1,129 @@ +google.cloud.eventarc.v1.Pubsub + */ +class Pubsub extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the Pub/Sub topic created and managed by Eventarc as + * a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. + * You can set an existing topic for triggers of the type + * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide + * here is not deleted by Eventarc at trigger deletion. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $topic = ''; + /** + * Output only. The name of the Pub/Sub subscription created and managed by Eventarc + * as a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $subscription = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $topic + * Optional. The name of the Pub/Sub topic created and managed by Eventarc as + * a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. + * You can set an existing topic for triggers of the type + * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide + * here is not deleted by Eventarc at trigger deletion. + * @type string $subscription + * Output only. The name of the Pub/Sub subscription created and managed by Eventarc + * as a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the Pub/Sub topic created and managed by Eventarc as + * a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. + * You can set an existing topic for triggers of the type + * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide + * here is not deleted by Eventarc at trigger deletion. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getTopic() + { + return $this->topic; + } + + /** + * Optional. The name of the Pub/Sub topic created and managed by Eventarc as + * a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. + * You can set an existing topic for triggers of the type + * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide + * here is not deleted by Eventarc at trigger deletion. + * + * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setTopic($var) + { + GPBUtil::checkString($var, True); + $this->topic = $var; + + return $this; + } + + /** + * Output only. The name of the Pub/Sub subscription created and managed by Eventarc + * as a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * Output only. The name of the Pub/Sub subscription created and managed by Eventarc + * as a transport for the event delivery. Format: + * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. + * + * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSubscription($var) + { + GPBUtil::checkString($var, True); + $this->subscription = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php new file mode 100644 index 000000000000..0d7bd861e1e0 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php @@ -0,0 +1,79 @@ +google.cloud.eventarc.v1.Transport + */ +class Transport extends \Google\Protobuf\Internal\Message +{ + protected $intermediary; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\Pubsub $pubsub + * The Pub/Sub topic and subscription used by Eventarc as a transport + * intermediary. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * The Pub/Sub topic and subscription used by Eventarc as a transport + * intermediary. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Pubsub pubsub = 1; + * @return \Google\Cloud\Eventarc\V1\Pubsub|null + */ + public function getPubsub() + { + return $this->readOneof(1); + } + + public function hasPubsub() + { + return $this->hasOneof(1); + } + + /** + * The Pub/Sub topic and subscription used by Eventarc as a transport + * intermediary. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Pubsub pubsub = 1; + * @param \Google\Cloud\Eventarc\V1\Pubsub $var + * @return $this + */ + public function setPubsub($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Pubsub::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getIntermediary() + { + return $this->whichOneof("intermediary"); + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php new file mode 100644 index 000000000000..a1f62f0195c5 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php @@ -0,0 +1,535 @@ +google.cloud.eventarc.v1.Trigger + */ +class Trigger extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource name of the trigger. Must be unique within the location of the + * project and must be in + * `projects/{project}/locations/{location}/triggers/{trigger}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uid = ''; + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Required. null The list of filters that applies to event attributes. Only events that + * match all the provided filters are sent to the destination. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; + */ + private $event_filters; + /** + * Optional. The IAM service account email associated with the trigger. The + * service account represents the identity of the trigger. + * The principal who calls this API must have the `iam.serviceAccounts.actAs` + * permission in the service account. See + * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common + * for more information. + * For Cloud Run destinations, this service account is used to generate + * identity tokens when invoking the service. See + * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account + * for information on how to invoke authenticated Cloud Run services. + * To create Audit Log triggers, the service account should also + * have the `roles/eventarc.eventReceiver` IAM role. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + protected $service_account = ''; + /** + * Required. Destination specifies where the events should be sent to. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $destination = null; + /** + * Optional. To deliver messages, Eventarc might use other GCP + * products as a transport intermediary. This field contains a reference to + * that transport intermediary. This information can be used for debugging + * purposes. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transport = null; + /** + * Optional. User labels attached to the triggers that can be used to group resources. + * + * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The name of the channel associated with the trigger in + * `projects/{project}/locations/{location}/channels/{channel}` format. + * You must provide a channel to receive events from Eventarc SaaS partners. + * + * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $channel = ''; + /** + * Output only. This checksum is computed by the server based on the value of other + * fields, and might be sent only on create requests to ensure that the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $etag = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource name of the trigger. Must be unique within the location of the + * project and must be in + * `projects/{project}/locations/{location}/triggers/{trigger}` format. + * @type string $uid + * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The creation time. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last-modified time. + * @type \Google\Cloud\Eventarc\V1\EventFilter[]|\Google\Protobuf\Internal\RepeatedField $event_filters + * Required. null The list of filters that applies to event attributes. Only events that + * match all the provided filters are sent to the destination. + * @type string $service_account + * Optional. The IAM service account email associated with the trigger. The + * service account represents the identity of the trigger. + * The principal who calls this API must have the `iam.serviceAccounts.actAs` + * permission in the service account. See + * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common + * for more information. + * For Cloud Run destinations, this service account is used to generate + * identity tokens when invoking the service. See + * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account + * for information on how to invoke authenticated Cloud Run services. + * To create Audit Log triggers, the service account should also + * have the `roles/eventarc.eventReceiver` IAM role. + * @type \Google\Cloud\Eventarc\V1\Destination $destination + * Required. Destination specifies where the events should be sent to. + * @type \Google\Cloud\Eventarc\V1\Transport $transport + * Optional. To deliver messages, Eventarc might use other GCP + * products as a transport intermediary. This field contains a reference to + * that transport intermediary. This information can be used for debugging + * purposes. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. User labels attached to the triggers that can be used to group resources. + * @type string $channel + * Optional. The name of the channel associated with the trigger in + * `projects/{project}/locations/{location}/channels/{channel}` format. + * You must provide a channel to receive events from Eventarc SaaS partners. + * @type string $etag + * Output only. This checksum is computed by the server based on the value of other + * fields, and might be sent only on create requests to ensure that the + * client has an up-to-date value before proceeding. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource name of the trigger. Must be unique within the location of the + * project and must be in + * `projects/{project}/locations/{location}/triggers/{trigger}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource name of the trigger. Must be unique within the location of the + * project and must be in + * `projects/{project}/locations/{location}/triggers/{trigger}` format. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getUid() + { + return $this->uid; + } + + /** + * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 + * string and guaranteed to remain unchanged until the resource is deleted. + * + * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setUid($var) + { + GPBUtil::checkString($var, True); + $this->uid = $var; + + return $this; + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The creation time. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last-modified time. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Required. null The list of filters that applies to event attributes. Only events that + * match all the provided filters are sent to the destination. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEventFilters() + { + return $this->event_filters; + } + + /** + * Required. null The list of filters that applies to event attributes. Only events that + * match all the provided filters are sent to the destination. + * + * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Eventarc\V1\EventFilter[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEventFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\EventFilter::class); + $this->event_filters = $arr; + + return $this; + } + + /** + * Optional. The IAM service account email associated with the trigger. The + * service account represents the identity of the trigger. + * The principal who calls this API must have the `iam.serviceAccounts.actAs` + * permission in the service account. See + * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common + * for more information. + * For Cloud Run destinations, this service account is used to generate + * identity tokens when invoking the service. See + * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account + * for information on how to invoke authenticated Cloud Run services. + * To create Audit Log triggers, the service account should also + * have the `roles/eventarc.eventReceiver` IAM role. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The IAM service account email associated with the trigger. The + * service account represents the identity of the trigger. + * The principal who calls this API must have the `iam.serviceAccounts.actAs` + * permission in the service account. See + * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common + * for more information. + * For Cloud Run destinations, this service account is used to generate + * identity tokens when invoking the service. See + * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account + * for information on how to invoke authenticated Cloud Run services. + * To create Audit Log triggers, the service account should also + * have the `roles/eventarc.eventReceiver` IAM role. + * + * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Required. Destination specifies where the events should be sent to. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Eventarc\V1\Destination|null + */ + public function getDestination() + { + return $this->destination; + } + + public function hasDestination() + { + return isset($this->destination); + } + + public function clearDestination() + { + unset($this->destination); + } + + /** + * Required. Destination specifies where the events should be sent to. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Eventarc\V1\Destination $var + * @return $this + */ + public function setDestination($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Destination::class); + $this->destination = $var; + + return $this; + } + + /** + * Optional. To deliver messages, Eventarc might use other GCP + * products as a transport intermediary. This field contains a reference to + * that transport intermediary. This information can be used for debugging + * purposes. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Eventarc\V1\Transport|null + */ + public function getTransport() + { + return $this->transport; + } + + public function hasTransport() + { + return isset($this->transport); + } + + public function clearTransport() + { + unset($this->transport); + } + + /** + * Optional. To deliver messages, Eventarc might use other GCP + * products as a transport intermediary. This field contains a reference to + * that transport intermediary. This information can be used for debugging + * purposes. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Eventarc\V1\Transport $var + * @return $this + */ + public function setTransport($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Transport::class); + $this->transport = $var; + + return $this; + } + + /** + * Optional. User labels attached to the triggers that can be used to group resources. + * + * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. User labels attached to the triggers that can be used to group resources. + * + * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The name of the channel associated with the trigger in + * `projects/{project}/locations/{location}/channels/{channel}` format. + * You must provide a channel to receive events from Eventarc SaaS partners. + * + * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getChannel() + { + return $this->channel; + } + + /** + * Optional. The name of the channel associated with the trigger in + * `projects/{project}/locations/{location}/channels/{channel}` format. + * You must provide a channel to receive events from Eventarc SaaS partners. + * + * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkString($var, True); + $this->channel = $var; + + return $this; + } + + /** + * Output only. This checksum is computed by the server based on the value of other + * fields, and might be sent only on create requests to ensure that the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getEtag() + { + return $this->etag; + } + + /** + * Output only. This checksum is computed by the server based on the value of other + * fields, and might be sent only on create requests to ensure that the + * client has an up-to-date value before proceeding. + * + * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setEtag($var) + { + GPBUtil::checkString($var, True); + $this->etag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php new file mode 100644 index 000000000000..8db95563a9b1 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php @@ -0,0 +1,167 @@ +google.cloud.eventarc.v1.UpdateChannelRequest + */ +class UpdateChannelRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The channel to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; + */ + protected $channel = null; + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\Channel $channel + * The channel to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * The channel to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; + * @return \Google\Cloud\Eventarc\V1\Channel|null + */ + public function getChannel() + { + return $this->channel; + } + + public function hasChannel() + { + return isset($this->channel); + } + + public function clearChannel() + { + unset($this->channel); + } + + /** + * The channel to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; + * @param \Google\Cloud\Eventarc\V1\Channel $var + * @return $this + */ + public function setChannel($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Channel::class); + $this->channel = $var; + + return $this; + } + + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php new file mode 100644 index 000000000000..a0b83659f1c1 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php @@ -0,0 +1,205 @@ +google.cloud.eventarc.v1.UpdateTriggerRequest + */ +class UpdateTriggerRequest extends \Google\Protobuf\Internal\Message +{ + /** + * The trigger to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; + */ + protected $trigger = null; + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + */ + protected $update_mask = null; + /** + * If set to true, and the trigger is not found, a new trigger will be + * created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + */ + protected $allow_missing = false; + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $validate_only = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Eventarc\V1\Trigger $trigger + * The trigger to be updated. + * @type \Google\Protobuf\FieldMask $update_mask + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * @type bool $allow_missing + * If set to true, and the trigger is not found, a new trigger will be + * created. In this situation, `update_mask` is ignored. + * @type bool $validate_only + * Required. If set, validate the request and preview the review, but do not + * post it. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); + parent::__construct($data); + } + + /** + * The trigger to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; + * @return \Google\Cloud\Eventarc\V1\Trigger|null + */ + public function getTrigger() + { + return $this->trigger; + } + + public function hasTrigger() + { + return isset($this->trigger); + } + + public function clearTrigger() + { + unset($this->trigger); + } + + /** + * The trigger to be updated. + * + * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; + * @param \Google\Cloud\Eventarc\V1\Trigger $var + * @return $this + */ + public function setTrigger($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Trigger::class); + $this->trigger = $var; + + return $this; + } + + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * If set to true, and the trigger is not found, a new trigger will be + * created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + * @return bool + */ + public function getAllowMissing() + { + return $this->allow_missing; + } + + /** + * If set to true, and the trigger is not found, a new trigger will be + * created. In this situation, `update_mask` is ignored. + * + * Generated from protobuf field bool allow_missing = 3; + * @param bool $var + * @return $this + */ + public function setAllowMissing($var) + { + GPBUtil::checkBool($var); + $this->allow_missing = $var; + + return $this; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return bool + */ + public function getValidateOnly() + { + return $this->validate_only; + } + + /** + * Required. If set, validate the request and preview the review, but do not + * post it. + * + * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param bool $var + * @return $this + */ + public function setValidateOnly($var) + { + GPBUtil::checkBool($var); + $this->validate_only = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php b/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php new file mode 100644 index 000000000000..a0546816b6fa --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php @@ -0,0 +1,34 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $channel = new Channel(); + * $channelId = 'channel_id'; + * $validateOnly = false; + * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * Many parameters require resource names to be formatted in a particular way. To + * assist with these names, this class includes a format method for each type of + * name, and additionally a parseName method to extract the individual identifiers + * contained within formatted names that are returned by the API. + */ +class EventarcGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.eventarc.v1.Eventarc'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'eventarc.googleapis.com'; + + /** + * The default port of the service. + */ + const DEFAULT_SERVICE_PORT = 443; + + /** + * The name of the code generator, to be included in the agent header. + */ + const CODEGEN_NAME = 'gapic'; + + /** + * The default scopes required by the service. + */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private static $channelNameTemplate; + + private static $channelConnectionNameTemplate; + + private static $locationNameTemplate; + + private static $serviceAccountNameTemplate; + + private static $triggerNameTemplate; + + private static $pathTemplateMap; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/eventarc_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/eventarc_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/eventarc_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/eventarc_rest_client_config.php', + ], + ], + ]; + } + + private static function getChannelNameTemplate() + { + if (self::$channelNameTemplate == null) { + self::$channelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/channels/{channel}'); + } + + return self::$channelNameTemplate; + } + + private static function getChannelConnectionNameTemplate() + { + if (self::$channelConnectionNameTemplate == null) { + self::$channelConnectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/channelConnections/{channel_connection}'); + } + + return self::$channelConnectionNameTemplate; + } + + private static function getLocationNameTemplate() + { + if (self::$locationNameTemplate == null) { + self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); + } + + return self::$locationNameTemplate; + } + + private static function getServiceAccountNameTemplate() + { + if (self::$serviceAccountNameTemplate == null) { + self::$serviceAccountNameTemplate = new PathTemplate('projects/{project}/serviceAccounts/{service_account}'); + } + + return self::$serviceAccountNameTemplate; + } + + private static function getTriggerNameTemplate() + { + if (self::$triggerNameTemplate == null) { + self::$triggerNameTemplate = new PathTemplate('projects/{project}/locations/{location}/triggers/{trigger}'); + } + + return self::$triggerNameTemplate; + } + + private static function getPathTemplateMap() + { + if (self::$pathTemplateMap == null) { + self::$pathTemplateMap = [ + 'channel' => self::getChannelNameTemplate(), + 'channelConnection' => self::getChannelConnectionNameTemplate(), + 'location' => self::getLocationNameTemplate(), + 'serviceAccount' => self::getServiceAccountNameTemplate(), + 'trigger' => self::getTriggerNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * Formats a string containing the fully-qualified path to represent a channel + * resource. + * + * @param string $project + * @param string $location + * @param string $channel + * + * @return string The formatted channel resource. + */ + public static function channelName($project, $location, $channel) + { + return self::getChannelNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'channel' => $channel, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * channel_connection resource. + * + * @param string $project + * @param string $location + * @param string $channelConnection + * + * @return string The formatted channel_connection resource. + */ + public static function channelConnectionName($project, $location, $channelConnection) + { + return self::getChannelConnectionNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'channel_connection' => $channelConnection, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a location + * resource. + * + * @param string $project + * @param string $location + * + * @return string The formatted location resource. + */ + public static function locationName($project, $location) + { + return self::getLocationNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * service_account resource. + * + * @param string $project + * @param string $serviceAccount + * + * @return string The formatted service_account resource. + */ + public static function serviceAccountName($project, $serviceAccount) + { + return self::getServiceAccountNameTemplate()->render([ + 'project' => $project, + 'service_account' => $serviceAccount, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a trigger + * resource. + * + * @param string $project + * @param string $location + * @param string $trigger + * + * @return string The formatted trigger resource. + */ + public static function triggerName($project, $location, $trigger) + { + return self::getTriggerNameTemplate()->render([ + 'project' => $project, + 'location' => $location, + 'trigger' => $trigger, + ]); + } + + /** + * Parses a formatted name string and returns an associative array of the components in the name. + * The following name formats are supported: + * Template: Pattern + * - channel: projects/{project}/locations/{location}/channels/{channel} + * - channelConnection: projects/{project}/locations/{location}/channelConnections/{channel_connection} + * - location: projects/{project}/locations/{location} + * - serviceAccount: projects/{project}/serviceAccounts/{service_account} + * - trigger: projects/{project}/locations/{location}/triggers/{trigger} + * + * The optional $template argument can be supplied to specify a particular pattern, + * and must match one of the templates listed above. If no $template argument is + * provided, or if the $template argument does not match one of the templates + * listed, then parseName will check each of the supported templates, and return + * the first match. + * + * @param string $formattedName The formatted name string + * @param string $template Optional name of template to match + * + * @return array An associative array from name component IDs to component values. + * + * @throws ValidationException If $formattedName could not be matched. + */ + public static function parseName($formattedName, $template = null) + { + $templateMap = self::getPathTemplateMap(); + if ($template) { + if (!isset($templateMap[$template])) { + throw new ValidationException("Template name $template does not exist"); + } + + return $templateMap[$template]->match($formattedName); + } + + foreach ($templateMap as $templateName => $pathTemplate) { + try { + return $pathTemplate->match($formattedName); + } catch (ValidationException $ex) { + // Swallow the exception to continue trying other path templates + } + } + + throw new ValidationException("Input did not match any known format. Input: $formattedName"); + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $serviceAddress + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'eventarc.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 + * $serviceAddress setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Create a new channel in a particular project and location. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * $channel = new Channel(); + * $channelId = 'channel_id'; + * $validateOnly = false; + * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which to add this channel. + * @param Channel $channel Required. The channel to create. + * @param string $channelId Required. The user-provided ID to be assigned to the channel. + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createChannel($parent, $channel, $channelId, $validateOnly, array $optionalArgs = []) + { + $request = new CreateChannelRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setChannel($channel); + $request->setChannelId($channelId); + $request->setValidateOnly($validateOnly); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Create a new ChannelConnection in a particular project and location. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * $channelConnection = new ChannelConnection(); + * $channelConnectionId = 'channel_connection_id'; + * $operationResponse = $eventarcClient->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannelConnection'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which to add this channel connection. + * @param ChannelConnection $channelConnection Required. Channel connection to create. + * @param string $channelConnectionId Required. The user-provided ID to be assigned to the channel connection. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createChannelConnection($parent, $channelConnection, $channelConnectionId, array $optionalArgs = []) + { + $request = new CreateChannelConnectionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setChannelConnection($channelConnection); + $request->setChannelConnectionId($channelConnectionId); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateChannelConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Create a new trigger in a particular project and location. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * $trigger = new Trigger(); + * $triggerId = 'trigger_id'; + * $validateOnly = false; + * $operationResponse = $eventarcClient->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createTrigger'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection in which to add this trigger. + * @param Trigger $trigger Required. The trigger to create. + * @param string $triggerId Required. The user-provided ID to be assigned to the trigger. + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createTrigger($parent, $trigger, $triggerId, $validateOnly, array $optionalArgs = []) + { + $request = new CreateTriggerRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setTrigger($trigger); + $request->setTriggerId($triggerId); + $request->setValidateOnly($validateOnly); + $requestParamHeaders['parent'] = $parent; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Delete a single channel. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + * $validateOnly = false; + * $operationResponse = $eventarcClient->deleteChannel($formattedName, $validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->deleteChannel($formattedName, $validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteChannel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the channel to be deleted. + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteChannel($name, $validateOnly, array $optionalArgs = []) + { + $request = new DeleteChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setValidateOnly($validateOnly); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Delete a single ChannelConnection. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + * $operationResponse = $eventarcClient->deleteChannelConnection($formattedName); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->deleteChannelConnection($formattedName); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteChannelConnection'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the channel connection to delete. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteChannelConnection($name, array $optionalArgs = []) + { + $request = new DeleteChannelConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteChannelConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Delete a single trigger. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + * $validateOnly = false; + * $operationResponse = $eventarcClient->deleteTrigger($formattedName, $validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->deleteTrigger($formattedName, $validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteTrigger'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the trigger to be deleted. + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type string $etag + * If provided, the trigger will only be deleted if the etag matches the + * current etag on the resource. + * @type bool $allowMissing + * If set to true, and the trigger is not found, the request will succeed + * but no action will be taken on the server. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteTrigger($name, $validateOnly, array $optionalArgs = []) + { + $request = new DeleteTriggerRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setValidateOnly($validateOnly); + $requestParamHeaders['name'] = $name; + if (isset($optionalArgs['etag'])) { + $request->setEtag($optionalArgs['etag']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Get a single Channel. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + * $response = $eventarcClient->getChannel($formattedName); + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the channel to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Eventarc\V1\Channel + * + * @throws ApiException if the remote call fails + */ + public function getChannel($name, array $optionalArgs = []) + { + $request = new GetChannelRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetChannel', Channel::class, $optionalArgs, $request)->wait(); + } + + /** + * Get a single ChannelConnection. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + * $response = $eventarcClient->getChannelConnection($formattedName); + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the channel connection to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Eventarc\V1\ChannelConnection + * + * @throws ApiException if the remote call fails + */ + public function getChannelConnection($name, array $optionalArgs = []) + { + $request = new GetChannelConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetChannelConnection', ChannelConnection::class, $optionalArgs, $request)->wait(); + } + + /** + * Get a single trigger. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedName = $eventarcClient->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + * $response = $eventarcClient->getTrigger($formattedName); + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $name Required. The name of the trigger to get. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Eventarc\V1\Trigger + * + * @throws ApiException if the remote call fails + */ + public function getTrigger($name, array $optionalArgs = []) + { + $request = new GetTriggerRequest(); + $requestParamHeaders = []; + $request->setName($name); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetTrigger', Trigger::class, $optionalArgs, $request)->wait(); + } + + /** + * List channel connections. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $eventarcClient->listChannelConnections($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $eventarcClient->listChannelConnections($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection from which to list channel connections. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listChannelConnections($parent, array $optionalArgs = []) + { + $request = new ListChannelConnectionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListChannelConnections', $optionalArgs, ListChannelConnectionsResponse::class, $request); + } + + /** + * List channels. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $eventarcClient->listChannels($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $eventarcClient->listChannels($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection to list channels on. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $orderBy + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, channel_id`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listChannels($parent, array $optionalArgs = []) + { + $request = new ListChannelsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListChannels', $optionalArgs, ListChannelsResponse::class, $request); + } + + /** + * List triggers. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); + * // Iterate over pages of elements + * $pagedResponse = $eventarcClient->listTriggers($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $eventarcClient->listTriggers($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param string $parent Required. The parent collection to list triggers on. + * @param array $optionalArgs { + * Optional. + * + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @type string $orderBy + * The sorting order of the resources returned. Value should be a + * comma-separated list of fields. The default sorting order is ascending. To + * specify descending order for a field, append a `desc` suffix; for example: + * `name desc, trigger_id`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listTriggers($parent, array $optionalArgs = []) + { + $request = new ListTriggersRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + if (isset($optionalArgs['orderBy'])) { + $request->setOrderBy($optionalArgs['orderBy']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListTriggers', $optionalArgs, ListTriggersResponse::class, $request); + } + + /** + * Update a single channel. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $validateOnly = false; + * $operationResponse = $eventarcClient->updateChannel($validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->updateChannel($validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'updateChannel'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type Channel $channel + * The channel to be updated. + * @type FieldMask $updateMask + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateChannel($validateOnly, array $optionalArgs = []) + { + $request = new UpdateChannelRequest(); + $requestParamHeaders = []; + $request->setValidateOnly($validateOnly); + if (isset($optionalArgs['channel'])) { + $request->setChannel($optionalArgs['channel']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Update a single trigger. + * + * Sample code: + * ``` + * $eventarcClient = new EventarcClient(); + * try { + * $validateOnly = false; + * $operationResponse = $eventarcClient->updateTrigger($validateOnly); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $eventarcClient->updateTrigger($validateOnly); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'updateTrigger'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $eventarcClient->close(); + * } + * ``` + * + * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not + * post it. + * @param array $optionalArgs { + * Optional. + * + * @type Trigger $trigger + * The trigger to be updated. + * @type FieldMask $updateMask + * The fields to be updated; only fields explicitly provided are updated. + * If no field mask is provided, all provided fields in the request are + * updated. To update all fields, provide a field mask of "*". + * @type bool $allowMissing + * If set to true, and the trigger is not found, a new trigger will be + * created. In this situation, `update_mask` is ignored. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function updateTrigger($validateOnly, array $optionalArgs = []) + { + $request = new UpdateTriggerRequest(); + $requestParamHeaders = []; + $request->setValidateOnly($validateOnly); + if (isset($optionalArgs['trigger'])) { + $request->setTrigger($optionalArgs['trigger']); + } + + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + if (isset($optionalArgs['allowMissing'])) { + $request->setAllowMissing($optionalArgs['allowMissing']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('UpdateTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..3f2301e595f3 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json @@ -0,0 +1,88 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.cloud.eventarc.v1", + "libraryPackage": "Google\\Cloud\\Eventarc\\V1", + "services": { + "Eventarc": { + "clients": { + "grpc": { + "libraryClient": "EventarcGapicClient", + "rpcs": { + "CreateChannel": { + "methods": [ + "createChannel" + ] + }, + "CreateChannelConnection": { + "methods": [ + "createChannelConnection" + ] + }, + "CreateTrigger": { + "methods": [ + "createTrigger" + ] + }, + "DeleteChannel": { + "methods": [ + "deleteChannel" + ] + }, + "DeleteChannelConnection": { + "methods": [ + "deleteChannelConnection" + ] + }, + "DeleteTrigger": { + "methods": [ + "deleteTrigger" + ] + }, + "GetChannel": { + "methods": [ + "getChannel" + ] + }, + "GetChannelConnection": { + "methods": [ + "getChannelConnection" + ] + }, + "GetTrigger": { + "methods": [ + "getTrigger" + ] + }, + "ListChannelConnections": { + "methods": [ + "listChannelConnections" + ] + }, + "ListChannels": { + "methods": [ + "listChannels" + ] + }, + "ListTriggers": { + "methods": [ + "listTriggers" + ] + }, + "UpdateChannel": { + "methods": [ + "updateChannel" + ] + }, + "UpdateTrigger": { + "methods": [ + "updateTrigger" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json new file mode 100644 index 000000000000..378cd88f9176 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json @@ -0,0 +1,92 @@ +{ + "interfaces": { + "google.cloud.eventarc.v1.Eventarc": { + "retry_codes": { + "no_retry_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "CreateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateChannelConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "CreateTrigger": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteChannel": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteChannelConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "DeleteTrigger": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetChannel": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetChannelConnection": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "GetTrigger": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListChannelConnections": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListChannels": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "ListTriggers": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateChannel": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + }, + "UpdateTrigger": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_codes", + "retry_params_name": "no_retry_params" + } + } + } + } +} diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php new file mode 100644 index 000000000000..1f7aa10c4c20 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php @@ -0,0 +1,118 @@ + [ + 'google.cloud.eventarc.v1.Eventarc' => [ + 'CreateChannel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateChannelConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\ChannelConnection', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'CreateTrigger' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteChannel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteChannelConnection' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\ChannelConnection', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'DeleteTrigger' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateChannel' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'UpdateTrigger' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', + 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + ], + 'ListChannelConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChannelConnections', + ], + ], + 'ListChannels' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getChannels', + ], + ], + 'ListTriggers' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getTriggers', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php new file mode 100644 index 000000000000..36eea765f885 --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php @@ -0,0 +1,334 @@ + [ + 'google.cloud.eventarc.v1.Eventarc' => [ + 'CreateChannel' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channels', + 'body' => 'channel', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'channel_id', + 'validate_only', + ], + ], + 'CreateChannelConnection' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channelConnections', + 'body' => 'channel_connection', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'channel_connection_id', + ], + ], + 'CreateTrigger' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', + 'body' => 'trigger', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'trigger_id', + 'validate_only', + ], + ], + 'DeleteChannel' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/channels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'validate_only', + ], + ], + 'DeleteChannelConnection' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/channelConnections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteTrigger' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + 'queryParams' => [ + 'validate_only', + ], + ], + 'GetChannel' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/channels/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetChannelConnection' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/channelConnections/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetTrigger' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListChannelConnections' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channelConnections', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListChannels' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channels', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListTriggers' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'UpdateChannel' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{channel.name=projects/*/locations/*/channels/*}', + 'body' => 'channel', + 'placeholders' => [ + 'channel.name' => [ + 'getters' => [ + 'getChannel', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'validate_only', + ], + ], + 'UpdateTrigger' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{trigger.name=projects/*/locations/*/triggers/*}', + 'body' => 'trigger', + 'placeholders' => [ + 'trigger.name' => [ + 'getters' => [ + 'getTrigger', + 'getName', + ], + ], + ], + 'queryParams' => [ + 'validate_only', + ], + ], + ], + '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.iam.v1.IAMPolicy' => [ + 'GetIamPolicy' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:getIamPolicy', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:getIamPolicy', + ], + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:getIamPolicy', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'SetIamPolicy' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:setIamPolicy', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:setIamPolicy', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:setIamPolicy', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + 'TestIamPermissions' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:testIamPermissions', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:testIamPermissions', + 'body' => '*', + ], + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:testIamPermissions', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'resource' => [ + 'getters' => [ + 'getResource', + ], + ], + ], + ], + ], + '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', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php b/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php new file mode 100644 index 000000000000..038fc64146bf --- /dev/null +++ b/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php @@ -0,0 +1,1622 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** + * @return EventarcClient + */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new EventarcClient($options); + } + + /** + * @test + */ + public function createChannelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createChannelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $provider = 'provider-987494927'; + $pubsubTopic = 'pubsubTopic-338126829'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new Channel(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setProvider($provider); + $expectedResponse->setPubsubTopic($pubsubTopic); + $expectedResponse->setActivationToken($activationToken); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createChannelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $channel = new Channel(); + $channelName = 'channelName273953326'; + $channel->setName($channelName); + $channelProvider = 'channelProvider-519425004'; + $channel->setProvider($channelProvider); + $channelId = 'channelId-1930808873'; + $validateOnly = false; + $response = $client->createChannel($formattedParent, $channel, $channelId, $validateOnly); + $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.eventarc.v1.Eventarc/CreateChannel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getChannel(); + $this->assertProtobufEquals($channel, $actualValue); + $actualValue = $actualApiRequestObject->getChannelId(); + $this->assertProtobufEquals($channelId, $actualValue); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createChannelTest'); + $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 createChannelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createChannelTest'); + $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $channel = new Channel(); + $channelName = 'channelName273953326'; + $channel->setName($channelName); + $channelProvider = 'channelProvider-519425004'; + $channel->setProvider($channelProvider); + $channelId = 'channelId-1930808873'; + $validateOnly = false; + $response = $client->createChannel($formattedParent, $channel, $channelId, $validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createChannelTest'); + 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 createChannelConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createChannelConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $channel = 'channel738950403'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new ChannelConnection(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setChannel($channel); + $expectedResponse->setActivationToken($activationToken); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createChannelConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $channelConnection = new ChannelConnection(); + $channelConnectionName = 'channelConnectionName-46623124'; + $channelConnection->setName($channelConnectionName); + $channelConnectionChannel = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + $channelConnection->setChannel($channelConnectionChannel); + $channelConnectionId = 'channelConnectionId-1611273248'; + $response = $client->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); + $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.eventarc.v1.Eventarc/CreateChannelConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getChannelConnection(); + $this->assertProtobufEquals($channelConnection, $actualValue); + $actualValue = $actualApiRequestObject->getChannelConnectionId(); + $this->assertProtobufEquals($channelConnectionId, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createChannelConnectionTest'); + $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 createChannelConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createChannelConnectionTest'); + $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $channelConnection = new ChannelConnection(); + $channelConnectionName = 'channelConnectionName-46623124'; + $channelConnection->setName($channelConnectionName); + $channelConnectionChannel = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + $channelConnection->setChannel($channelConnectionChannel); + $channelConnectionId = 'channelConnectionId-1611273248'; + $response = $client->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createChannelConnectionTest'); + 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 createTriggerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTriggerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $serviceAccount = 'serviceAccount-1948028253'; + $channel = 'channel738950403'; + $etag = 'etag3123477'; + $expectedResponse = new Trigger(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setChannel($channel); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createTriggerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $trigger = new Trigger(); + $triggerName = 'triggerName-681138077'; + $trigger->setName($triggerName); + $triggerEventFilters = []; + $trigger->setEventFilters($triggerEventFilters); + $triggerDestination = new Destination(); + $trigger->setDestination($triggerDestination); + $triggerId = 'triggerId1363517698'; + $validateOnly = false; + $response = $client->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); + $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.eventarc.v1.Eventarc/CreateTrigger', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getTrigger(); + $this->assertProtobufEquals($trigger, $actualValue); + $actualValue = $actualApiRequestObject->getTriggerId(); + $this->assertProtobufEquals($triggerId, $actualValue); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTriggerTest'); + $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 createTriggerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createTriggerTest'); + $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $trigger = new Trigger(); + $triggerName = 'triggerName-681138077'; + $trigger->setName($triggerName); + $triggerEventFilters = []; + $trigger->setEventFilters($triggerEventFilters); + $triggerDestination = new Destination(); + $trigger->setDestination($triggerDestination); + $triggerId = 'triggerId1363517698'; + $validateOnly = false; + $response = $client->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createTriggerTest'); + 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 deleteChannelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteChannelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $provider = 'provider-987494927'; + $pubsubTopic = 'pubsubTopic-338126829'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new Channel(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setProvider($provider); + $expectedResponse->setPubsubTopic($pubsubTopic); + $expectedResponse->setActivationToken($activationToken); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteChannelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + $validateOnly = false; + $response = $client->deleteChannel($formattedName, $validateOnly); + $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.eventarc.v1.Eventarc/DeleteChannel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteChannelTest'); + $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 deleteChannelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteChannelTest'); + $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 = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + $validateOnly = false; + $response = $client->deleteChannel($formattedName, $validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteChannelTest'); + 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 deleteChannelConnectionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteChannelConnectionTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $channel = 'channel738950403'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new ChannelConnection(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setChannel($channel); + $expectedResponse->setActivationToken($activationToken); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteChannelConnectionTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + $response = $client->deleteChannelConnection($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteChannelConnectionTest'); + $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 deleteChannelConnectionExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteChannelConnectionTest'); + $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 = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + $response = $client->deleteChannelConnection($formattedName); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteChannelConnectionTest'); + 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 deleteTriggerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTriggerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $serviceAccount = 'serviceAccount-1948028253'; + $channel = 'channel738950403'; + $etag2 = 'etag2-1293302904'; + $expectedResponse = new Trigger(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setChannel($channel); + $expectedResponse->setEtag($etag2); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteTriggerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + $validateOnly = false; + $response = $client->deleteTrigger($formattedName, $validateOnly); + $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.eventarc.v1.Eventarc/DeleteTrigger', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTriggerTest'); + $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 deleteTriggerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteTriggerTest'); + $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 = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + $validateOnly = false; + $response = $client->deleteTrigger($formattedName, $validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteTriggerTest'); + 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 getChannelTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $provider = 'provider-987494927'; + $pubsubTopic = 'pubsubTopic-338126829'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new Channel(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setProvider($provider); + $expectedResponse->setPubsubTopic($pubsubTopic); + $expectedResponse->setActivationToken($activationToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + $response = $client->getChannel($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetChannel', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getChannelExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); + try { + $client->getChannel($formattedName); + // If the $client 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 getChannelConnectionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $channel = 'channel738950403'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new ChannelConnection(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setChannel($channel); + $expectedResponse->setActivationToken($activationToken); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + $response = $client->getChannelConnection($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetChannelConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getChannelConnectionExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); + try { + $client->getChannelConnection($formattedName); + // If the $client 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 getTriggerTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $uid = 'uid115792'; + $serviceAccount = 'serviceAccount-1948028253'; + $channel = 'channel738950403'; + $etag = 'etag3123477'; + $expectedResponse = new Trigger(); + $expectedResponse->setName($name2); + $expectedResponse->setUid($uid); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setChannel($channel); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + $response = $client->getTrigger($formattedName); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetTrigger', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getTriggerExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); + try { + $client->getTrigger($formattedName); + // If the $client 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 listChannelConnectionsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $channelConnectionsElement = new ChannelConnection(); + $channelConnections = [ + $channelConnectionsElement, + ]; + $expectedResponse = new ListChannelConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setChannelConnections($channelConnections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->listChannelConnections($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getChannelConnections()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListChannelConnections', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listChannelConnectionsExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listChannelConnections($formattedParent); + // If the $client 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 listChannelsTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $channelsElement = new Channel(); + $channels = [ + $channelsElement, + ]; + $expectedResponse = new ListChannelsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setChannels($channels); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->listChannels($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getChannels()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListChannels', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listChannelsExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listChannels($formattedParent); + // If the $client 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 listTriggersTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $triggersElement = new Trigger(); + $triggers = [ + $triggersElement, + ]; + $expectedResponse = new ListTriggersResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setTriggers($triggers); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $response = $client->listTriggers($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getTriggers()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListTriggers', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listTriggersExceptionTest() + { + $transport = $this->createTransport(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + try { + $client->listTriggers($formattedParent); + // If the $client 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 updateChannelTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateChannelTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $provider = 'provider-987494927'; + $pubsubTopic = 'pubsubTopic-338126829'; + $activationToken = 'activationToken1250030992'; + $expectedResponse = new Channel(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setProvider($provider); + $expectedResponse->setPubsubTopic($pubsubTopic); + $expectedResponse->setActivationToken($activationToken); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateChannelTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $validateOnly = false; + $response = $client->updateChannel($validateOnly); + $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.eventarc.v1.Eventarc/UpdateChannel', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateChannelTest'); + $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 updateChannelExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateChannelTest'); + $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 + $validateOnly = false; + $response = $client->updateChannel($validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateChannelTest'); + 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 updateTriggerTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTriggerTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $uid = 'uid115792'; + $serviceAccount = 'serviceAccount-1948028253'; + $channel = 'channel738950403'; + $etag = 'etag3123477'; + $expectedResponse = new Trigger(); + $expectedResponse->setName($name); + $expectedResponse->setUid($uid); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setChannel($channel); + $expectedResponse->setEtag($etag); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateTriggerTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $validateOnly = false; + $response = $client->updateTrigger($validateOnly); + $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.eventarc.v1.Eventarc/UpdateTrigger', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getValidateOnly(); + $this->assertProtobufEquals($validateOnly, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTriggerTest'); + $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 updateTriggerExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'serviceAddress' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateTriggerTest'); + $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 + $validateOnly = false; + $response = $client->updateTrigger($validateOnly); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateTriggerTest'); + 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()); + } +} From 55ef6fa64c145de09b1980970f56c75116532e4c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 4 May 2022 17:57:27 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Eventarc/metadata/V1/Channel.php | Bin 1646 -> 1556 bytes Eventarc/metadata/V1/ChannelConnection.php | 5 +- Eventarc/metadata/V1/Trigger.php | Bin 2637 -> 2547 bytes .../Google/Cloud/Eventarc/V1/Channel.php | Bin 1556 -> 0 bytes .../Cloud/Eventarc/V1/ChannelConnection.php | 39 - .../Google/Cloud/Eventarc/V1/Eventarc.php | 146 -- .../Google/Cloud/Eventarc/V1/Trigger.php | Bin 2547 -> 0 bytes .../src/Google/Cloud/Eventarc/V1/Channel.php | 370 ---- .../Cloud/Eventarc/V1/Channel/State.php | 82 - .../Cloud/Eventarc/V1/ChannelConnection.php | 284 --- .../Cloud/Eventarc/V1/Channel_State.php | 16 - .../src/Google/Cloud/Eventarc/V1/CloudRun.php | 155 -- .../V1/CreateChannelConnectionRequest.php | 145 -- .../Eventarc/V1/CreateChannelRequest.php | 183 -- .../Eventarc/V1/CreateTriggerRequest.php | 183 -- .../V1/DeleteChannelConnectionRequest.php | 67 - .../Eventarc/V1/DeleteChannelRequest.php | 105 -- .../Eventarc/V1/DeleteTriggerRequest.php | 181 -- .../Google/Cloud/Eventarc/V1/Destination.php | 150 -- .../Google/Cloud/Eventarc/V1/EventFilter.php | 155 -- .../Cloud/Eventarc/V1/EventarcGrpcClient.php | 246 --- .../src/Google/Cloud/Eventarc/V1/GKE.php | 223 --- .../V1/GetChannelConnectionRequest.php | 67 - .../Cloud/Eventarc/V1/GetChannelRequest.php | 67 - .../Cloud/Eventarc/V1/GetTriggerRequest.php | 67 - .../V1/ListChannelConnectionsRequest.php | 151 -- .../V1/ListChannelConnectionsResponse.php | 147 -- .../Cloud/Eventarc/V1/ListChannelsRequest.php | 197 -- .../Eventarc/V1/ListChannelsResponse.php | 139 -- .../Cloud/Eventarc/V1/ListTriggersRequest.php | 197 -- .../Eventarc/V1/ListTriggersResponse.php | 139 -- .../Cloud/Eventarc/V1/OperationMetadata.php | 303 --- .../src/Google/Cloud/Eventarc/V1/Pubsub.php | 129 -- .../Google/Cloud/Eventarc/V1/Transport.php | 79 - .../src/Google/Cloud/Eventarc/V1/Trigger.php | 535 ------ .../Eventarc/V1/UpdateChannelRequest.php | 167 -- .../Eventarc/V1/UpdateTriggerRequest.php | 205 --- .../Eventarc/v1/src/V1/EventarcClient.php | 34 - .../v1/src/V1/Gapic/EventarcGapicClient.php | 1410 -------------- .../Eventarc/v1/src/V1/gapic_metadata.json | 88 - .../V1/resources/eventarc_client_config.json | 92 - .../resources/eventarc_descriptor_config.php | 118 -- .../resources/eventarc_rest_client_config.php | 334 ---- .../v1/tests/Unit/V1/EventarcClientTest.php | 1622 ----------------- 44 files changed, 2 insertions(+), 9020 deletions(-) delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/ChannelConnection.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CloudRun.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/Gapic/EventarcGapicClient.php delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php delete mode 100644 owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php delete mode 100644 owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php diff --git a/Eventarc/metadata/V1/Channel.php b/Eventarc/metadata/V1/Channel.php index 01c070b2b77300ac7924f4c5bea686b052f07d36..7f8a693bb823291fd60bac23dfe4ec6fa3ecc54e 100644 GIT binary patch delta 22 ecmaFIGlgfvA;!tS8ILd?o_v7GWwR=?Co=$a3kc-^ delta 81 zcmV-X0IvU(4DJlD!T}3GZfinternalAddGeneratedFile( ' -­ -1google/cloud/eventarc/v1/channel_connection.protogoogle.cloud.eventarc.v1google/api/field_behavior.protogoogle/api/resource.protogoogle/protobuf/timestamp.proto"§ +Œ +1google/cloud/eventarc/v1/channel_connection.protogoogle.cloud.eventarc.v1google/api/resource.protogoogle/protobuf/timestamp.proto"§ ChannelConnection name ( BàA uid ( BàA8 diff --git a/Eventarc/metadata/V1/Trigger.php b/Eventarc/metadata/V1/Trigger.php index b284bf546369a5e0786435173b9cd509a344db50..213b42feec665681cca41206bccdc8e7be464cea 100644 GIT binary patch delta 22 ecmX>r@>zJpA;!tS8ILe7n|y%DWwR=?20H+FZV31Q delta 81 zcmV-X0IvV@6U`K`!T}3GZf- diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Channel.php deleted file mode 100644 index 7f8a693bb823291fd60bac23dfe4ec6fa3ecc54e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1556 zcma)6-EPw`7+qVob>4)!NRz?_ni+_72oiO0l`^1RyV47~ij`iVNR#Wjts%1`$EgHU zUx?R$E1rVu-SPrBiIYz1CapJh?C%_(@5krOJAdMXC$L2r5lE6D9DIjzLZC0WJec<*f@oq(;jR#+P%jL8t_nH;=nQIV~^O_&{v7H|om`uX9&qZkGf zN%i-X2IrJfNs&i?s2q;q2zdcf*u~gU$grfG!3c25Fex9vgfohL>T{Lz5lr=TqcW%x zxNRnhV90YDB*23Dl8deib(}GgS@EKs@`1iKqN5{NPBc2sg2*E%MM$pS4xu126s#KS zjtFMi%DtglHJ`dClz78BnV>1VecSdF9=uy=~i7xz`Z;Z?M@-5Xx zs||-)jZV}Qm9wm(9QVPm74YnC<71dfoE49mm5!M;t!zKg49KUp(3vGOx4o;6;t5pU zv}Gzk3E2Br0IPbyj7@Ma8c{O`bLF*q;cqQ(lt3Y*Lo=W56pYtk9Sfo!%y~p*E~}IE z!);58OYgC=GDSQwD)iO3Yt+i!P+Op=2&Z&Ngt?kZ$QwIgL%o6^9Gpw;Q*0K~qr!(J zqY9Rzxg+M9+P#11?x)fg>SpP@t+OaT(fJ6Jka{Fj^|&}w^xp_GK}NsV1j})-u?05I zdbM8j{B!55+dOWcw4066lCcg}yUk9c-D#C_1^_Fy<6gVpEai<2P;7VfSHTIcYChP_ zTA0*MbuX}#+1P129F_Z5f@NS|>ebBlIF6;My>vNCZAR_k#42Xbi+U9tuIg2N9jr-# zSm1LZ>%Vj0p}OnV+SE6+if&{B-Q1V=y1`@aAvU(S7~5mQlrG8bx&B2DtfpE1%$u#) z>8#l4tkmhOe&tVk-tl`yu_OMinternalAddGeneratedFile( - ' -Œ -1google/cloud/eventarc/v1/channel_connection.protogoogle.cloud.eventarc.v1google/api/resource.protogoogle/protobuf/timestamp.proto"§ -ChannelConnection -name ( BàA -uid ( BàA8 -channel ( B\'àAúA! -eventarc.googleapis.com/Channel4 - create_time ( 2.google.protobuf.TimestampBàA4 - update_time ( 2.google.protobuf.TimestampBàA -activation_token ( BàA:§êA£ -)eventarc.googleapis.com/ChannelConnectionOprojects/{project}/locations/{location}/channelConnections/{channel_connection}*channelConnections2channelConnectionBÎ -com.google.cloud.eventarc.v1BChannelConnectionProtoPZ@google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarcªGoogle.Cloud.Eventarc.V1ÊGoogle\\Cloud\\Eventarc\\V1êGoogle::Cloud::Eventarc::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php deleted file mode 100644 index a02b576e6a2a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Eventarc.php +++ /dev/null @@ -1,146 +0,0 @@ -internalAddGeneratedFile( - ' -0 -\'google/cloud/eventarc/v1/eventarc.protogoogle.cloud.eventarc.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto&google/cloud/eventarc/v1/channel.proto1google/cloud/eventarc/v1/channel_connection.proto&google/cloud/eventarc/v1/trigger.proto#google/longrunning/operations.proto google/protobuf/field_mask.protogoogle/protobuf/timestamp.proto"J -GetTriggerRequest5 -name ( B\'àAúA! -eventarc.googleapis.com/Trigger"‡ -ListTriggersRequest7 -parent ( B\'àAúA!eventarc.googleapis.com/Trigger - page_size ( - -page_token (  -order_by ( "y -ListTriggersResponse3 -triggers ( 2!.google.cloud.eventarc.v1.Trigger -next_page_token (  - unreachable ( "½ -CreateTriggerRequest7 -parent ( B\'àAúA!eventarc.googleapis.com/Trigger7 -trigger ( 2!.google.cloud.eventarc.v1.TriggerBàA - -trigger_id ( BàA - validate_only (BàA"® -UpdateTriggerRequest2 -trigger ( 2!.google.cloud.eventarc.v1.Trigger/ - update_mask ( 2.google.protobuf.FieldMask - allow_missing ( - validate_only (BàA"Ž -DeleteTriggerRequest5 -name ( B\'àAúA! -eventarc.googleapis.com/Trigger -etag (  - allow_missing ( - validate_only (BàA"J -GetChannelRequest5 -name ( B\'àAúA! -eventarc.googleapis.com/Channel"‡ -ListChannelsRequest7 -parent ( B\'àAúA!eventarc.googleapis.com/Channel - page_size ( - -page_token (  -order_by ( "y -ListChannelsResponse3 -channels ( 2!.google.cloud.eventarc.v1.Channel -next_page_token (  - unreachable ( "½ -CreateChannelRequest7 -parent ( B\'àAúA!eventarc.googleapis.com/Channel7 -channel ( 2!.google.cloud.eventarc.v1.ChannelBàA - -channel_id ( BàA - validate_only (BàA"— -UpdateChannelRequest2 -channel ( 2!.google.cloud.eventarc.v1.Channel/ - update_mask ( 2.google.protobuf.FieldMask - validate_only (BàA"i -DeleteChannelRequest5 -name ( B\'àAúA! -eventarc.googleapis.com/Channel - validate_only (BàA"^ -GetChannelConnectionRequest? -name ( B1àAúA+ -)eventarc.googleapis.com/ChannelConnection"‰ -ListChannelConnectionsRequestA -parent ( B1àAúA+)eventarc.googleapis.com/ChannelConnection - page_size ( - -page_token ( "˜ -ListChannelConnectionsResponseH -channel_connections ( 2+.google.cloud.eventarc.v1.ChannelConnection -next_page_token (  - unreachable ( "Õ -CreateChannelConnectionRequestA -parent ( B1àAúA+)eventarc.googleapis.com/ChannelConnectionL -channel_connection ( 2+.google.cloud.eventarc.v1.ChannelConnectionBàA" -channel_connection_id ( BàA"a -DeleteChannelConnectionRequest? -name ( B1àAúA+ -)eventarc.googleapis.com/ChannelConnection"€ -OperationMetadata4 - create_time ( 2.google.protobuf.TimestampBàA1 -end_time ( 2.google.protobuf.TimestampBàA -target ( BàA -verb ( BàA -status_message ( BàA# -requested_cancellation (BàA - api_version ( BàA2™ -Eventarc™ - -GetTrigger+.google.cloud.eventarc.v1.GetTriggerRequest!.google.cloud.eventarc.v1.Trigger";‚Óä“.,/v1/{name=projects/*/locations/*/triggers/*}ÚAname¬ - ListTriggers-.google.cloud.eventarc.v1.ListTriggersRequest..google.cloud.eventarc.v1.ListTriggersResponse"=‚Óä“.,/v1/{parent=projects/*/locations/*}/triggersÚAparentØ - CreateTrigger..google.cloud.eventarc.v1.CreateTriggerRequest.google.longrunning.Operation"x‚Óä“7",/v1/{parent=projects/*/locations/*}/triggers:triggerÚAparent,trigger,trigger_idÊA -TriggerOperationMetadataé - UpdateTrigger..google.cloud.eventarc.v1.UpdateTriggerRequest.google.longrunning.Operation"ˆ‚Óä“?24/v1/{trigger.name=projects/*/locations/*/triggers/*}:triggerÚA!trigger,update_mask,allow_missingÊA -TriggerOperationMetadataÈ - DeleteTrigger..google.cloud.eventarc.v1.DeleteTriggerRequest.google.longrunning.Operation"h‚Óä“.*,/v1/{name=projects/*/locations/*/triggers/*}ÚAname,allow_missingÊA -TriggerOperationMetadata™ - -GetChannel+.google.cloud.eventarc.v1.GetChannelRequest!.google.cloud.eventarc.v1.Channel";‚Óä“.,/v1/{name=projects/*/locations/*/channels/*}ÚAname¬ - ListChannels-.google.cloud.eventarc.v1.ListChannelsRequest..google.cloud.eventarc.v1.ListChannelsResponse"=‚Óä“.,/v1/{parent=projects/*/locations/*}/channelsÚAparentØ - CreateChannel..google.cloud.eventarc.v1.CreateChannelRequest.google.longrunning.Operation"x‚Óä“7",/v1/{parent=projects/*/locations/*}/channels:channelÚAparent,channel,channel_idÊA -ChannelOperationMetadataÚ - UpdateChannel..google.cloud.eventarc.v1.UpdateChannelRequest.google.longrunning.Operation"z‚Óä“?24/v1/{channel.name=projects/*/locations/*/channels/*}:channelÚAchannel,update_maskÊA -ChannelOperationMetadataº - DeleteChannel..google.cloud.eventarc.v1.DeleteChannelRequest.google.longrunning.Operation"Z‚Óä“.*,/v1/{name=projects/*/locations/*/channels/*}ÚAnameÊA -ChannelOperationMetadataÁ -GetChannelConnection5.google.cloud.eventarc.v1.GetChannelConnectionRequest+.google.cloud.eventarc.v1.ChannelConnection"E‚Óä“86/v1/{name=projects/*/locations/*/channelConnections/*}ÚAnameÔ -ListChannelConnections7.google.cloud.eventarc.v1.ListChannelConnectionsRequest8.google.cloud.eventarc.v1.ListChannelConnectionsResponse"G‚Óä“86/v1/{parent=projects/*/locations/*}/channelConnectionsÚAparent¢ -CreateChannelConnection8.google.cloud.eventarc.v1.CreateChannelConnectionRequest.google.longrunning.Operation"­‚Óä“L"6/v1/{parent=projects/*/locations/*}/channelConnections:channel_connectionÚA/parent,channel_connection,channel_connection_idÊA& -ChannelConnectionOperationMetadataâ -DeleteChannelConnection8.google.cloud.eventarc.v1.DeleteChannelConnectionRequest.google.longrunning.Operation"n‚Óä“8*6/v1/{name=projects/*/locations/*/channelConnections/*}ÚAnameÊA& -ChannelConnectionOperationMetadataKÊAeventarc.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBÅ -com.google.cloud.eventarc.v1B EventarcProtoPZ@google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarcªGoogle.Cloud.Eventarc.V1ÊGoogle\\Cloud\\Eventarc\\V1êGoogle::Cloud::Eventarc::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php b/owl-bot-staging/Eventarc/v1/proto/src/GPBMetadata/Google/Cloud/Eventarc/V1/Trigger.php deleted file mode 100644 index 213b42feec665681cca41206bccdc8e7be464cea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2547 zcmb7GZBH9V5YE}b;4#ql`l1U;#m1x!q`_B6q*Nv}J(riHZ&;~Ssg)(PKCh20$K7df z&k{xcJN*OwAN>XWz-N8}pE|dndeHzE4 zlSP3uAov$0J)gTImQ>=uhde&y0hgTm{4cCwn+&KQGxWV`J4gao@-QH&!$IJ()isjE zOl==VA=bQ2@_gDU3BQ;J#!F;=Us^0`woKZJ6^`&KF6 zDVxur<_d-bbC`y*X7EdGbE%<|%g<>PFr{&nR}vxJwO8eKUOTX$>O359A4wQnbEJ%? zeUYDb1&W569|Rh$Ta|MMexM}nt*WYL?c6agofUY%>4^@B5XKFh zc>CAP!^s@Xmr(0t+j)Rf7X}un{BOtuXC*hzfZT$r6f}sVP)Mt$+*hWT(aB9yX9Fv! z__W9T*qT=Wtl#9BNzPBoem9WfG>h>G%(_Q32$*jzsOnW@Y&q(XXSw-Sd1)PL6V7H0 z%E#<9zC}7N~)kI?a$y^!RXL>cV{m@lt;$FTS z<&ueeT0BRO=kzMxoYkv(8)_4sHa~+ZmH4ff$hX*QzLjp)h)-cIj8er9g;mb0HtPQx zP@8C)`5dZ>U56qGRPnXV`gGKlc)v-4S9i=GU@>#dgoogle.cloud.eventarc.v1.Channel - */ -class Channel extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the channel. Must be unique within the location - * on the project and must be in - * `projects/{project}/locations/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Output only. Server assigned unique identifier for the channel. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated - * with the channel. This provider will be granted permissions to publish - * events to the channel. Format: - * `projects/{project}/locations/{location}/providers/{provider_id}`. - * - * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $provider = ''; - /** - * Output only. The state of a Channel. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - /** - * Output only. The activation token for the channel. The token must be used by the - * provider to register the channel for publishing. - * - * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $activation_token = ''; - protected $transport; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the channel. Must be unique within the location - * on the project and must be in - * `projects/{project}/locations/{location}/channels/{channel_id}` format. - * @type string $uid - * Output only. Server assigned unique identifier for the channel. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type string $provider - * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated - * with the channel. This provider will be granted permissions to publish - * events to the channel. Format: - * `projects/{project}/locations/{location}/providers/{provider_id}`. - * @type string $pubsub_topic - * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as - * a transport for the event delivery. Format: - * `projects/{project}/topics/{topic_id}`. - * @type int $state - * Output only. The state of a Channel. - * @type string $activation_token - * Output only. The activation token for the channel. The token must be used by the - * provider to register the channel for publishing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Channel::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the channel. Must be unique within the location - * on the project and must be in - * `projects/{project}/locations/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the channel. Must be unique within the location - * on the project and must be in - * `projects/{project}/locations/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned unique identifier for the channel. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned unique identifier for the channel. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated - * with the channel. This provider will be granted permissions to publish - * events to the channel. Format: - * `projects/{project}/locations/{location}/providers/{provider_id}`. - * - * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProvider() - { - return $this->provider; - } - - /** - * Required. The name of the event provider (e.g. Eventarc SaaS partner) associated - * with the channel. This provider will be granted permissions to publish - * events to the channel. Format: - * `projects/{project}/locations/{location}/providers/{provider_id}`. - * - * Generated from protobuf field string provider = 7 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProvider($var) - { - GPBUtil::checkString($var, True); - $this->provider = $var; - - return $this; - } - - /** - * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as - * a transport for the event delivery. Format: - * `projects/{project}/topics/{topic_id}`. - * - * Generated from protobuf field string pubsub_topic = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getPubsubTopic() - { - return $this->readOneof(8); - } - - public function hasPubsubTopic() - { - return $this->hasOneof(8); - } - - /** - * Output only. The name of the Pub/Sub topic created and managed by Eventarc system as - * a transport for the event delivery. Format: - * `projects/{project}/topics/{topic_id}`. - * - * Generated from protobuf field string pubsub_topic = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setPubsubTopic($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Output only. The state of a Channel. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of a Channel. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel.State state = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Eventarc\V1\Channel\State::class); - $this->state = $var; - - return $this; - } - - /** - * Output only. The activation token for the channel. The token must be used by the - * provider to register the channel for publishing. - * - * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getActivationToken() - { - return $this->activation_token; - } - - /** - * Output only. The activation token for the channel. The token must be used by the - * provider to register the channel for publishing. - * - * Generated from protobuf field string activation_token = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setActivationToken($var) - { - GPBUtil::checkString($var, True); - $this->activation_token = $var; - - return $this; - } - - /** - * @return string - */ - public function getTransport() - { - return $this->whichOneof("transport"); - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php deleted file mode 100644 index a7be8b4fc092..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel/State.php +++ /dev/null @@ -1,82 +0,0 @@ -google.cloud.eventarc.v1.Channel.State - */ -class State -{ - /** - * Default value. This value is unused. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The PENDING state indicates that a Channel has been created successfully - * and there is a new activation token available for the subscriber to use - * to convey the Channel to the provider in order to create a Connection. - * - * Generated from protobuf enum PENDING = 1; - */ - const PENDING = 1; - /** - * The ACTIVE state indicates that a Channel has been successfully - * connected with the event provider. - * An ACTIVE Channel is ready to receive and route events from the - * event provider. - * - * Generated from protobuf enum ACTIVE = 2; - */ - const ACTIVE = 2; - /** - * The INACTIVE state means that the Channel cannot receive events - * permanently. There are two possible cases this state can happen: - * 1. The SaaS provider disconnected from this Channel. - * 2. The Channel activation token has expired but the SaaS provider - * wasn't connected. - * To re-establish a Connection with a provider, the subscriber - * should create a new Channel and give it to the provider. - * - * Generated from protobuf enum INACTIVE = 3; - */ - const INACTIVE = 3; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::PENDING => 'PENDING', - self::ACTIVE => 'ACTIVE', - self::INACTIVE => 'INACTIVE', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(State::class, \Google\Cloud\Eventarc\V1\Channel_State::class); - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php deleted file mode 100644 index 1478f29772d9..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ChannelConnection.php +++ /dev/null @@ -1,284 +0,0 @@ -google.cloud.eventarc.v1.ChannelConnection - */ -class ChannelConnection extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the connection. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Output only. Server assigned ID of the resource. - * The server guarantees uniqueness and immutability until deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Required. The name of the connected subscriber Channel. - * This is a weak reference to avoid cross project and cross accounts - * references. This must be in - * `projects/{project}/location/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $channel = ''; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Input only. Activation token for the channel. The token will be used - * during the creation of ChannelConnection to bind the channel with the - * provider project. This field will not be stored in the provider resource. - * - * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; - */ - protected $activation_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the connection. - * @type string $uid - * Output only. Server assigned ID of the resource. - * The server guarantees uniqueness and immutability until deleted. - * @type string $channel - * Required. The name of the connected subscriber Channel. - * This is a weak reference to avoid cross project and cross accounts - * references. This must be in - * `projects/{project}/location/{location}/channels/{channel_id}` format. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type string $activation_token - * Input only. Activation token for the channel. The token will be used - * during the creation of ChannelConnection to bind the channel with the - * provider project. This field will not be stored in the provider resource. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\ChannelConnection::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the connection. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the connection. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server assigned ID of the resource. - * The server guarantees uniqueness and immutability until deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server assigned ID of the resource. - * The server guarantees uniqueness and immutability until deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Required. The name of the connected subscriber Channel. - * This is a weak reference to avoid cross project and cross accounts - * references. This must be in - * `projects/{project}/location/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getChannel() - { - return $this->channel; - } - - /** - * Required. The name of the connected subscriber Channel. - * This is a weak reference to avoid cross project and cross accounts - * references. This must be in - * `projects/{project}/location/{location}/channels/{channel_id}` format. - * - * Generated from protobuf field string channel = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setChannel($var) - { - GPBUtil::checkString($var, True); - $this->channel = $var; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Input only. Activation token for the channel. The token will be used - * during the creation of ChannelConnection to bind the channel with the - * provider project. This field will not be stored in the provider resource. - * - * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return string - */ - public function getActivationToken() - { - return $this->activation_token; - } - - /** - * Input only. Activation token for the channel. The token will be used - * during the creation of ChannelConnection to bind the channel with the - * provider project. This field will not be stored in the provider resource. - * - * Generated from protobuf field string activation_token = 8 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setActivationToken($var) - { - GPBUtil::checkString($var, True); - $this->activation_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php deleted file mode 100644 index f91006931d59..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Channel_State.php +++ /dev/null @@ -1,16 +0,0 @@ -google.cloud.eventarc.v1.CloudRun - */ -class CloudRun extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the Cloud Run service being addressed. See - * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. - * Only services located in the same project as the trigger object - * can be addressed. - * - * Generated from protobuf field string service = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $service = ''; - /** - * Optional. The relative path on the Cloud Run service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - /** - * Required. The region the Cloud Run service is deployed in. - * - * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $region = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $service - * Required. The name of the Cloud Run service being addressed. See - * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. - * Only services located in the same project as the trigger object - * can be addressed. - * @type string $path - * Optional. The relative path on the Cloud Run service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * @type string $region - * Required. The region the Cloud Run service is deployed in. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the Cloud Run service being addressed. See - * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. - * Only services located in the same project as the trigger object - * can be addressed. - * - * 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 name of the Cloud Run service being addressed. See - * https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services. - * Only services located in the same project as the trigger object - * can be addressed. - * - * 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; - } - - /** - * Optional. The relative path on the Cloud Run service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. The relative path on the Cloud Run service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 2 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - - /** - * Required. The region the Cloud Run service is deployed in. - * - * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getRegion() - { - return $this->region; - } - - /** - * Required. The region the Cloud Run service is deployed in. - * - * Generated from protobuf field string region = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setRegion($var) - { - GPBUtil::checkString($var, True); - $this->region = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php deleted file mode 100644 index 7935f51e19a7..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelConnectionRequest.php +++ /dev/null @@ -1,145 +0,0 @@ -google.cloud.eventarc.v1.CreateChannelConnectionRequest - */ -class CreateChannelConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection in which to add this channel connection. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. Channel connection to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $channel_connection = null; - /** - * Required. The user-provided ID to be assigned to the channel connection. - * - * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $channel_connection_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection in which to add this channel connection. - * @type \Google\Cloud\Eventarc\V1\ChannelConnection $channel_connection - * Required. Channel connection to create. - * @type string $channel_connection_id - * Required. The user-provided ID to be assigned to the channel connection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection in which to add this channel connection. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection in which to add this channel connection. - * - * 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. Channel connection to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Eventarc\V1\ChannelConnection|null - */ - public function getChannelConnection() - { - return $this->channel_connection; - } - - public function hasChannelConnection() - { - return isset($this->channel_connection); - } - - public function clearChannelConnection() - { - unset($this->channel_connection); - } - - /** - * Required. Channel connection to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.ChannelConnection channel_connection = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Eventarc\V1\ChannelConnection $var - * @return $this - */ - public function setChannelConnection($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\ChannelConnection::class); - $this->channel_connection = $var; - - return $this; - } - - /** - * Required. The user-provided ID to be assigned to the channel connection. - * - * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getChannelConnectionId() - { - return $this->channel_connection_id; - } - - /** - * Required. The user-provided ID to be assigned to the channel connection. - * - * Generated from protobuf field string channel_connection_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setChannelConnectionId($var) - { - GPBUtil::checkString($var, True); - $this->channel_connection_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php deleted file mode 100644 index 751a74b4f102..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateChannelRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.eventarc.v1.CreateChannelRequest - */ -class CreateChannelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection in which to add this channel. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The channel to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $channel = null; - /** - * Required. The user-provided ID to be assigned to the channel. - * - * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $channel_id = ''; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection in which to add this channel. - * @type \Google\Cloud\Eventarc\V1\Channel $channel - * Required. The channel to create. - * @type string $channel_id - * Required. The user-provided ID to be assigned to the channel. - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection in which to add this channel. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection in which to add this channel. - * - * 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 channel to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Eventarc\V1\Channel|null - */ - public function getChannel() - { - return $this->channel; - } - - public function hasChannel() - { - return isset($this->channel); - } - - public function clearChannel() - { - unset($this->channel); - } - - /** - * Required. The channel to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Eventarc\V1\Channel $var - * @return $this - */ - public function setChannel($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Channel::class); - $this->channel = $var; - - return $this; - } - - /** - * Required. The user-provided ID to be assigned to the channel. - * - * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getChannelId() - { - return $this->channel_id; - } - - /** - * Required. The user-provided ID to be assigned to the channel. - * - * Generated from protobuf field string channel_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setChannelId($var) - { - GPBUtil::checkString($var, True); - $this->channel_id = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php deleted file mode 100644 index f7e0fb54cf2b..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/CreateTriggerRequest.php +++ /dev/null @@ -1,183 +0,0 @@ -google.cloud.eventarc.v1.CreateTriggerRequest - */ -class CreateTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection in which to add this trigger. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * Required. The trigger to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $trigger = null; - /** - * Required. The user-provided ID to be assigned to the trigger. - * - * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $trigger_id = ''; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection in which to add this trigger. - * @type \Google\Cloud\Eventarc\V1\Trigger $trigger - * Required. The trigger to create. - * @type string $trigger_id - * Required. The user-provided ID to be assigned to the trigger. - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection in which to add this trigger. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection in which to add this trigger. - * - * 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 trigger to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Eventarc\V1\Trigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * Required. The trigger to create. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Eventarc\V1\Trigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Trigger::class); - $this->trigger = $var; - - return $this; - } - - /** - * Required. The user-provided ID to be assigned to the trigger. - * - * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTriggerId() - { - return $this->trigger_id; - } - - /** - * Required. The user-provided ID to be assigned to the trigger. - * - * Generated from protobuf field string trigger_id = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTriggerId($var) - { - GPBUtil::checkString($var, True); - $this->trigger_id = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php deleted file mode 100644 index 05118ef90569..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelConnectionRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.eventarc.v1.DeleteChannelConnectionRequest - */ -class DeleteChannelConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the channel connection to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the channel connection to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the channel connection to delete. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the channel connection to delete. - * - * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php deleted file mode 100644 index 96942e292e99..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteChannelRequest.php +++ /dev/null @@ -1,105 +0,0 @@ -google.cloud.eventarc.v1.DeleteChannelRequest - */ -class DeleteChannelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the channel to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the channel to be deleted. - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the channel to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the channel to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php deleted file mode 100644 index 88ac83e8d2fb..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/DeleteTriggerRequest.php +++ /dev/null @@ -1,181 +0,0 @@ -google.cloud.eventarc.v1.DeleteTriggerRequest - */ -class DeleteTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the trigger to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - /** - * If provided, the trigger will only be deleted if the etag matches the - * current etag on the resource. - * - * Generated from protobuf field string etag = 2; - */ - protected $etag = ''; - /** - * If set to true, and the trigger is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the trigger to be deleted. - * @type string $etag - * If provided, the trigger will only be deleted if the etag matches the - * current etag on the resource. - * @type bool $allow_missing - * If set to true, and the trigger is not found, the request will succeed - * but no action will be taken on the server. - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the trigger to be deleted. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the trigger to be deleted. - * - * 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; - } - - /** - * If provided, the trigger will only be deleted if the etag matches the - * current etag on the resource. - * - * Generated from protobuf field string etag = 2; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * If provided, the trigger will only be deleted if the etag matches the - * current etag on the resource. - * - * Generated from protobuf field string etag = 2; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - - /** - * If set to true, and the trigger is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the trigger is not found, the request will succeed - * but no action will be taken on the server. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php deleted file mode 100644 index 22e3208c1dbc..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Destination.php +++ /dev/null @@ -1,150 +0,0 @@ -google.cloud.eventarc.v1.Destination - */ -class Destination extends \Google\Protobuf\Internal\Message -{ - protected $descriptor; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\CloudRun $cloud_run - * Cloud Run fully-managed resource that receives the events. The resource - * should be in the same project as the trigger. - * @type string $cloud_function - * The Cloud Function resource name. Only Cloud Functions V2 is supported. - * Format: `projects/{project}/locations/{location}/functions/{function}` - * @type \Google\Cloud\Eventarc\V1\GKE $gke - * A GKE service capable of receiving events. The service should be running - * in the same project as the trigger. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Cloud Run fully-managed resource that receives the events. The resource - * should be in the same project as the trigger. - * - * Generated from protobuf field .google.cloud.eventarc.v1.CloudRun cloud_run = 1; - * @return \Google\Cloud\Eventarc\V1\CloudRun|null - */ - public function getCloudRun() - { - return $this->readOneof(1); - } - - public function hasCloudRun() - { - return $this->hasOneof(1); - } - - /** - * Cloud Run fully-managed resource that receives the events. The resource - * should be in the same project as the trigger. - * - * Generated from protobuf field .google.cloud.eventarc.v1.CloudRun cloud_run = 1; - * @param \Google\Cloud\Eventarc\V1\CloudRun $var - * @return $this - */ - public function setCloudRun($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\CloudRun::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The Cloud Function resource name. Only Cloud Functions V2 is supported. - * Format: `projects/{project}/locations/{location}/functions/{function}` - * - * Generated from protobuf field string cloud_function = 2 [(.google.api.resource_reference) = { - * @return string - */ - public function getCloudFunction() - { - return $this->readOneof(2); - } - - public function hasCloudFunction() - { - return $this->hasOneof(2); - } - - /** - * The Cloud Function resource name. Only Cloud Functions V2 is supported. - * Format: `projects/{project}/locations/{location}/functions/{function}` - * - * Generated from protobuf field string cloud_function = 2 [(.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setCloudFunction($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A GKE service capable of receiving events. The service should be running - * in the same project as the trigger. - * - * Generated from protobuf field .google.cloud.eventarc.v1.GKE gke = 3; - * @return \Google\Cloud\Eventarc\V1\GKE|null - */ - public function getGke() - { - return $this->readOneof(3); - } - - public function hasGke() - { - return $this->hasOneof(3); - } - - /** - * A GKE service capable of receiving events. The service should be running - * in the same project as the trigger. - * - * Generated from protobuf field .google.cloud.eventarc.v1.GKE gke = 3; - * @param \Google\Cloud\Eventarc\V1\GKE $var - * @return $this - */ - public function setGke($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\GKE::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getDescriptor() - { - return $this->whichOneof("descriptor"); - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php deleted file mode 100644 index f4f75630fc18..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventFilter.php +++ /dev/null @@ -1,155 +0,0 @@ -google.cloud.eventarc.v1.EventFilter - */ -class EventFilter extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes - * are supported for filtering. - * All triggers MUST provide a filter for the 'type' attribute. - * - * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $attribute = ''; - /** - * Required. The value for the attribute. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $value = ''; - /** - * Optional. The operator used for matching the events with the value of the - * filter. If not specified, only events that have an exact key-value pair - * specified in the filter are matched. The only allowed value is - * `match-path-pattern`. - * - * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $operator = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $attribute - * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes - * are supported for filtering. - * All triggers MUST provide a filter for the 'type' attribute. - * @type string $value - * Required. The value for the attribute. - * @type string $operator - * Optional. The operator used for matching the events with the value of the - * filter. If not specified, only events that have an exact key-value pair - * specified in the filter are matched. The only allowed value is - * `match-path-pattern`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes - * are supported for filtering. - * All triggers MUST provide a filter for the 'type' attribute. - * - * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getAttribute() - { - return $this->attribute; - } - - /** - * Required. The name of a CloudEvents attribute. Currently, only a subset of attributes - * are supported for filtering. - * All triggers MUST provide a filter for the 'type' attribute. - * - * Generated from protobuf field string attribute = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setAttribute($var) - { - GPBUtil::checkString($var, True); - $this->attribute = $var; - - return $this; - } - - /** - * Required. The value for the attribute. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Required. The value for the attribute. - * - * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkString($var, True); - $this->value = $var; - - return $this; - } - - /** - * Optional. The operator used for matching the events with the value of the - * filter. If not specified, only events that have an exact key-value pair - * specified in the filter are matched. The only allowed value is - * `match-path-pattern`. - * - * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Optional. The operator used for matching the events with the value of the - * filter. If not specified, only events that have an exact key-value pair - * specified in the filter are matched. The only allowed value is - * `match-path-pattern`. - * - * Generated from protobuf field string operator = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setOperator($var) - { - GPBUtil::checkString($var, True); - $this->operator = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php deleted file mode 100644 index 30ad258bb94a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/EventarcGrpcClient.php +++ /dev/null @@ -1,246 +0,0 @@ -_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetTrigger', - $argument, - ['\Google\Cloud\Eventarc\V1\Trigger', 'decode'], - $metadata, $options); - } - - /** - * List triggers. - * @param \Google\Cloud\Eventarc\V1\ListTriggersRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListTriggers(\Google\Cloud\Eventarc\V1\ListTriggersRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListTriggers', - $argument, - ['\Google\Cloud\Eventarc\V1\ListTriggersResponse', 'decode'], - $metadata, $options); - } - - /** - * Create a new trigger in a particular project and location. - * @param \Google\Cloud\Eventarc\V1\CreateTriggerRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateTrigger(\Google\Cloud\Eventarc\V1\CreateTriggerRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateTrigger', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update a single trigger. - * @param \Google\Cloud\Eventarc\V1\UpdateTriggerRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateTrigger(\Google\Cloud\Eventarc\V1\UpdateTriggerRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/UpdateTrigger', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete a single trigger. - * @param \Google\Cloud\Eventarc\V1\DeleteTriggerRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteTrigger(\Google\Cloud\Eventarc\V1\DeleteTriggerRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteTrigger', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Get a single Channel. - * @param \Google\Cloud\Eventarc\V1\GetChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetChannel(\Google\Cloud\Eventarc\V1\GetChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetChannel', - $argument, - ['\Google\Cloud\Eventarc\V1\Channel', 'decode'], - $metadata, $options); - } - - /** - * List channels. - * @param \Google\Cloud\Eventarc\V1\ListChannelsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListChannels(\Google\Cloud\Eventarc\V1\ListChannelsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListChannels', - $argument, - ['\Google\Cloud\Eventarc\V1\ListChannelsResponse', 'decode'], - $metadata, $options); - } - - /** - * Create a new channel in a particular project and location. - * @param \Google\Cloud\Eventarc\V1\CreateChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateChannel(\Google\Cloud\Eventarc\V1\CreateChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateChannel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Update a single channel. - * @param \Google\Cloud\Eventarc\V1\UpdateChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateChannel(\Google\Cloud\Eventarc\V1\UpdateChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/UpdateChannel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete a single channel. - * @param \Google\Cloud\Eventarc\V1\DeleteChannelRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteChannel(\Google\Cloud\Eventarc\V1\DeleteChannelRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteChannel', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Get a single ChannelConnection. - * @param \Google\Cloud\Eventarc\V1\GetChannelConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetChannelConnection(\Google\Cloud\Eventarc\V1\GetChannelConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/GetChannelConnection', - $argument, - ['\Google\Cloud\Eventarc\V1\ChannelConnection', 'decode'], - $metadata, $options); - } - - /** - * List channel connections. - * @param \Google\Cloud\Eventarc\V1\ListChannelConnectionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListChannelConnections(\Google\Cloud\Eventarc\V1\ListChannelConnectionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/ListChannelConnections', - $argument, - ['\Google\Cloud\Eventarc\V1\ListChannelConnectionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Create a new ChannelConnection in a particular project and location. - * @param \Google\Cloud\Eventarc\V1\CreateChannelConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function CreateChannelConnection(\Google\Cloud\Eventarc\V1\CreateChannelConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/CreateChannelConnection', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - - /** - * Delete a single ChannelConnection. - * @param \Google\Cloud\Eventarc\V1\DeleteChannelConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteChannelConnection(\Google\Cloud\Eventarc\V1\DeleteChannelConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection', - $argument, - ['\Google\LongRunning\Operation', 'decode'], - $metadata, $options); - } - -} diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php deleted file mode 100644 index 205d41d90ddc..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GKE.php +++ /dev/null @@ -1,223 +0,0 @@ -google.cloud.eventarc.v1.GKE - */ -class GKE extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the cluster the GKE service is running in. The cluster must be - * running in the same project as the trigger being created. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $cluster = ''; - /** - * Required. The name of the Google Compute Engine in which the cluster resides, which - * can either be compute zone (for example, us-central1-a) for the zonal - * clusters or region (for example, us-central1) for regional clusters. - * - * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $location = ''; - /** - * Required. The namespace the GKE service is running in. - * - * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $namespace = ''; - /** - * Required. Name of the GKE service. - * - * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $service = ''; - /** - * Optional. The relative path on the GKE service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $path = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $cluster - * Required. The name of the cluster the GKE service is running in. The cluster must be - * running in the same project as the trigger being created. - * @type string $location - * Required. The name of the Google Compute Engine in which the cluster resides, which - * can either be compute zone (for example, us-central1-a) for the zonal - * clusters or region (for example, us-central1) for regional clusters. - * @type string $namespace - * Required. The namespace the GKE service is running in. - * @type string $service - * Required. Name of the GKE service. - * @type string $path - * Optional. The relative path on the GKE service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the cluster the GKE service is running in. The cluster must be - * running in the same project as the trigger being created. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getCluster() - { - return $this->cluster; - } - - /** - * Required. The name of the cluster the GKE service is running in. The cluster must be - * running in the same project as the trigger being created. - * - * Generated from protobuf field string cluster = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setCluster($var) - { - GPBUtil::checkString($var, True); - $this->cluster = $var; - - return $this; - } - - /** - * Required. The name of the Google Compute Engine in which the cluster resides, which - * can either be compute zone (for example, us-central1-a) for the zonal - * clusters or region (for example, us-central1) for regional clusters. - * - * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getLocation() - { - return $this->location; - } - - /** - * Required. The name of the Google Compute Engine in which the cluster resides, which - * can either be compute zone (for example, us-central1-a) for the zonal - * clusters or region (for example, us-central1) for regional clusters. - * - * Generated from protobuf field string location = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setLocation($var) - { - GPBUtil::checkString($var, True); - $this->location = $var; - - return $this; - } - - /** - * Required. The namespace the GKE service is running in. - * - * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * Required. The namespace the GKE service is running in. - * - * Generated from protobuf field string namespace = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setNamespace($var) - { - GPBUtil::checkString($var, True); - $this->namespace = $var; - - return $this; - } - - /** - * Required. Name of the GKE service. - * - * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getService() - { - return $this->service; - } - - /** - * Required. Name of the GKE service. - * - * Generated from protobuf field string service = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setService($var) - { - GPBUtil::checkString($var, True); - $this->service = $var; - - return $this; - } - - /** - * Optional. The relative path on the GKE service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * Optional. The relative path on the GKE service the events should be sent to. - * The value must conform to the definition of a URI path segment (section 3.3 - * of RFC2396). Examples: "/route", "route", "route/subroute". - * - * Generated from protobuf field string path = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setPath($var) - { - GPBUtil::checkString($var, True); - $this->path = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php deleted file mode 100644 index 9f7938c96631..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelConnectionRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.eventarc.v1.GetChannelConnectionRequest - */ -class GetChannelConnectionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the channel connection to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the channel connection to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the channel connection to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the channel connection to get. - * - * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php deleted file mode 100644 index ebde4f2d3857..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetChannelRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.eventarc.v1.GetChannelRequest - */ -class GetChannelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the channel to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the channel to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the channel to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the channel to get. - * - * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php deleted file mode 100644 index 1a6f9e0fe07a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/GetTriggerRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -google.cloud.eventarc.v1.GetTriggerRequest - */ -class GetTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The name of the trigger to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The name of the trigger to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The name of the trigger to get. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The name of the trigger to get. - * - * 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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php deleted file mode 100644 index f84598beb531..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -google.cloud.eventarc.v1.ListChannelConnectionsRequest - */ -class ListChannelConnectionsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection from which to list channel connections. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of channel connections to return on each page. - * Note: The service may send fewer responses. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannelConnections` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannelConnetions` - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection from which to list channel connections. - * @type int $page_size - * The maximum number of channel connections to return on each page. - * Note: The service may send fewer responses. - * @type string $page_token - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannelConnections` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannelConnetions` - * match the call that provided the page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection from which to list channel connections. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection from which to list channel connections. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of channel connections to return on each page. - * Note: The service may send fewer responses. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of channel connections to return on each page. - * Note: The service may send fewer responses. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannelConnections` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannelConnetions` - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannelConnections` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannelConnetions` - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php deleted file mode 100644 index c80fb79b700a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelConnectionsResponse.php +++ /dev/null @@ -1,147 +0,0 @@ -google.cloud.eventarc.v1.ListChannelConnectionsResponse - */ -class ListChannelConnectionsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The requested channel connections, up to the number specified in - * `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; - */ - private $channel_connections; - /** - * A page token that can be sent to ListChannelConnections to request the - * next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\ChannelConnection[]|\Google\Protobuf\Internal\RepeatedField $channel_connections - * The requested channel connections, up to the number specified in - * `page_size`. - * @type string $next_page_token - * A page token that can be sent to ListChannelConnections to request the - * next page. - * If this is empty, then there are no more pages. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable - * Unreachable resources, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * The requested channel connections, up to the number specified in - * `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChannelConnections() - { - return $this->channel_connections; - } - - /** - * The requested channel connections, up to the number specified in - * `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.ChannelConnection channel_connections = 1; - * @param \Google\Cloud\Eventarc\V1\ChannelConnection[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChannelConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\ChannelConnection::class); - $this->channel_connections = $arr; - - return $this; - } - - /** - * A page token that can be sent to ListChannelConnections to request the - * next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that can be sent to ListChannelConnections to request the - * next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php deleted file mode 100644 index c57add9d02f4..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.eventarc.v1.ListChannelsRequest - */ -class ListChannelsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection to list channels on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of channels to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannels` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannels` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, channel_id`. - * - * Generated from protobuf field string order_by = 4; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection to list channels on. - * @type int $page_size - * The maximum number of channels to return on each page. - * Note: The service may send fewer. - * @type string $page_token - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannels` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannels` must - * match the call that provided the page token. - * @type string $order_by - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, channel_id`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection to list channels on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection to list channels on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of channels to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of channels to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannels` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannels` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListChannels` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListChannels` must - * match the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, channel_id`. - * - * Generated from protobuf field string order_by = 4; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, channel_id`. - * - * Generated from protobuf field string order_by = 4; - * @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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php deleted file mode 100644 index d76a26d0603a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListChannelsResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.eventarc.v1.ListChannelsResponse - */ -class ListChannelsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The requested channels, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; - */ - private $channels; - /** - * A page token that can be sent to ListChannels to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\Channel[]|\Google\Protobuf\Internal\RepeatedField $channels - * The requested channels, up to the number specified in `page_size`. - * @type string $next_page_token - * A page token that can be sent to ListChannels to request the next page. - * If this is empty, then there are no more pages. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable - * Unreachable resources, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * The requested channels, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getChannels() - { - return $this->channels; - } - - /** - * The requested channels, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Channel channels = 1; - * @param \Google\Cloud\Eventarc\V1\Channel[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setChannels($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\Channel::class); - $this->channels = $arr; - - return $this; - } - - /** - * A page token that can be sent to ListChannels to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that can be sent to ListChannels to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php deleted file mode 100644 index 474f35d8569a..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersRequest.php +++ /dev/null @@ -1,197 +0,0 @@ -google.cloud.eventarc.v1.ListTriggersRequest - */ -class ListTriggersRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The parent collection to list triggers on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - */ - protected $parent = ''; - /** - * The maximum number of triggers to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - */ - protected $page_size = 0; - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListTriggers` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListTriggers` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - */ - protected $page_token = ''; - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, trigger_id`. - * - * Generated from protobuf field string order_by = 4; - */ - protected $order_by = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $parent - * Required. The parent collection to list triggers on. - * @type int $page_size - * The maximum number of triggers to return on each page. - * Note: The service may send fewer. - * @type string $page_token - * The page token; provide the value from the `next_page_token` field in a - * previous `ListTriggers` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListTriggers` must match - * the call that provided the page token. - * @type string $order_by - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, trigger_id`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Required. The parent collection to list triggers on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @return string - */ - public function getParent() - { - return $this->parent; - } - - /** - * Required. The parent collection to list triggers on. - * - * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setParent($var) - { - GPBUtil::checkString($var, True); - $this->parent = $var; - - return $this; - } - - /** - * The maximum number of triggers to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of triggers to return on each page. - * Note: The service may send fewer. - * - * Generated from protobuf field int32 page_size = 2; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListTriggers` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListTriggers` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The page token; provide the value from the `next_page_token` field in a - * previous `ListTriggers` call to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListTriggers` must match - * the call that provided the page token. - * - * Generated from protobuf field string page_token = 3; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, trigger_id`. - * - * Generated from protobuf field string order_by = 4; - * @return string - */ - public function getOrderBy() - { - return $this->order_by; - } - - /** - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, trigger_id`. - * - * Generated from protobuf field string order_by = 4; - * @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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php deleted file mode 100644 index d755f69484a1..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/ListTriggersResponse.php +++ /dev/null @@ -1,139 +0,0 @@ -google.cloud.eventarc.v1.ListTriggersResponse - */ -class ListTriggersResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The requested triggers, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; - */ - private $triggers; - /** - * A page token that can be sent to ListTriggers to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - */ - private $unreachable; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\Trigger[]|\Google\Protobuf\Internal\RepeatedField $triggers - * The requested triggers, up to the number specified in `page_size`. - * @type string $next_page_token - * A page token that can be sent to ListTriggers to request the next page. - * If this is empty, then there are no more pages. - * @type string[]|\Google\Protobuf\Internal\RepeatedField $unreachable - * Unreachable resources, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * The requested triggers, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTriggers() - { - return $this->triggers; - } - - /** - * The requested triggers, up to the number specified in `page_size`. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.Trigger triggers = 1; - * @param \Google\Cloud\Eventarc\V1\Trigger[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTriggers($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\Trigger::class); - $this->triggers = $arr; - - return $this; - } - - /** - * A page token that can be sent to ListTriggers to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * A page token that can be sent to ListTriggers to request the next page. - * If this is empty, then there are no more pages. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getUnreachable() - { - return $this->unreachable; - } - - /** - * Unreachable resources, if any. - * - * Generated from protobuf field repeated string unreachable = 3; - * @param string[]|\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/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php deleted file mode 100644 index 5e68aca2f8c3..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/OperationMetadata.php +++ /dev/null @@ -1,303 +0,0 @@ -google.cloud.eventarc.v1.OperationMetadata - */ -class OperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $end_time = null; - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $target = ''; - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $verb = ''; - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $status_message = ''; - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $requested_cancellation = false; - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $api_version = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The time the operation was created. - * @type \Google\Protobuf\Timestamp $end_time - * Output only. The time the operation finished running. - * @type string $target - * Output only. Server-defined resource path for the target of the operation. - * @type string $verb - * Output only. Name of the verb executed by the operation. - * @type string $status_message - * Output only. Human-readable status of the operation, if any. - * @type bool $requested_cancellation - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. - * @type string $api_version - * Output only. API version used to start the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The time the operation was created. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * Output only. The time the operation finished running. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getTarget() - { - return $this->target; - } - - /** - * Output only. Server-defined resource path for the target of the operation. - * - * Generated from protobuf field string target = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setTarget($var) - { - GPBUtil::checkString($var, True); - $this->target = $var; - - return $this; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getVerb() - { - return $this->verb; - } - - /** - * Output only. Name of the verb executed by the operation. - * - * Generated from protobuf field string verb = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setVerb($var) - { - GPBUtil::checkString($var, True); - $this->verb = $var; - - return $this; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getStatusMessage() - { - return $this->status_message; - } - - /** - * Output only. Human-readable status of the operation, if any. - * - * Generated from protobuf field string status_message = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setStatusMessage($var) - { - GPBUtil::checkString($var, True); - $this->status_message = $var; - - return $this; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return bool - */ - public function getRequestedCancellation() - { - return $this->requested_cancellation; - } - - /** - * Output only. Identifies whether the user has requested cancellation - * of the operation. Operations that have successfully been cancelled - * have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - * corresponding to `Code.CANCELLED`. - * - * Generated from protobuf field bool requested_cancellation = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param bool $var - * @return $this - */ - public function setRequestedCancellation($var) - { - GPBUtil::checkBool($var); - $this->requested_cancellation = $var; - - return $this; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getApiVersion() - { - return $this->api_version; - } - - /** - * Output only. API version used to start the operation. - * - * Generated from protobuf field string api_version = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setApiVersion($var) - { - GPBUtil::checkString($var, True); - $this->api_version = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php deleted file mode 100644 index 438692870f62..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Pubsub.php +++ /dev/null @@ -1,129 +0,0 @@ -google.cloud.eventarc.v1.Pubsub - */ -class Pubsub extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the Pub/Sub topic created and managed by Eventarc as - * a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. - * You can set an existing topic for triggers of the type - * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide - * here is not deleted by Eventarc at trigger deletion. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $topic = ''; - /** - * Output only. The name of the Pub/Sub subscription created and managed by Eventarc - * as a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $subscription = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $topic - * Optional. The name of the Pub/Sub topic created and managed by Eventarc as - * a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. - * You can set an existing topic for triggers of the type - * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide - * here is not deleted by Eventarc at trigger deletion. - * @type string $subscription - * Output only. The name of the Pub/Sub subscription created and managed by Eventarc - * as a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the Pub/Sub topic created and managed by Eventarc as - * a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. - * You can set an existing topic for triggers of the type - * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide - * here is not deleted by Eventarc at trigger deletion. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getTopic() - { - return $this->topic; - } - - /** - * Optional. The name of the Pub/Sub topic created and managed by Eventarc as - * a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/topics/{TOPIC_NAME}`. - * You can set an existing topic for triggers of the type - * `google.cloud.pubsub.topic.v1.messagePublished`. The topic you provide - * here is not deleted by Eventarc at trigger deletion. - * - * Generated from protobuf field string topic = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setTopic($var) - { - GPBUtil::checkString($var, True); - $this->topic = $var; - - return $this; - } - - /** - * Output only. The name of the Pub/Sub subscription created and managed by Eventarc - * as a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * Output only. The name of the Pub/Sub subscription created and managed by Eventarc - * as a transport for the event delivery. Format: - * `projects/{PROJECT_ID}/subscriptions/{SUBSCRIPTION_NAME}`. - * - * Generated from protobuf field string subscription = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setSubscription($var) - { - GPBUtil::checkString($var, True); - $this->subscription = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php deleted file mode 100644 index 0d7bd861e1e0..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Transport.php +++ /dev/null @@ -1,79 +0,0 @@ -google.cloud.eventarc.v1.Transport - */ -class Transport extends \Google\Protobuf\Internal\Message -{ - protected $intermediary; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\Pubsub $pubsub - * The Pub/Sub topic and subscription used by Eventarc as a transport - * intermediary. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * The Pub/Sub topic and subscription used by Eventarc as a transport - * intermediary. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Pubsub pubsub = 1; - * @return \Google\Cloud\Eventarc\V1\Pubsub|null - */ - public function getPubsub() - { - return $this->readOneof(1); - } - - public function hasPubsub() - { - return $this->hasOneof(1); - } - - /** - * The Pub/Sub topic and subscription used by Eventarc as a transport - * intermediary. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Pubsub pubsub = 1; - * @param \Google\Cloud\Eventarc\V1\Pubsub $var - * @return $this - */ - public function setPubsub($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Pubsub::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * @return string - */ - public function getIntermediary() - { - return $this->whichOneof("intermediary"); - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php deleted file mode 100644 index a1f62f0195c5..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/Trigger.php +++ /dev/null @@ -1,535 +0,0 @@ -google.cloud.eventarc.v1.Trigger - */ -class Trigger extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The resource name of the trigger. Must be unique within the location of the - * project and must be in - * `projects/{project}/locations/{location}/triggers/{trigger}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $uid = ''; - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $create_time = null; - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $update_time = null; - /** - * Required. null The list of filters that applies to event attributes. Only events that - * match all the provided filters are sent to the destination. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; - */ - private $event_filters; - /** - * Optional. The IAM service account email associated with the trigger. The - * service account represents the identity of the trigger. - * The principal who calls this API must have the `iam.serviceAccounts.actAs` - * permission in the service account. See - * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common - * for more information. - * For Cloud Run destinations, this service account is used to generate - * identity tokens when invoking the service. See - * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account - * for information on how to invoke authenticated Cloud Run services. - * To create Audit Log triggers, the service account should also - * have the `roles/eventarc.eventReceiver` IAM role. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - */ - protected $service_account = ''; - /** - * Required. Destination specifies where the events should be sent to. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $destination = null; - /** - * Optional. To deliver messages, Eventarc might use other GCP - * products as a transport intermediary. This field contains a reference to - * that transport intermediary. This information can be used for debugging - * purposes. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $transport = null; - /** - * Optional. User labels attached to the triggers that can be used to group resources. - * - * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $labels; - /** - * Optional. The name of the channel associated with the trigger in - * `projects/{project}/locations/{location}/channels/{channel}` format. - * You must provide a channel to receive events from Eventarc SaaS partners. - * - * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $channel = ''; - /** - * Output only. This checksum is computed by the server based on the value of other - * fields, and might be sent only on create requests to ensure that the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $etag = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The resource name of the trigger. Must be unique within the location of the - * project and must be in - * `projects/{project}/locations/{location}/triggers/{trigger}` format. - * @type string $uid - * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * @type \Google\Protobuf\Timestamp $create_time - * Output only. The creation time. - * @type \Google\Protobuf\Timestamp $update_time - * Output only. The last-modified time. - * @type \Google\Cloud\Eventarc\V1\EventFilter[]|\Google\Protobuf\Internal\RepeatedField $event_filters - * Required. null The list of filters that applies to event attributes. Only events that - * match all the provided filters are sent to the destination. - * @type string $service_account - * Optional. The IAM service account email associated with the trigger. The - * service account represents the identity of the trigger. - * The principal who calls this API must have the `iam.serviceAccounts.actAs` - * permission in the service account. See - * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common - * for more information. - * For Cloud Run destinations, this service account is used to generate - * identity tokens when invoking the service. See - * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account - * for information on how to invoke authenticated Cloud Run services. - * To create Audit Log triggers, the service account should also - * have the `roles/eventarc.eventReceiver` IAM role. - * @type \Google\Cloud\Eventarc\V1\Destination $destination - * Required. Destination specifies where the events should be sent to. - * @type \Google\Cloud\Eventarc\V1\Transport $transport - * Optional. To deliver messages, Eventarc might use other GCP - * products as a transport intermediary. This field contains a reference to - * that transport intermediary. This information can be used for debugging - * purposes. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Optional. User labels attached to the triggers that can be used to group resources. - * @type string $channel - * Optional. The name of the channel associated with the trigger in - * `projects/{project}/locations/{location}/channels/{channel}` format. - * You must provide a channel to receive events from Eventarc SaaS partners. - * @type string $etag - * Output only. This checksum is computed by the server based on the value of other - * fields, and might be sent only on create requests to ensure that the - * client has an up-to-date value before proceeding. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Trigger::initOnce(); - parent::__construct($data); - } - - /** - * Required. The resource name of the trigger. Must be unique within the location of the - * project and must be in - * `projects/{project}/locations/{location}/triggers/{trigger}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The resource name of the trigger. Must be unique within the location of the - * project and must be in - * `projects/{project}/locations/{location}/triggers/{trigger}` format. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * Output only. Server-assigned unique identifier for the trigger. The value is a UUID4 - * string and guaranteed to remain unchanged until the resource is deleted. - * - * Generated from protobuf field string uid = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setUid($var) - { - GPBUtil::checkString($var, True); - $this->uid = $var; - - return $this; - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * Output only. The creation time. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * Output only. The last-modified time. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Required. null The list of filters that applies to event attributes. Only events that - * match all the provided filters are sent to the destination. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEventFilters() - { - return $this->event_filters; - } - - /** - * Required. null The list of filters that applies to event attributes. Only events that - * match all the provided filters are sent to the destination. - * - * Generated from protobuf field repeated .google.cloud.eventarc.v1.EventFilter event_filters = 8 [(.google.api.field_behavior) = UNORDERED_LIST, (.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Eventarc\V1\EventFilter[]|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEventFilters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Eventarc\V1\EventFilter::class); - $this->event_filters = $arr; - - return $this; - } - - /** - * Optional. The IAM service account email associated with the trigger. The - * service account represents the identity of the trigger. - * The principal who calls this API must have the `iam.serviceAccounts.actAs` - * permission in the service account. See - * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common - * for more information. - * For Cloud Run destinations, this service account is used to generate - * identity tokens when invoking the service. See - * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account - * for information on how to invoke authenticated Cloud Run services. - * To create Audit Log triggers, the service account should also - * have the `roles/eventarc.eventReceiver` IAM role. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @return string - */ - public function getServiceAccount() - { - return $this->service_account; - } - - /** - * Optional. The IAM service account email associated with the trigger. The - * service account represents the identity of the trigger. - * The principal who calls this API must have the `iam.serviceAccounts.actAs` - * permission in the service account. See - * https://cloud.google.com/iam/docs/understanding-service-accounts?hl=en#sa_common - * for more information. - * For Cloud Run destinations, this service account is used to generate - * identity tokens when invoking the service. See - * https://cloud.google.com/run/docs/triggering/pubsub-push#create-service-account - * for information on how to invoke authenticated Cloud Run services. - * To create Audit Log triggers, the service account should also - * have the `roles/eventarc.eventReceiver` IAM role. - * - * Generated from protobuf field string service_account = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { - * @param string $var - * @return $this - */ - public function setServiceAccount($var) - { - GPBUtil::checkString($var, True); - $this->service_account = $var; - - return $this; - } - - /** - * Required. Destination specifies where the events should be sent to. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Cloud\Eventarc\V1\Destination|null - */ - public function getDestination() - { - return $this->destination; - } - - public function hasDestination() - { - return isset($this->destination); - } - - public function clearDestination() - { - unset($this->destination); - } - - /** - * Required. Destination specifies where the events should be sent to. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Destination destination = 10 [(.google.api.field_behavior) = REQUIRED]; - * @param \Google\Cloud\Eventarc\V1\Destination $var - * @return $this - */ - public function setDestination($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Destination::class); - $this->destination = $var; - - return $this; - } - - /** - * Optional. To deliver messages, Eventarc might use other GCP - * products as a transport intermediary. This field contains a reference to - * that transport intermediary. This information can be used for debugging - * purposes. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Eventarc\V1\Transport|null - */ - public function getTransport() - { - return $this->transport; - } - - public function hasTransport() - { - return isset($this->transport); - } - - public function clearTransport() - { - unset($this->transport); - } - - /** - * Optional. To deliver messages, Eventarc might use other GCP - * products as a transport intermediary. This field contains a reference to - * that transport intermediary. This information can be used for debugging - * purposes. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Transport transport = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Eventarc\V1\Transport $var - * @return $this - */ - public function setTransport($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Transport::class); - $this->transport = $var; - - return $this; - } - - /** - * Optional. User labels attached to the triggers that can be used to group resources. - * - * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Optional. User labels attached to the triggers that can be used to group resources. - * - * Generated from protobuf field map labels = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Optional. The name of the channel associated with the trigger in - * `projects/{project}/locations/{location}/channels/{channel}` format. - * You must provide a channel to receive events from Eventarc SaaS partners. - * - * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getChannel() - { - return $this->channel; - } - - /** - * Optional. The name of the channel associated with the trigger in - * `projects/{project}/locations/{location}/channels/{channel}` format. - * You must provide a channel to receive events from Eventarc SaaS partners. - * - * Generated from protobuf field string channel = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setChannel($var) - { - GPBUtil::checkString($var, True); - $this->channel = $var; - - return $this; - } - - /** - * Output only. This checksum is computed by the server based on the value of other - * fields, and might be sent only on create requests to ensure that the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getEtag() - { - return $this->etag; - } - - /** - * Output only. This checksum is computed by the server based on the value of other - * fields, and might be sent only on create requests to ensure that the - * client has an up-to-date value before proceeding. - * - * Generated from protobuf field string etag = 99 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setEtag($var) - { - GPBUtil::checkString($var, True); - $this->etag = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php deleted file mode 100644 index 8db95563a9b1..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateChannelRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.cloud.eventarc.v1.UpdateChannelRequest - */ -class UpdateChannelRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The channel to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; - */ - protected $channel = null; - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\Channel $channel - * The channel to be updated. - * @type \Google\Protobuf\FieldMask $update_mask - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * The channel to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; - * @return \Google\Cloud\Eventarc\V1\Channel|null - */ - public function getChannel() - { - return $this->channel; - } - - public function hasChannel() - { - return isset($this->channel); - } - - public function clearChannel() - { - unset($this->channel); - } - - /** - * The channel to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Channel channel = 1; - * @param \Google\Cloud\Eventarc\V1\Channel $var - * @return $this - */ - public function setChannel($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Channel::class); - $this->channel = $var; - - return $this; - } - - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php b/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php deleted file mode 100644 index a0b83659f1c1..000000000000 --- a/owl-bot-staging/Eventarc/v1/proto/src/Google/Cloud/Eventarc/V1/UpdateTriggerRequest.php +++ /dev/null @@ -1,205 +0,0 @@ -google.cloud.eventarc.v1.UpdateTriggerRequest - */ -class UpdateTriggerRequest extends \Google\Protobuf\Internal\Message -{ - /** - * The trigger to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; - */ - protected $trigger = null; - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - */ - protected $update_mask = null; - /** - * If set to true, and the trigger is not found, a new trigger will be - * created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - */ - protected $allow_missing = false; - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $validate_only = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Eventarc\V1\Trigger $trigger - * The trigger to be updated. - * @type \Google\Protobuf\FieldMask $update_mask - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * @type bool $allow_missing - * If set to true, and the trigger is not found, a new trigger will be - * created. In this situation, `update_mask` is ignored. - * @type bool $validate_only - * Required. If set, validate the request and preview the review, but do not - * post it. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Eventarc\V1\Eventarc::initOnce(); - parent::__construct($data); - } - - /** - * The trigger to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; - * @return \Google\Cloud\Eventarc\V1\Trigger|null - */ - public function getTrigger() - { - return $this->trigger; - } - - public function hasTrigger() - { - return isset($this->trigger); - } - - public function clearTrigger() - { - unset($this->trigger); - } - - /** - * The trigger to be updated. - * - * Generated from protobuf field .google.cloud.eventarc.v1.Trigger trigger = 1; - * @param \Google\Cloud\Eventarc\V1\Trigger $var - * @return $this - */ - public function setTrigger($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Eventarc\V1\Trigger::class); - $this->trigger = $var; - - return $this; - } - - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @return \Google\Protobuf\FieldMask|null - */ - public function getUpdateMask() - { - return $this->update_mask; - } - - public function hasUpdateMask() - { - return isset($this->update_mask); - } - - public function clearUpdateMask() - { - unset($this->update_mask); - } - - /** - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * - * Generated from protobuf field .google.protobuf.FieldMask update_mask = 2; - * @param \Google\Protobuf\FieldMask $var - * @return $this - */ - public function setUpdateMask($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); - $this->update_mask = $var; - - return $this; - } - - /** - * If set to true, and the trigger is not found, a new trigger will be - * created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - * @return bool - */ - public function getAllowMissing() - { - return $this->allow_missing; - } - - /** - * If set to true, and the trigger is not found, a new trigger will be - * created. In this situation, `update_mask` is ignored. - * - * Generated from protobuf field bool allow_missing = 3; - * @param bool $var - * @return $this - */ - public function setAllowMissing($var) - { - GPBUtil::checkBool($var); - $this->allow_missing = $var; - - return $this; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return bool - */ - public function getValidateOnly() - { - return $this->validate_only; - } - - /** - * Required. If set, validate the request and preview the review, but do not - * post it. - * - * Generated from protobuf field bool validate_only = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param bool $var - * @return $this - */ - public function setValidateOnly($var) - { - GPBUtil::checkBool($var); - $this->validate_only = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php b/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php deleted file mode 100644 index a0546816b6fa..000000000000 --- a/owl-bot-staging/Eventarc/v1/src/V1/EventarcClient.php +++ /dev/null @@ -1,34 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $channel = new Channel(); - * $channelId = 'channel_id'; - * $validateOnly = false; - * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * Many parameters require resource names to be formatted in a particular way. To - * assist with these names, this class includes a format method for each type of - * name, and additionally a parseName method to extract the individual identifiers - * contained within formatted names that are returned by the API. - */ -class EventarcGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.eventarc.v1.Eventarc'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'eventarc.googleapis.com'; - - /** - * The default port of the service. - */ - const DEFAULT_SERVICE_PORT = 443; - - /** - * The name of the code generator, to be included in the agent header. - */ - const CODEGEN_NAME = 'gapic'; - - /** - * The default scopes required by the service. - */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; - - private static $channelNameTemplate; - - private static $channelConnectionNameTemplate; - - private static $locationNameTemplate; - - private static $serviceAccountNameTemplate; - - private static $triggerNameTemplate; - - private static $pathTemplateMap; - - private $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/eventarc_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/eventarc_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/eventarc_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/eventarc_rest_client_config.php', - ], - ], - ]; - } - - private static function getChannelNameTemplate() - { - if (self::$channelNameTemplate == null) { - self::$channelNameTemplate = new PathTemplate('projects/{project}/locations/{location}/channels/{channel}'); - } - - return self::$channelNameTemplate; - } - - private static function getChannelConnectionNameTemplate() - { - if (self::$channelConnectionNameTemplate == null) { - self::$channelConnectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/channelConnections/{channel_connection}'); - } - - return self::$channelConnectionNameTemplate; - } - - private static function getLocationNameTemplate() - { - if (self::$locationNameTemplate == null) { - self::$locationNameTemplate = new PathTemplate('projects/{project}/locations/{location}'); - } - - return self::$locationNameTemplate; - } - - private static function getServiceAccountNameTemplate() - { - if (self::$serviceAccountNameTemplate == null) { - self::$serviceAccountNameTemplate = new PathTemplate('projects/{project}/serviceAccounts/{service_account}'); - } - - return self::$serviceAccountNameTemplate; - } - - private static function getTriggerNameTemplate() - { - if (self::$triggerNameTemplate == null) { - self::$triggerNameTemplate = new PathTemplate('projects/{project}/locations/{location}/triggers/{trigger}'); - } - - return self::$triggerNameTemplate; - } - - private static function getPathTemplateMap() - { - if (self::$pathTemplateMap == null) { - self::$pathTemplateMap = [ - 'channel' => self::getChannelNameTemplate(), - 'channelConnection' => self::getChannelConnectionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - 'serviceAccount' => self::getServiceAccountNameTemplate(), - 'trigger' => self::getTriggerNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * Formats a string containing the fully-qualified path to represent a channel - * resource. - * - * @param string $project - * @param string $location - * @param string $channel - * - * @return string The formatted channel resource. - */ - public static function channelName($project, $location, $channel) - { - return self::getChannelNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'channel' => $channel, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * channel_connection resource. - * - * @param string $project - * @param string $location - * @param string $channelConnection - * - * @return string The formatted channel_connection resource. - */ - public static function channelConnectionName($project, $location, $channelConnection) - { - return self::getChannelConnectionNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'channel_connection' => $channelConnection, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a location - * resource. - * - * @param string $project - * @param string $location - * - * @return string The formatted location resource. - */ - public static function locationName($project, $location) - { - return self::getLocationNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a - * service_account resource. - * - * @param string $project - * @param string $serviceAccount - * - * @return string The formatted service_account resource. - */ - public static function serviceAccountName($project, $serviceAccount) - { - return self::getServiceAccountNameTemplate()->render([ - 'project' => $project, - 'service_account' => $serviceAccount, - ]); - } - - /** - * Formats a string containing the fully-qualified path to represent a trigger - * resource. - * - * @param string $project - * @param string $location - * @param string $trigger - * - * @return string The formatted trigger resource. - */ - public static function triggerName($project, $location, $trigger) - { - return self::getTriggerNameTemplate()->render([ - 'project' => $project, - 'location' => $location, - 'trigger' => $trigger, - ]); - } - - /** - * Parses a formatted name string and returns an associative array of the components in the name. - * The following name formats are supported: - * Template: Pattern - * - channel: projects/{project}/locations/{location}/channels/{channel} - * - channelConnection: projects/{project}/locations/{location}/channelConnections/{channel_connection} - * - location: projects/{project}/locations/{location} - * - serviceAccount: projects/{project}/serviceAccounts/{service_account} - * - trigger: projects/{project}/locations/{location}/triggers/{trigger} - * - * The optional $template argument can be supplied to specify a particular pattern, - * and must match one of the templates listed above. If no $template argument is - * provided, or if the $template argument does not match one of the templates - * listed, then parseName will check each of the supported templates, and return - * the first match. - * - * @param string $formattedName The formatted name string - * @param string $template Optional name of template to match - * - * @return array An associative array from name component IDs to component values. - * - * @throws ValidationException If $formattedName could not be matched. - */ - public static function parseName($formattedName, $template = null) - { - $templateMap = self::getPathTemplateMap(); - if ($template) { - if (!isset($templateMap[$template])) { - throw new ValidationException("Template name $template does not exist"); - } - - return $templateMap[$template]->match($formattedName); - } - - foreach ($templateMap as $templateName => $pathTemplate) { - try { - return $pathTemplate->match($formattedName); - } catch (ValidationException $ex) { - // Swallow the exception to continue trying other path templates - } - } - - throw new ValidationException("Input did not match any known format. Input: $formattedName"); - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $serviceAddress - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'eventarc.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 - * $serviceAddress setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Create a new channel in a particular project and location. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * $channel = new Channel(); - * $channelId = 'channel_id'; - * $validateOnly = false; - * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->createChannel($formattedParent, $channel, $channelId, $validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which to add this channel. - * @param Channel $channel Required. The channel to create. - * @param string $channelId Required. The user-provided ID to be assigned to the channel. - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createChannel($parent, $channel, $channelId, $validateOnly, array $optionalArgs = []) - { - $request = new CreateChannelRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setChannel($channel); - $request->setChannelId($channelId); - $request->setValidateOnly($validateOnly); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Create a new ChannelConnection in a particular project and location. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * $channelConnection = new ChannelConnection(); - * $channelConnectionId = 'channel_connection_id'; - * $operationResponse = $eventarcClient->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createChannelConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which to add this channel connection. - * @param ChannelConnection $channelConnection Required. Channel connection to create. - * @param string $channelConnectionId Required. The user-provided ID to be assigned to the channel connection. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createChannelConnection($parent, $channelConnection, $channelConnectionId, array $optionalArgs = []) - { - $request = new CreateChannelConnectionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setChannelConnection($channelConnection); - $request->setChannelConnectionId($channelConnectionId); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateChannelConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Create a new trigger in a particular project and location. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * $trigger = new Trigger(); - * $triggerId = 'trigger_id'; - * $validateOnly = false; - * $operationResponse = $eventarcClient->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'createTrigger'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection in which to add this trigger. - * @param Trigger $trigger Required. The trigger to create. - * @param string $triggerId Required. The user-provided ID to be assigned to the trigger. - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createTrigger($parent, $trigger, $triggerId, $validateOnly, array $optionalArgs = []) - { - $request = new CreateTriggerRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setTrigger($trigger); - $request->setTriggerId($triggerId); - $request->setValidateOnly($validateOnly); - $requestParamHeaders['parent'] = $parent; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Delete a single channel. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - * $validateOnly = false; - * $operationResponse = $eventarcClient->deleteChannel($formattedName, $validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->deleteChannel($formattedName, $validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteChannel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the channel to be deleted. - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteChannel($name, $validateOnly, array $optionalArgs = []) - { - $request = new DeleteChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setValidateOnly($validateOnly); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Delete a single ChannelConnection. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - * $operationResponse = $eventarcClient->deleteChannelConnection($formattedName); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->deleteChannelConnection($formattedName); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteChannelConnection'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the channel connection to delete. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteChannelConnection($name, array $optionalArgs = []) - { - $request = new DeleteChannelConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteChannelConnection', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Delete a single trigger. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - * $validateOnly = false; - * $operationResponse = $eventarcClient->deleteTrigger($formattedName, $validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->deleteTrigger($formattedName, $validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'deleteTrigger'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the trigger to be deleted. - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type string $etag - * If provided, the trigger will only be deleted if the etag matches the - * current etag on the resource. - * @type bool $allowMissing - * If set to true, and the trigger is not found, the request will succeed - * but no action will be taken on the server. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteTrigger($name, $validateOnly, array $optionalArgs = []) - { - $request = new DeleteTriggerRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setValidateOnly($validateOnly); - $requestParamHeaders['name'] = $name; - if (isset($optionalArgs['etag'])) { - $request->setEtag($optionalArgs['etag']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Get a single Channel. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - * $response = $eventarcClient->getChannel($formattedName); - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the channel to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Eventarc\V1\Channel - * - * @throws ApiException if the remote call fails - */ - public function getChannel($name, array $optionalArgs = []) - { - $request = new GetChannelRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetChannel', Channel::class, $optionalArgs, $request)->wait(); - } - - /** - * Get a single ChannelConnection. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - * $response = $eventarcClient->getChannelConnection($formattedName); - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the channel connection to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Eventarc\V1\ChannelConnection - * - * @throws ApiException if the remote call fails - */ - public function getChannelConnection($name, array $optionalArgs = []) - { - $request = new GetChannelConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetChannelConnection', ChannelConnection::class, $optionalArgs, $request)->wait(); - } - - /** - * Get a single trigger. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedName = $eventarcClient->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - * $response = $eventarcClient->getTrigger($formattedName); - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $name Required. The name of the trigger to get. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Eventarc\V1\Trigger - * - * @throws ApiException if the remote call fails - */ - public function getTrigger($name, array $optionalArgs = []) - { - $request = new GetTriggerRequest(); - $requestParamHeaders = []; - $request->setName($name); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetTrigger', Trigger::class, $optionalArgs, $request)->wait(); - } - - /** - * List channel connections. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $eventarcClient->listChannelConnections($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $eventarcClient->listChannelConnections($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection from which to list channel connections. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listChannelConnections($parent, array $optionalArgs = []) - { - $request = new ListChannelConnectionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListChannelConnections', $optionalArgs, ListChannelConnectionsResponse::class, $request); - } - - /** - * List channels. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $eventarcClient->listChannels($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $eventarcClient->listChannels($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection to list channels on. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, channel_id`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listChannels($parent, array $optionalArgs = []) - { - $request = new ListChannelsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListChannels', $optionalArgs, ListChannelsResponse::class, $request); - } - - /** - * List triggers. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $formattedParent = $eventarcClient->locationName('[PROJECT]', '[LOCATION]'); - * // Iterate over pages of elements - * $pagedResponse = $eventarcClient->listTriggers($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $eventarcClient->listTriggers($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param string $parent Required. The parent collection to list triggers on. - * @param array $optionalArgs { - * Optional. - * - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @type string $orderBy - * The sorting order of the resources returned. Value should be a - * comma-separated list of fields. The default sorting order is ascending. To - * specify descending order for a field, append a `desc` suffix; for example: - * `name desc, trigger_id`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listTriggers($parent, array $optionalArgs = []) - { - $request = new ListTriggersRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - if (isset($optionalArgs['orderBy'])) { - $request->setOrderBy($optionalArgs['orderBy']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListTriggers', $optionalArgs, ListTriggersResponse::class, $request); - } - - /** - * Update a single channel. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $validateOnly = false; - * $operationResponse = $eventarcClient->updateChannel($validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->updateChannel($validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'updateChannel'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type Channel $channel - * The channel to be updated. - * @type FieldMask $updateMask - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateChannel($validateOnly, array $optionalArgs = []) - { - $request = new UpdateChannelRequest(); - $requestParamHeaders = []; - $request->setValidateOnly($validateOnly); - if (isset($optionalArgs['channel'])) { - $request->setChannel($optionalArgs['channel']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateChannel', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Update a single trigger. - * - * Sample code: - * ``` - * $eventarcClient = new EventarcClient(); - * try { - * $validateOnly = false; - * $operationResponse = $eventarcClient->updateTrigger($validateOnly); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $eventarcClient->updateTrigger($validateOnly); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $eventarcClient->resumeOperation($operationName, 'updateTrigger'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $eventarcClient->close(); - * } - * ``` - * - * @param bool $validateOnly Required. If set, validate the request and preview the review, but do not - * post it. - * @param array $optionalArgs { - * Optional. - * - * @type Trigger $trigger - * The trigger to be updated. - * @type FieldMask $updateMask - * The fields to be updated; only fields explicitly provided are updated. - * If no field mask is provided, all provided fields in the request are - * updated. To update all fields, provide a field mask of "*". - * @type bool $allowMissing - * If set to true, and the trigger is not found, a new trigger will be - * created. In this situation, `update_mask` is ignored. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function updateTrigger($validateOnly, array $optionalArgs = []) - { - $request = new UpdateTriggerRequest(); - $requestParamHeaders = []; - $request->setValidateOnly($validateOnly); - if (isset($optionalArgs['trigger'])) { - $request->setTrigger($optionalArgs['trigger']); - } - - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - if (isset($optionalArgs['allowMissing'])) { - $request->setAllowMissing($optionalArgs['allowMissing']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('UpdateTrigger', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } -} diff --git a/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 3f2301e595f3..000000000000 --- a/owl-bot-staging/Eventarc/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.cloud.eventarc.v1", - "libraryPackage": "Google\\Cloud\\Eventarc\\V1", - "services": { - "Eventarc": { - "clients": { - "grpc": { - "libraryClient": "EventarcGapicClient", - "rpcs": { - "CreateChannel": { - "methods": [ - "createChannel" - ] - }, - "CreateChannelConnection": { - "methods": [ - "createChannelConnection" - ] - }, - "CreateTrigger": { - "methods": [ - "createTrigger" - ] - }, - "DeleteChannel": { - "methods": [ - "deleteChannel" - ] - }, - "DeleteChannelConnection": { - "methods": [ - "deleteChannelConnection" - ] - }, - "DeleteTrigger": { - "methods": [ - "deleteTrigger" - ] - }, - "GetChannel": { - "methods": [ - "getChannel" - ] - }, - "GetChannelConnection": { - "methods": [ - "getChannelConnection" - ] - }, - "GetTrigger": { - "methods": [ - "getTrigger" - ] - }, - "ListChannelConnections": { - "methods": [ - "listChannelConnections" - ] - }, - "ListChannels": { - "methods": [ - "listChannels" - ] - }, - "ListTriggers": { - "methods": [ - "listTriggers" - ] - }, - "UpdateChannel": { - "methods": [ - "updateChannel" - ] - }, - "UpdateTrigger": { - "methods": [ - "updateTrigger" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json deleted file mode 100644 index 378cd88f9176..000000000000 --- a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_client_config.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "interfaces": { - "google.cloud.eventarc.v1.Eventarc": { - "retry_codes": { - "no_retry_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "CreateChannel": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateChannelConnection": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "CreateTrigger": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteChannel": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteChannelConnection": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "DeleteTrigger": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetChannel": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetChannelConnection": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "GetTrigger": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListChannelConnections": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListChannels": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "ListTriggers": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateChannel": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - }, - "UpdateTrigger": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_codes", - "retry_params_name": "no_retry_params" - } - } - } - } -} diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php deleted file mode 100644 index 1f7aa10c4c20..000000000000 --- a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_descriptor_config.php +++ /dev/null @@ -1,118 +0,0 @@ - [ - 'google.cloud.eventarc.v1.Eventarc' => [ - 'CreateChannel' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateChannelConnection' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\ChannelConnection', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'CreateTrigger' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteChannel' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteChannelConnection' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\ChannelConnection', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'DeleteTrigger' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateChannel' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Channel', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'UpdateTrigger' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Eventarc\V1\Trigger', - 'metadataReturnType' => '\Google\Cloud\Eventarc\V1\OperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - ], - 'ListChannelConnections' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getChannelConnections', - ], - ], - 'ListChannels' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getChannels', - ], - ], - 'ListTriggers' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getTriggers', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php b/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php deleted file mode 100644 index 36eea765f885..000000000000 --- a/owl-bot-staging/Eventarc/v1/src/V1/resources/eventarc_rest_client_config.php +++ /dev/null @@ -1,334 +0,0 @@ - [ - 'google.cloud.eventarc.v1.Eventarc' => [ - 'CreateChannel' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channels', - 'body' => 'channel', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'channel_id', - 'validate_only', - ], - ], - 'CreateChannelConnection' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channelConnections', - 'body' => 'channel_connection', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'channel_connection_id', - ], - ], - 'CreateTrigger' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - 'body' => 'trigger', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - 'queryParams' => [ - 'trigger_id', - 'validate_only', - ], - ], - 'DeleteChannel' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/channels/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - 'queryParams' => [ - 'validate_only', - ], - ], - 'DeleteChannelConnection' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/channelConnections/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteTrigger' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - 'queryParams' => [ - 'validate_only', - ], - ], - 'GetChannel' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/channels/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetChannelConnection' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/channelConnections/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetTrigger' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/locations/*/triggers/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListChannelConnections' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channelConnections', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListChannels' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/channels', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'ListTriggers' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/triggers', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], - 'UpdateChannel' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{channel.name=projects/*/locations/*/channels/*}', - 'body' => 'channel', - 'placeholders' => [ - 'channel.name' => [ - 'getters' => [ - 'getChannel', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'validate_only', - ], - ], - 'UpdateTrigger' => [ - 'method' => 'patch', - 'uriTemplate' => '/v1/{trigger.name=projects/*/locations/*/triggers/*}', - 'body' => 'trigger', - 'placeholders' => [ - 'trigger.name' => [ - 'getters' => [ - 'getTrigger', - 'getName', - ], - ], - ], - 'queryParams' => [ - 'validate_only', - ], - ], - ], - '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.iam.v1.IAMPolicy' => [ - 'GetIamPolicy' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:getIamPolicy', - 'additionalBindings' => [ - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:getIamPolicy', - ], - [ - 'method' => 'get', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:getIamPolicy', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'SetIamPolicy' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:setIamPolicy', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:setIamPolicy', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:setIamPolicy', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - 'TestIamPermissions' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/triggers/*}:testIamPermissions', - 'body' => '*', - 'additionalBindings' => [ - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channels/*}:testIamPermissions', - 'body' => '*', - ], - [ - 'method' => 'post', - 'uriTemplate' => '/v1/{resource=projects/*/locations/*/channelConnections/*}:testIamPermissions', - 'body' => '*', - ], - ], - 'placeholders' => [ - 'resource' => [ - 'getters' => [ - 'getResource', - ], - ], - ], - ], - ], - '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', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php b/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php deleted file mode 100644 index 038fc64146bf..000000000000 --- a/owl-bot-staging/Eventarc/v1/tests/Unit/V1/EventarcClientTest.php +++ /dev/null @@ -1,1622 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** - * @return EventarcClient - */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new EventarcClient($options); - } - - /** - * @test - */ - public function createChannelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createChannelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $provider = 'provider-987494927'; - $pubsubTopic = 'pubsubTopic-338126829'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new Channel(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setProvider($provider); - $expectedResponse->setPubsubTopic($pubsubTopic); - $expectedResponse->setActivationToken($activationToken); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createChannelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $channel = new Channel(); - $channelName = 'channelName273953326'; - $channel->setName($channelName); - $channelProvider = 'channelProvider-519425004'; - $channel->setProvider($channelProvider); - $channelId = 'channelId-1930808873'; - $validateOnly = false; - $response = $client->createChannel($formattedParent, $channel, $channelId, $validateOnly); - $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.eventarc.v1.Eventarc/CreateChannel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getChannel(); - $this->assertProtobufEquals($channel, $actualValue); - $actualValue = $actualApiRequestObject->getChannelId(); - $this->assertProtobufEquals($channelId, $actualValue); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createChannelTest'); - $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 createChannelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createChannelTest'); - $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $channel = new Channel(); - $channelName = 'channelName273953326'; - $channel->setName($channelName); - $channelProvider = 'channelProvider-519425004'; - $channel->setProvider($channelProvider); - $channelId = 'channelId-1930808873'; - $validateOnly = false; - $response = $client->createChannel($formattedParent, $channel, $channelId, $validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createChannelTest'); - 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 createChannelConnectionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createChannelConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $channel = 'channel738950403'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new ChannelConnection(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setChannel($channel); - $expectedResponse->setActivationToken($activationToken); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createChannelConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $channelConnection = new ChannelConnection(); - $channelConnectionName = 'channelConnectionName-46623124'; - $channelConnection->setName($channelConnectionName); - $channelConnectionChannel = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - $channelConnection->setChannel($channelConnectionChannel); - $channelConnectionId = 'channelConnectionId-1611273248'; - $response = $client->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); - $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.eventarc.v1.Eventarc/CreateChannelConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getChannelConnection(); - $this->assertProtobufEquals($channelConnection, $actualValue); - $actualValue = $actualApiRequestObject->getChannelConnectionId(); - $this->assertProtobufEquals($channelConnectionId, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createChannelConnectionTest'); - $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 createChannelConnectionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createChannelConnectionTest'); - $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $channelConnection = new ChannelConnection(); - $channelConnectionName = 'channelConnectionName-46623124'; - $channelConnection->setName($channelConnectionName); - $channelConnectionChannel = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - $channelConnection->setChannel($channelConnectionChannel); - $channelConnectionId = 'channelConnectionId-1611273248'; - $response = $client->createChannelConnection($formattedParent, $channelConnection, $channelConnectionId); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createChannelConnectionTest'); - 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 createTriggerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $serviceAccount = 'serviceAccount-1948028253'; - $channel = 'channel738950403'; - $etag = 'etag3123477'; - $expectedResponse = new Trigger(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setChannel($channel); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createTriggerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $trigger = new Trigger(); - $triggerName = 'triggerName-681138077'; - $trigger->setName($triggerName); - $triggerEventFilters = []; - $trigger->setEventFilters($triggerEventFilters); - $triggerDestination = new Destination(); - $trigger->setDestination($triggerDestination); - $triggerId = 'triggerId1363517698'; - $validateOnly = false; - $response = $client->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); - $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.eventarc.v1.Eventarc/CreateTrigger', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getTrigger(); - $this->assertProtobufEquals($trigger, $actualValue); - $actualValue = $actualApiRequestObject->getTriggerId(); - $this->assertProtobufEquals($triggerId, $actualValue); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTriggerTest'); - $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 createTriggerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createTriggerTest'); - $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $trigger = new Trigger(); - $triggerName = 'triggerName-681138077'; - $trigger->setName($triggerName); - $triggerEventFilters = []; - $trigger->setEventFilters($triggerEventFilters); - $triggerDestination = new Destination(); - $trigger->setDestination($triggerDestination); - $triggerId = 'triggerId1363517698'; - $validateOnly = false; - $response = $client->createTrigger($formattedParent, $trigger, $triggerId, $validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createTriggerTest'); - 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 deleteChannelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteChannelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $provider = 'provider-987494927'; - $pubsubTopic = 'pubsubTopic-338126829'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new Channel(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setProvider($provider); - $expectedResponse->setPubsubTopic($pubsubTopic); - $expectedResponse->setActivationToken($activationToken); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteChannelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - $validateOnly = false; - $response = $client->deleteChannel($formattedName, $validateOnly); - $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.eventarc.v1.Eventarc/DeleteChannel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteChannelTest'); - $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 deleteChannelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteChannelTest'); - $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 = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - $validateOnly = false; - $response = $client->deleteChannel($formattedName, $validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteChannelTest'); - 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 deleteChannelConnectionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteChannelConnectionTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $channel = 'channel738950403'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new ChannelConnection(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setChannel($channel); - $expectedResponse->setActivationToken($activationToken); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteChannelConnectionTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - $response = $client->deleteChannelConnection($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteChannelConnectionTest'); - $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 deleteChannelConnectionExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteChannelConnectionTest'); - $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 = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - $response = $client->deleteChannelConnection($formattedName); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteChannelConnectionTest'); - 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 deleteTriggerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $serviceAccount = 'serviceAccount-1948028253'; - $channel = 'channel738950403'; - $etag2 = 'etag2-1293302904'; - $expectedResponse = new Trigger(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setChannel($channel); - $expectedResponse->setEtag($etag2); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTriggerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $formattedName = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - $validateOnly = false; - $response = $client->deleteTrigger($formattedName, $validateOnly); - $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.eventarc.v1.Eventarc/DeleteTrigger', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTriggerTest'); - $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 deleteTriggerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTriggerTest'); - $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 = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - $validateOnly = false; - $response = $client->deleteTrigger($formattedName, $validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTriggerTest'); - 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 getChannelTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $provider = 'provider-987494927'; - $pubsubTopic = 'pubsubTopic-338126829'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new Channel(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setProvider($provider); - $expectedResponse->setPubsubTopic($pubsubTopic); - $expectedResponse->setActivationToken($activationToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - $response = $client->getChannel($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetChannel', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getChannelExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->channelName('[PROJECT]', '[LOCATION]', '[CHANNEL]'); - try { - $client->getChannel($formattedName); - // If the $client 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 getChannelConnectionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $channel = 'channel738950403'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new ChannelConnection(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setChannel($channel); - $expectedResponse->setActivationToken($activationToken); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - $response = $client->getChannelConnection($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetChannelConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getChannelConnectionExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->channelConnectionName('[PROJECT]', '[LOCATION]', '[CHANNEL_CONNECTION]'); - try { - $client->getChannelConnection($formattedName); - // If the $client 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 getTriggerTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $uid = 'uid115792'; - $serviceAccount = 'serviceAccount-1948028253'; - $channel = 'channel738950403'; - $etag = 'etag3123477'; - $expectedResponse = new Trigger(); - $expectedResponse->setName($name2); - $expectedResponse->setUid($uid); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setChannel($channel); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - $response = $client->getTrigger($formattedName); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/GetTrigger', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getTriggerExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->triggerName('[PROJECT]', '[LOCATION]', '[TRIGGER]'); - try { - $client->getTrigger($formattedName); - // If the $client 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 listChannelConnectionsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $channelConnectionsElement = new ChannelConnection(); - $channelConnections = [ - $channelConnectionsElement, - ]; - $expectedResponse = new ListChannelConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setChannelConnections($channelConnections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->listChannelConnections($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getChannelConnections()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListChannelConnections', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listChannelConnectionsExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listChannelConnections($formattedParent); - // If the $client 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 listChannelsTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $channelsElement = new Channel(); - $channels = [ - $channelsElement, - ]; - $expectedResponse = new ListChannelsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setChannels($channels); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->listChannels($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getChannels()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListChannels', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listChannelsExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listChannels($formattedParent); - // If the $client 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 listTriggersTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $triggersElement = new Trigger(); - $triggers = [ - $triggersElement, - ]; - $expectedResponse = new ListTriggersResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setTriggers($triggers); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); - $response = $client->listTriggers($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getTriggers()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.eventarc.v1.Eventarc/ListTriggers', $actualFuncCall); - $actualValue = $actualRequestObject->getParent(); - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listTriggersExceptionTest() - { - $transport = $this->createTransport(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - try { - $client->listTriggers($formattedParent); - // If the $client 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 updateChannelTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateChannelTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $provider = 'provider-987494927'; - $pubsubTopic = 'pubsubTopic-338126829'; - $activationToken = 'activationToken1250030992'; - $expectedResponse = new Channel(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setProvider($provider); - $expectedResponse->setPubsubTopic($pubsubTopic); - $expectedResponse->setActivationToken($activationToken); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateChannelTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $validateOnly = false; - $response = $client->updateChannel($validateOnly); - $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.eventarc.v1.Eventarc/UpdateChannel', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateChannelTest'); - $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 updateChannelExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateChannelTest'); - $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 - $validateOnly = false; - $response = $client->updateChannel($validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateChannelTest'); - 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 updateTriggerTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTriggerTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $name = 'name3373707'; - $uid = 'uid115792'; - $serviceAccount = 'serviceAccount-1948028253'; - $channel = 'channel738950403'; - $etag = 'etag3123477'; - $expectedResponse = new Trigger(); - $expectedResponse->setName($name); - $expectedResponse->setUid($uid); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setChannel($channel); - $expectedResponse->setEtag($etag); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/updateTriggerTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $validateOnly = false; - $response = $client->updateTrigger($validateOnly); - $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.eventarc.v1.Eventarc/UpdateTrigger', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getValidateOnly(); - $this->assertProtobufEquals($validateOnly, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTriggerTest'); - $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 updateTriggerExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'serviceAddress' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/updateTriggerTest'); - $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 - $validateOnly = false; - $response = $client->updateTrigger($validateOnly); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/updateTriggerTest'); - 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()); - } -}