From bff1b3fcf79774ff3eef7ddefcc2173836f19f5e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:42:45 -0700 Subject: [PATCH] fix: update gapic-generator-java with mock service generation fixes (#188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add Provider resources PiperOrigin-RevId: 449653329 Source-Link: https://github.com/googleapis/googleapis/commit/a167db13ec9e73c1f6812526d64c27dad1c71558 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4183d84217dec636dfc8acac8d991379ffe84c73 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDE4M2Q4NDIxN2RlYzYzNmRmYzhhY2FjOGQ5OTEzNzlmZmU4NGM3MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1 PiperOrigin-RevId: 450543911 Source-Link: https://github.com/googleapis/googleapis/commit/55283447ab72f10b6c2571d770af0498b593e84f Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f6775cab1958982b88967a43e5e806af0f135db Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Integrate new gapic-generator-java and rules_gapic PiperOrigin-RevId: 454027580 Source-Link: https://github.com/googleapis/googleapis/commit/1b222777baa702e7135610355706570ed2b56318 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Enable REST transport for most of Java and Go clients PiperOrigin-RevId: 456641589 Source-Link: https://github.com/googleapis/googleapis/commit/8a251f5225b789b2383207ffd978f6aa3d77fcf7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update pom.xml * fix: update gapic-generator-java with mock service generation fixes PiperOrigin-RevId: 457524730 Source-Link: https://github.com/googleapis/googleapis/commit/917e7f21cb1dc062744c6694437cdd46219f28cb Source-Link: https://github.com/googleapis/googleapis-gen/commit/2497f9a069d3f6b2d6810d5a4e239cda1e7e5a39 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ5N2Y5YTA2OWQzZjZiMmQ2ODEwZDVhNGUyMzljZGExZTdlNWEzOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Neenu Shaji --- google-cloud-eventarc/pom.xml | 16 + .../cloud/eventarc/v1/EventarcClient.java | 371 +++- .../cloud/eventarc/v1/EventarcSettings.java | 47 +- .../cloud/eventarc/v1/gapic_metadata.json | 6 + .../cloud/eventarc/v1/stub/EventarcStub.java | 24 +- .../v1/stub/EventarcStubSettings.java | 162 +- .../eventarc/v1/stub/GrpcEventarcStub.java | 73 + .../stub/HttpJsonEventarcCallableFactory.java | 105 + .../v1/stub/HttpJsonEventarcStub.java | 1207 +++++++++++ .../v1/EventarcClientHttpJsonTest.java | 1761 +++++++++++++++++ .../cloud/eventarc/v1/EventarcClientTest.java | 169 ++ .../cloud/eventarc/v1/MockEventarcImpl.java | 41 + .../cloud/eventarc/v1/EventarcGrpc.java | 239 ++- .../cloud/eventarc/v1/DiscoveryProto.java | 114 ++ .../google/cloud/eventarc/v1/EventType.java | 1603 +++++++++++++++ .../cloud/eventarc/v1/EventTypeOrBuilder.java | 179 ++ .../cloud/eventarc/v1/EventarcProto.java | 368 ++-- .../cloud/eventarc/v1/FilteringAttribute.java | 1006 ++++++++++ .../v1/FilteringAttributeOrBuilder.java | 103 + .../cloud/eventarc/v1/GetProviderRequest.java | 651 ++++++ .../v1/GetProviderRequestOrBuilder.java | 54 + .../eventarc/v1/ListProvidersRequest.java | 1321 +++++++++++++ .../v1/ListProvidersRequestOrBuilder.java | 154 ++ .../eventarc/v1/ListProvidersResponse.java | 1412 +++++++++++++ .../v1/ListProvidersResponseOrBuilder.java | 155 ++ .../google/cloud/eventarc/v1/Provider.java | 1358 +++++++++++++ .../cloud/eventarc/v1/ProviderName.java | 223 +++ .../cloud/eventarc/v1/ProviderOrBuilder.java | 139 ++ .../google/cloud/eventarc/v1/discovery.proto | 86 + .../google/cloud/eventarc/v1/eventarc.proto | 71 + .../SyncCreateSetCredentialsProvider.java | 41 + .../SyncCreateSetCredentialsProvider1.java | 40 + .../create/SyncCreateSetEndpoint.java | 38 + .../createchannel/AsyncCreateChannel.java | 50 + .../createchannel/AsyncCreateChannelLRO.java | 51 + .../createchannel/SyncCreateChannel.java | 46 + ...reateChannelLocationnameChannelString.java | 41 + .../SyncCreateChannelStringChannelString.java | 41 + .../AsyncCreateChannelConnection.java | 50 + .../AsyncCreateChannelConnectionLRO.java | 50 + .../SyncCreateChannelConnection.java | 45 + ...onLocationnameChannelconnectionString.java | 47 + ...nnectionStringChannelconnectionString.java | 46 + .../createtrigger/AsyncCreateTrigger.java | 50 + .../createtrigger/AsyncCreateTriggerLRO.java | 51 + .../createtrigger/SyncCreateTrigger.java | 46 + ...reateTriggerLocationnameTriggerString.java | 41 + .../SyncCreateTriggerStringTriggerString.java | 41 + .../deletechannel/AsyncDeleteChannel.java | 47 + .../deletechannel/AsyncDeleteChannelLRO.java | 49 + .../deletechannel/SyncDeleteChannel.java | 44 + .../SyncDeleteChannelChannelname.java | 39 + .../SyncDeleteChannelString.java | 39 + .../AsyncDeleteChannelConnection.java | 49 + .../AsyncDeleteChannelConnectionLRO.java | 50 + .../SyncDeleteChannelConnection.java | 45 + ...hannelConnectionChannelconnectionname.java | 40 + .../SyncDeleteChannelConnectionString.java | 40 + .../deletetrigger/AsyncDeleteTrigger.java | 49 + .../deletetrigger/AsyncDeleteTriggerLRO.java | 51 + .../deletetrigger/SyncDeleteTrigger.java | 46 + .../SyncDeleteTriggerStringBoolean.java | 40 + .../SyncDeleteTriggerTriggernameBoolean.java | 40 + .../getchannel/AsyncGetChannel.java | 46 + .../getchannel/SyncGetChannel.java | 43 + .../getchannel/SyncGetChannelChannelname.java | 39 + .../getchannel/SyncGetChannelString.java | 39 + .../AsyncGetChannelConnection.java | 49 + .../SyncGetChannelConnection.java | 45 + ...hannelConnectionChannelconnectionname.java | 40 + .../SyncGetChannelConnectionString.java | 40 + .../getprovider/AsyncGetProvider.java | 46 + .../getprovider/SyncGetProvider.java | 43 + .../SyncGetProviderProvidername.java | 39 + .../getprovider/SyncGetProviderString.java | 39 + .../gettrigger/AsyncGetTrigger.java | 46 + .../gettrigger/SyncGetTrigger.java | 43 + .../gettrigger/SyncGetTriggerString.java | 39 + .../gettrigger/SyncGetTriggerTriggername.java | 39 + .../AsyncListChannelConnections.java | 51 + .../AsyncListChannelConnectionsPaged.java | 59 + .../SyncListChannelConnections.java | 48 + ...yncListChannelConnectionsLocationname.java | 41 + .../SyncListChannelConnectionsString.java | 41 + .../listchannels/AsyncListChannels.java | 51 + .../listchannels/AsyncListChannelsPaged.java | 59 + .../listchannels/SyncListChannels.java | 48 + .../SyncListChannelsLocationname.java | 41 + .../listchannels/SyncListChannelsString.java | 41 + .../listproviders/AsyncListProviders.java | 52 + .../AsyncListProvidersPaged.java | 60 + .../listproviders/SyncListProviders.java | 49 + .../SyncListProvidersLocationname.java | 41 + .../SyncListProvidersString.java | 41 + .../listtriggers/AsyncListTriggers.java | 51 + .../listtriggers/AsyncListTriggersPaged.java | 59 + .../listtriggers/SyncListTriggers.java | 48 + .../SyncListTriggersLocationname.java | 41 + .../listtriggers/SyncListTriggersString.java | 41 + .../updatechannel/AsyncUpdateChannel.java | 49 + .../updatechannel/AsyncUpdateChannelLRO.java | 50 + .../updatechannel/SyncUpdateChannel.java | 45 + .../SyncUpdateChannelChannelFieldmask.java | 40 + .../updatetrigger/AsyncUpdateTrigger.java | 50 + .../updatetrigger/AsyncUpdateTriggerLRO.java | 51 + .../updatetrigger/SyncUpdateTrigger.java | 46 + ...cUpdateTriggerTriggerFieldmaskBoolean.java | 41 + .../gettrigger/SyncGetTrigger.java | 45 + .../gettrigger/SyncGetTrigger.java | 45 + 109 files changed, 16623 insertions(+), 178 deletions(-) create mode 100644 google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java create mode 100644 google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java create mode 100644 google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DiscoveryProto.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventType.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventTypeOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttribute.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttributeOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequest.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequestOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequest.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequestOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Provider.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderName.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderOrBuilder.java create mode 100644 proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/discovery.proto create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider1.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetEndpoint.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannelLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelLocationnameChannelString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelStringChannelString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnectionLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionLocationnameChannelconnectionString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionStringChannelconnectionString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTriggerLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerLocationnameTriggerString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerStringTriggerString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannelLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelChannelname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnectionLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionChannelconnectionname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTriggerLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerStringBoolean.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerTriggernameBoolean.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/AsyncGetChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelChannelname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/AsyncGetChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnection.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionChannelconnectionname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/AsyncGetProvider.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProvider.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderProvidername.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/AsyncGetTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerTriggername.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnections.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnectionsPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnections.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannels.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannelsPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannels.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProviders.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProvidersPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProviders.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggers.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggersPaged.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggers.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersLocationname.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersString.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannelLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannel.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannelChannelFieldmask.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTriggerLRO.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTriggerTriggerFieldmaskBoolean.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcsettings/gettrigger/SyncGetTrigger.java create mode 100644 samples/snippets/generated/com/google/cloud/eventarc/v1/stub/eventarcstubsettings/gettrigger/SyncGetTrigger.java diff --git a/google-cloud-eventarc/pom.xml b/google-cloud-eventarc/pom.xml index 5780019d..e1b50c59 100644 --- a/google-cloud-eventarc/pom.xml +++ b/google-cloud-eventarc/pom.xml @@ -58,6 +58,10 @@ com.google.api gax-grpc + + com.google.api + gax-httpjson + org.threeten threetenbp @@ -77,12 +81,24 @@ test + + com.google.api + gax + testlib + test + com.google.api gax-grpc testlib test + + com.google.api + gax-httpjson + testlib + test + diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java index 34a52c91..30e91115 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcClient.java @@ -20,6 +20,7 @@ import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; @@ -31,7 +32,6 @@ import com.google.cloud.eventarc.v1.stub.EventarcStubSettings; import com.google.common.util.concurrent.MoreExecutors; import com.google.longrunning.Operation; -import com.google.longrunning.OperationsClient; import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; @@ -103,13 +103,28 @@ * EventarcClient eventarcClient = EventarcClient.create(eventarcSettings); * } * + *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *

{@code
+ * // This snippet has been automatically generated for illustrative purposes only.
+ * // It may require modifications to work in your environment.
+ * EventarcSettings eventarcSettings =
+ *     EventarcSettings.newBuilder()
+ *         .setTransportChannelProvider(
+ *             EventarcSettings.defaultHttpJsonTransportProviderBuilder().build())
+ *         .build();
+ * EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
+ * }
+ * *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @Generated("by gapic-generator-java") public class EventarcClient implements BackgroundResource { private final EventarcSettings settings; private final EventarcStub stub; - private final OperationsClient operationsClient; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; /** Constructs an instance of EventarcClient with default settings. */ public static final EventarcClient create() throws IOException { @@ -128,7 +143,6 @@ public static final EventarcClient create(EventarcSettings settings) throws IOEx * Constructs an instance of EventarcClient, using the given stub for making calls. This is for * advanced usage - prefer using create(EventarcSettings). */ - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EventarcClient create(EventarcStub stub) { return new EventarcClient(stub); } @@ -140,21 +154,23 @@ public static final EventarcClient create(EventarcStub stub) { protected EventarcClient(EventarcSettings settings) throws IOException { this.settings = settings; this.stub = ((EventarcStubSettings) settings.getStubSettings()).createStub(); - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected EventarcClient(EventarcStub stub) { this.settings = null; this.stub = stub; - this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); } public final EventarcSettings getSettings() { return settings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public EventarcStub getStub() { return stub; } @@ -163,10 +179,19 @@ public EventarcStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - public final OperationsClient getOperationsClient() { + public final com.google.longrunning.OperationsClient getOperationsClient() { return operationsClient; } + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single trigger. @@ -395,7 +420,7 @@ public final ListTriggersPagedResponse listTriggers(ListTriggersRequest request) * .build(); * while (true) { * ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request); - * for (Trigger element : response.getResponsesList()) { + * for (Trigger element : response.getTriggersList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -1056,7 +1081,7 @@ public final ListChannelsPagedResponse listChannels(ListChannelsRequest request) * .build(); * while (true) { * ListChannelsResponse response = eventarcClient.listChannelsCallable().call(request); - * for (Channel element : response.getResponsesList()) { + * for (Channel element : response.getChannelsList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -1461,6 +1486,254 @@ public final UnaryCallable deleteChannelCallabl return stub.deleteChannelCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single Provider. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]");
+   *   Provider response = eventarcClient.getProvider(name);
+   * }
+   * }
+ * + * @param name Required. The name of the provider to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Provider getProvider(ProviderName name) { + GetProviderRequest request = + GetProviderRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getProvider(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single Provider. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   String name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString();
+   *   Provider response = eventarcClient.getProvider(name);
+   * }
+   * }
+ * + * @param name Required. The name of the provider to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Provider getProvider(String name) { + GetProviderRequest request = GetProviderRequest.newBuilder().setName(name).build(); + return getProvider(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single Provider. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetProviderRequest request =
+   *       GetProviderRequest.newBuilder()
+   *           .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
+   *           .build();
+   *   Provider response = eventarcClient.getProvider(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Provider getProvider(GetProviderRequest request) { + return getProviderCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get a single Provider. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   GetProviderRequest request =
+   *       GetProviderRequest.newBuilder()
+   *           .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
+   *           .build();
+   *   ApiFuture future = eventarcClient.getProviderCallable().futureCall(request);
+   *   // Do something.
+   *   Provider response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getProviderCallable() { + return stub.getProviderCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List providers. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the provider to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProvidersPagedResponse listProviders(LocationName parent) { + ListProvidersRequest request = + ListProvidersRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listProviders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List providers. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent of the provider to get. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProvidersPagedResponse listProviders(String parent) { + ListProvidersRequest request = ListProvidersRequest.newBuilder().setParent(parent).build(); + return listProviders(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List providers. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListProvidersRequest request =
+   *       ListProvidersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Provider element : eventarcClient.listProviders(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListProvidersPagedResponse listProviders(ListProvidersRequest request) { + return listProvidersPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List providers. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListProvidersRequest request =
+   *       ListProvidersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future = eventarcClient.listProvidersPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Provider element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listProvidersPagedCallable() { + return stub.listProvidersPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List providers. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (EventarcClient eventarcClient = EventarcClient.create()) {
+   *   ListProvidersRequest request =
+   *       ListProvidersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListProvidersResponse response = eventarcClient.listProvidersCallable().call(request);
+   *     for (Provider element : response.getProvidersList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listProvidersCallable() { + return stub.listProvidersCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Get a single ChannelConnection. @@ -1702,7 +1975,7 @@ public final ListChannelConnectionsPagedResponse listChannelConnections( * while (true) { * ListChannelConnectionsResponse response = * eventarcClient.listChannelConnectionsCallable().call(request); - * for (ChannelConnection element : response.getResponsesList()) { + * for (ChannelConnection element : response.getChannelConnectionsList()) { * // doThingsWith(element); * } * String nextPageToken = response.getNextPageToken(); @@ -2198,6 +2471,82 @@ protected ListChannelsFixedSizeCollection createCollection( } } + public static class ListProvidersPagedResponse + extends AbstractPagedListResponse< + ListProvidersRequest, + ListProvidersResponse, + Provider, + ListProvidersPage, + ListProvidersFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListProvidersPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListProvidersPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListProvidersPagedResponse(ListProvidersPage page) { + super(page, ListProvidersFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListProvidersPage + extends AbstractPage< + ListProvidersRequest, ListProvidersResponse, Provider, ListProvidersPage> { + + private ListProvidersPage( + PageContext context, + ListProvidersResponse response) { + super(context, response); + } + + private static ListProvidersPage createEmptyPage() { + return new ListProvidersPage(null, null); + } + + @Override + protected ListProvidersPage createPage( + PageContext context, + ListProvidersResponse response) { + return new ListProvidersPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListProvidersFixedSizeCollection + extends AbstractFixedSizeCollection< + ListProvidersRequest, + ListProvidersResponse, + Provider, + ListProvidersPage, + ListProvidersFixedSizeCollection> { + + private ListProvidersFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListProvidersFixedSizeCollection createEmptyCollection() { + return new ListProvidersFixedSizeCollection(null, 0); + } + + @Override + protected ListProvidersFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListProvidersFixedSizeCollection(pages, collectionSize); + } + } + public static class ListChannelConnectionsPagedResponse extends AbstractPagedListResponse< ListChannelConnectionsRequest, diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java index 1d392bac..b1f3ecb2 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/EventarcSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; import com.google.api.core.ApiFunction; @@ -25,6 +26,7 @@ import com.google.api.gax.core.GoogleCredentialsProvider; import com.google.api.gax.core.InstantiatingExecutorProvider; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; import com.google.api.gax.rpc.ClientSettings; @@ -162,6 +164,17 @@ public UnaryCallSettings deleteChannelSettings( return ((EventarcStubSettings) getStubSettings()).deleteChannelOperationSettings(); } + /** Returns the object with the settings used for calls to getProvider. */ + public UnaryCallSettings getProviderSettings() { + return ((EventarcStubSettings) getStubSettings()).getProviderSettings(); + } + + /** Returns the object with the settings used for calls to listProviders. */ + public PagedCallSettings + listProvidersSettings() { + return ((EventarcStubSettings) getStubSettings()).listProvidersSettings(); + } + /** Returns the object with the settings used for calls to getChannelConnection. */ public UnaryCallSettings getChannelConnectionSettings() { @@ -225,11 +238,18 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde return EventarcStubSettings.defaultCredentialsProviderBuilder(); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return EventarcStubSettings.defaultGrpcTransportProviderBuilder(); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return EventarcStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return EventarcStubSettings.defaultTransportChannelProvider(); } @@ -239,11 +259,17 @@ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuil return EventarcStubSettings.defaultApiClientHeaderProviderBuilder(); } - /** Returns a new builder for this class. */ + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + @BetaApi + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -281,6 +307,11 @@ private static Builder createDefault() { return new Builder(EventarcStubSettings.newBuilder()); } + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(EventarcStubSettings.newHttpJsonBuilder()); + } + public EventarcStubSettings.Builder getStubSettingsBuilder() { return ((EventarcStubSettings.Builder) getStubSettings()); } @@ -387,6 +418,18 @@ public UnaryCallSettings.Builder deleteChannelS return getStubSettingsBuilder().deleteChannelOperationSettings(); } + /** Returns the builder for the settings used for calls to getProvider. */ + public UnaryCallSettings.Builder getProviderSettings() { + return getStubSettingsBuilder().getProviderSettings(); + } + + /** Returns the builder for the settings used for calls to listProviders. */ + public PagedCallSettings.Builder< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> + listProvidersSettings() { + return getStubSettingsBuilder().listProvidersSettings(); + } + /** Returns the builder for the settings used for calls to getChannelConnection. */ public UnaryCallSettings.Builder getChannelConnectionSettings() { diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json index 22051592..31806784 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/gapic_metadata.json @@ -34,6 +34,9 @@ "GetChannelConnection": { "methods": ["getChannelConnection", "getChannelConnection", "getChannelConnection", "getChannelConnectionCallable"] }, + "GetProvider": { + "methods": ["getProvider", "getProvider", "getProvider", "getProviderCallable"] + }, "GetTrigger": { "methods": ["getTrigger", "getTrigger", "getTrigger", "getTriggerCallable"] }, @@ -43,6 +46,9 @@ "ListChannels": { "methods": ["listChannels", "listChannels", "listChannels", "listChannelsPagedCallable", "listChannelsCallable"] }, + "ListProviders": { + "methods": ["listProviders", "listProviders", "listProviders", "listProvidersPagedCallable", "listProvidersCallable"] + }, "ListTriggers": { "methods": ["listTriggers", "listTriggers", "listTriggers", "listTriggersPagedCallable", "listTriggersCallable"] }, diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java index 3f8582cf..cae189fa 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -33,14 +34,18 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; import com.google.cloud.eventarc.v1.ListChannelsResponse; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.ListProvidersResponse; import com.google.cloud.eventarc.v1.ListTriggersRequest; import com.google.cloud.eventarc.v1.ListTriggersResponse; import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; @@ -58,7 +63,11 @@ public abstract class EventarcStub implements BackgroundResource { public OperationsStub getOperationsStub() { - throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; } public UnaryCallable getTriggerCallable() { @@ -139,6 +148,19 @@ public UnaryCallable deleteChannelCallable() { throw new UnsupportedOperationException("Not implemented: deleteChannelCallable()"); } + public UnaryCallable getProviderCallable() { + throw new UnsupportedOperationException("Not implemented: getProviderCallable()"); + } + + public UnaryCallable + listProvidersPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listProvidersPagedCallable()"); + } + + public UnaryCallable listProvidersCallable() { + throw new UnsupportedOperationException("Not implemented: listProvidersCallable()"); + } + public UnaryCallable getChannelConnectionCallable() { throw new UnsupportedOperationException("Not implemented: getChannelConnectionCallable()"); diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java index 4acf596f..ff07bde9 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/EventarcStubSettings.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; import com.google.api.core.ApiFunction; @@ -30,6 +31,9 @@ import com.google.api.gax.grpc.GrpcTransportChannel; import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; import com.google.api.gax.longrunning.OperationSnapshot; import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; import com.google.api.gax.retrying.RetrySettings; @@ -56,14 +60,18 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; import com.google.cloud.eventarc.v1.ListChannelsResponse; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.ListProvidersResponse; import com.google.cloud.eventarc.v1.ListTriggersRequest; import com.google.cloud.eventarc.v1.ListTriggersResponse; import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; @@ -142,6 +150,10 @@ public class EventarcStubSettings extends StubSettings { private final UnaryCallSettings deleteChannelSettings; private final OperationCallSettings deleteChannelOperationSettings; + private final UnaryCallSettings getProviderSettings; + private final PagedCallSettings< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> + listProvidersSettings; private final UnaryCallSettings getChannelConnectionSettings; private final PagedCallSettings< @@ -232,6 +244,42 @@ public Iterable extractResources(ListChannelsResponse payload) { } }; + private static final PagedListDescriptor + LIST_PROVIDERS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListProvidersRequest injectToken(ListProvidersRequest payload, String token) { + return ListProvidersRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListProvidersRequest injectPageSize(ListProvidersRequest payload, int pageSize) { + return ListProvidersRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListProvidersRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListProvidersResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListProvidersResponse payload) { + return payload.getProvidersList() == null + ? ImmutableList.of() + : payload.getProvidersList(); + } + }; + private static final PagedListDescriptor< ListChannelConnectionsRequest, ListChannelConnectionsResponse, ChannelConnection> LIST_CHANNEL_CONNECTIONS_PAGE_STR_DESC = @@ -309,6 +357,23 @@ public ApiFuture getFuturePagedResponse( } }; + private static final PagedListResponseFactory< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> + LIST_PROVIDERS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListProvidersRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PROVIDERS_PAGE_STR_DESC, request, context); + return ListProvidersPagedResponse.createAsync(pageContext, futureResponse); + } + }; + private static final PagedListResponseFactory< ListChannelConnectionsRequest, ListChannelConnectionsResponse, @@ -424,6 +489,17 @@ public UnaryCallSettings deleteChannelSettings( return deleteChannelOperationSettings; } + /** Returns the object with the settings used for calls to getProvider. */ + public UnaryCallSettings getProviderSettings() { + return getProviderSettings; + } + + /** Returns the object with the settings used for calls to listProviders. */ + public PagedCallSettings + listProvidersSettings() { + return listProvidersSettings; + } + /** Returns the object with the settings used for calls to getChannelConnection. */ public UnaryCallSettings getChannelConnectionSettings() { @@ -463,13 +539,17 @@ public UnaryCallSettings deleteChannelSettings( return deleteChannelConnectionOperationSettings; } - @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public EventarcStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEventarcStub.create(this); } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonEventarcStub.create(this); + } throw new UnsupportedOperationException( String.format( "Transport not supported: %s", getTransportChannelProvider().getTransportName())); @@ -502,29 +582,54 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde .setUseJwtAccessWithScope(true); } - /** Returns a builder for the default ChannelProvider for this service. */ + /** Returns a builder for the default gRPC ChannelProvider for this service. */ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { return InstantiatingGrpcChannelProvider.newBuilder() .setMaxInboundMessageSize(Integer.MAX_VALUE); } + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + public static TransportChannelProvider defaultTransportChannelProvider() { return defaultGrpcTransportProviderBuilder().build(); } @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") - public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { return ApiClientHeaderProvider.newBuilder() .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EventarcStubSettings.class)) .setTransportToken( GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); } - /** Returns a new builder for this class. */ + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EventarcStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return EventarcStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ public static Builder newBuilder() { return Builder.createDefault(); } + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + /** Returns a new builder for this class. */ public static Builder newBuilder(ClientContext clientContext) { return new Builder(clientContext); @@ -554,6 +659,8 @@ protected EventarcStubSettings(Builder settingsBuilder) throws IOException { updateChannelOperationSettings = settingsBuilder.updateChannelOperationSettings().build(); deleteChannelSettings = settingsBuilder.deleteChannelSettings().build(); deleteChannelOperationSettings = settingsBuilder.deleteChannelOperationSettings().build(); + getProviderSettings = settingsBuilder.getProviderSettings().build(); + listProvidersSettings = settingsBuilder.listProvidersSettings().build(); getChannelConnectionSettings = settingsBuilder.getChannelConnectionSettings().build(); listChannelConnectionsSettings = settingsBuilder.listChannelConnectionsSettings().build(); createChannelConnectionSettings = settingsBuilder.createChannelConnectionSettings().build(); @@ -593,6 +700,10 @@ public static class Builder extends StubSettings.Builder deleteChannelSettings; private final OperationCallSettings.Builder deleteChannelOperationSettings; + private final UnaryCallSettings.Builder getProviderSettings; + private final PagedCallSettings.Builder< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> + listProvidersSettings; private final UnaryCallSettings.Builder getChannelConnectionSettings; private final PagedCallSettings.Builder< @@ -653,6 +764,8 @@ protected Builder(ClientContext clientContext) { updateChannelOperationSettings = OperationCallSettings.newBuilder(); deleteChannelSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); deleteChannelOperationSettings = OperationCallSettings.newBuilder(); + getProviderSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listProvidersSettings = PagedCallSettings.newBuilder(LIST_PROVIDERS_PAGE_STR_FACT); getChannelConnectionSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listChannelConnectionsSettings = PagedCallSettings.newBuilder(LIST_CHANNEL_CONNECTIONS_PAGE_STR_FACT); @@ -673,6 +786,8 @@ protected Builder(ClientContext clientContext) { createChannelSettings, updateChannelSettings, deleteChannelSettings, + getProviderSettings, + listProvidersSettings, getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, @@ -699,6 +814,8 @@ protected Builder(EventarcStubSettings settings) { updateChannelOperationSettings = settings.updateChannelOperationSettings.toBuilder(); deleteChannelSettings = settings.deleteChannelSettings.toBuilder(); deleteChannelOperationSettings = settings.deleteChannelOperationSettings.toBuilder(); + getProviderSettings = settings.getProviderSettings.toBuilder(); + listProvidersSettings = settings.listProvidersSettings.toBuilder(); getChannelConnectionSettings = settings.getChannelConnectionSettings.toBuilder(); listChannelConnectionsSettings = settings.listChannelConnectionsSettings.toBuilder(); createChannelConnectionSettings = settings.createChannelConnectionSettings.toBuilder(); @@ -720,6 +837,8 @@ protected Builder(EventarcStubSettings settings) { createChannelSettings, updateChannelSettings, deleteChannelSettings, + getProviderSettings, + listProvidersSettings, getChannelConnectionSettings, listChannelConnectionsSettings, createChannelConnectionSettings, @@ -739,6 +858,19 @@ private static Builder createDefault() { return initDefaults(builder); } + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + private static Builder initDefaults(Builder builder) { builder .getTriggerSettings() @@ -790,6 +922,16 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .getProviderSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .listProvidersSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .getChannelConnectionSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -1122,6 +1264,18 @@ public UnaryCallSettings.Builder deleteChannelS return deleteChannelOperationSettings; } + /** Returns the builder for the settings used for calls to getProvider. */ + public UnaryCallSettings.Builder getProviderSettings() { + return getProviderSettings; + } + + /** Returns the builder for the settings used for calls to listProviders. */ + public PagedCallSettings.Builder< + ListProvidersRequest, ListProvidersResponse, ListProvidersPagedResponse> + listProvidersSettings() { + return listProvidersSettings; + } + /** Returns the builder for the settings used for calls to getChannelConnection. */ public UnaryCallSettings.Builder getChannelConnectionSettings() { diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java index 673d866e..29a898ae 100644 --- a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/GrpcEventarcStub.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; import com.google.api.gax.core.BackgroundResource; @@ -37,14 +38,18 @@ import com.google.cloud.eventarc.v1.DeleteTriggerRequest; import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetProviderRequest; import com.google.cloud.eventarc.v1.GetTriggerRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; import com.google.cloud.eventarc.v1.ListChannelsRequest; import com.google.cloud.eventarc.v1.ListChannelsResponse; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.ListProvidersResponse; import com.google.cloud.eventarc.v1.ListTriggersRequest; import com.google.cloud.eventarc.v1.ListTriggersResponse; import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Provider; import com.google.cloud.eventarc.v1.Trigger; import com.google.cloud.eventarc.v1.UpdateChannelRequest; import com.google.cloud.eventarc.v1.UpdateTriggerRequest; @@ -161,6 +166,25 @@ public class GrpcEventarcStub extends EventarcStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor getProviderMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider") + .setRequestMarshaller(ProtoUtils.marshaller(GetProviderRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Provider.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listProvidersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders") + .setRequestMarshaller( + ProtoUtils.marshaller(ListProvidersRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListProvidersResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getChannelConnectionMethodDescriptor = MethodDescriptor.newBuilder() @@ -230,6 +254,10 @@ public class GrpcEventarcStub extends EventarcStub { private final UnaryCallable deleteChannelCallable; private final OperationCallable deleteChannelOperationCallable; + private final UnaryCallable getProviderCallable; + private final UnaryCallable listProvidersCallable; + private final UnaryCallable + listProvidersPagedCallable; private final UnaryCallable getChannelConnectionCallable; private final UnaryCallable @@ -386,6 +414,26 @@ protected GrpcEventarcStub( return params.build(); }) .build(); + GrpcCallSettings getProviderTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getProviderMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings listProvidersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listProvidersMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); GrpcCallSettings getChannelConnectionTransportSettings = GrpcCallSettings.newBuilder() @@ -504,6 +552,15 @@ protected GrpcEventarcStub( settings.deleteChannelOperationSettings(), clientContext, operationsStub); + this.getProviderCallable = + callableFactory.createUnaryCallable( + getProviderTransportSettings, settings.getProviderSettings(), clientContext); + this.listProvidersCallable = + callableFactory.createUnaryCallable( + listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); + this.listProvidersPagedCallable = + callableFactory.createPagedCallable( + listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); this.getChannelConnectionCallable = callableFactory.createUnaryCallable( getChannelConnectionTransportSettings, @@ -646,6 +703,22 @@ public UnaryCallable deleteChannelCallable() { return deleteChannelOperationCallable; } + @Override + public UnaryCallable getProviderCallable() { + return getProviderCallable; + } + + @Override + public UnaryCallable listProvidersCallable() { + return listProvidersCallable; + } + + @Override + public UnaryCallable + listProvidersPagedCallable() { + return listProvidersPagedCallable; + } + @Override public UnaryCallable getChannelConnectionCallable() { diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java new file mode 100644 index 00000000..a3d7450d --- /dev/null +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Eventarc service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonEventarcCallableFactory + implements HttpJsonStubCallableFactory { + + @Override + public UnaryCallable createUnaryCallable( + HttpJsonCallSettings httpJsonCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createUnaryCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + HttpJsonCallSettings httpJsonCallSettings, + PagedCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createPagedCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + HttpJsonCallSettings httpJsonCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createBatchingCallable( + httpJsonCallSettings, callSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + HttpJsonCallSettings httpJsonCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + UnaryCallable innerCallable = + HttpJsonCallableFactory.createBaseUnaryCallable( + httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext); + HttpJsonOperationSnapshotCallable initialCallable = + new HttpJsonOperationSnapshotCallable( + innerCallable, + httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory()); + return HttpJsonCallableFactory.createOperationCallable( + callSettings, clientContext, operationsStub.longRunningClient(), initialCallable); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + HttpJsonCallSettings httpJsonCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return HttpJsonCallableFactory.createServerStreamingCallable( + httpJsonCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java new file mode 100644 index 00000000..541654c8 --- /dev/null +++ b/google-cloud-eventarc/src/main/java/com/google/cloud/eventarc/v1/stub/HttpJsonEventarcStub.java @@ -0,0 +1,1207 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.stub; + +import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest; +import com.google.cloud.eventarc.v1.CreateChannelRequest; +import com.google.cloud.eventarc.v1.CreateTriggerRequest; +import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest; +import com.google.cloud.eventarc.v1.DeleteChannelRequest; +import com.google.cloud.eventarc.v1.DeleteTriggerRequest; +import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; +import com.google.cloud.eventarc.v1.GetChannelRequest; +import com.google.cloud.eventarc.v1.GetProviderRequest; +import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; +import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; +import com.google.cloud.eventarc.v1.ListChannelsRequest; +import com.google.cloud.eventarc.v1.ListChannelsResponse; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.ListProvidersResponse; +import com.google.cloud.eventarc.v1.ListTriggersRequest; +import com.google.cloud.eventarc.v1.ListTriggersResponse; +import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Provider; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Eventarc service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonEventarcStub extends EventarcStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Channel.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .add(Trigger.getDescriptor()) + .add(ChannelConnection.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor getTriggerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetTrigger") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/triggers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Trigger.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listTriggersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListTriggers") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/triggers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListTriggersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createTriggerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateTrigger") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/triggers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "triggerId", request.getTriggerId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("trigger", request.getTrigger())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateTriggerRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateTriggerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateTrigger") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{trigger.name=projects/*/locations/*/triggers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "trigger.name", request.getTrigger().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("trigger", request.getTrigger())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateTriggerRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteTriggerMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteTrigger") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/triggers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "allowMissing", request.getAllowMissing()); + serializer.putQueryParam(fields, "etag", request.getEtag()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteTriggerRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor getChannelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannel") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/channels/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Channel.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listChannelsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannels") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/channels", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListChannelsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createChannelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannel") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/channels", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "channelId", request.getChannelId()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("channel", request.getChannel())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateChannelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateChannelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/UpdateChannel") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{channel.name=projects/*/locations/*/channels/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "channel.name", request.getChannel().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("channel", request.getChannel())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateChannelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteChannelMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannel") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/channels/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "validateOnly", request.getValidateOnly()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteChannelRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getProviderMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetProvider") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/providers/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Provider.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listProvidersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListProviders") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/providers", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListProvidersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getChannelConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/GetChannelConnection") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/channelConnections/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ChannelConnection.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + ListChannelConnectionsRequest, ListChannelConnectionsResponse> + listChannelConnectionsMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/ListChannelConnections") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/channelConnections", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListChannelConnectionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createChannelConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/CreateChannelConnection") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/channelConnections", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "channelConnectionId", request.getChannelConnectionId()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("channelConnection", request.getChannelConnection())) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateChannelConnectionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteChannelConnectionMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.eventarc.v1.Eventarc/DeleteChannelConnection") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/channelConnections/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (DeleteChannelConnectionRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable getTriggerCallable; + private final UnaryCallable listTriggersCallable; + private final UnaryCallable + listTriggersPagedCallable; + private final UnaryCallable createTriggerCallable; + private final OperationCallable + createTriggerOperationCallable; + private final UnaryCallable updateTriggerCallable; + private final OperationCallable + updateTriggerOperationCallable; + private final UnaryCallable deleteTriggerCallable; + private final OperationCallable + deleteTriggerOperationCallable; + private final UnaryCallable getChannelCallable; + private final UnaryCallable listChannelsCallable; + private final UnaryCallable + listChannelsPagedCallable; + private final UnaryCallable createChannelCallable; + private final OperationCallable + createChannelOperationCallable; + private final UnaryCallable updateChannelCallable; + private final OperationCallable + updateChannelOperationCallable; + private final UnaryCallable deleteChannelCallable; + private final OperationCallable + deleteChannelOperationCallable; + private final UnaryCallable getProviderCallable; + private final UnaryCallable listProvidersCallable; + private final UnaryCallable + listProvidersPagedCallable; + private final UnaryCallable + getChannelConnectionCallable; + private final UnaryCallable + listChannelConnectionsCallable; + private final UnaryCallable + listChannelConnectionsPagedCallable; + private final UnaryCallable + createChannelConnectionCallable; + private final OperationCallable< + CreateChannelConnectionRequest, ChannelConnection, OperationMetadata> + createChannelConnectionOperationCallable; + private final UnaryCallable + deleteChannelConnectionCallable; + private final OperationCallable< + DeleteChannelConnectionRequest, ChannelConnection, OperationMetadata> + deleteChannelConnectionOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonEventarcStub create(EventarcStubSettings settings) + throws IOException { + return new HttpJsonEventarcStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonEventarcStub create(ClientContext clientContext) throws IOException { + return new HttpJsonEventarcStub( + EventarcStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonEventarcStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonEventarcStub( + EventarcStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonEventarcStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonEventarcStub(EventarcStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonEventarcCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonEventarcStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected HttpJsonEventarcStub( + EventarcStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create(clientContext, callableFactory, typeRegistry); + + HttpJsonCallSettings getTriggerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getTriggerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listTriggersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTriggersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createTriggerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createTriggerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateTriggerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateTriggerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteTriggerTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTriggerMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getChannelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getChannelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings listChannelsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listChannelsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createChannelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createChannelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings updateChannelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateChannelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteChannelTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteChannelMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getProviderTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getProviderMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listProvidersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listProvidersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getChannelConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getChannelConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listChannelConnectionsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(listChannelConnectionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + createChannelConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createChannelConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + deleteChannelConnectionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteChannelConnectionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.getTriggerCallable = + callableFactory.createUnaryCallable( + getTriggerTransportSettings, settings.getTriggerSettings(), clientContext); + this.listTriggersCallable = + callableFactory.createUnaryCallable( + listTriggersTransportSettings, settings.listTriggersSettings(), clientContext); + this.listTriggersPagedCallable = + callableFactory.createPagedCallable( + listTriggersTransportSettings, settings.listTriggersSettings(), clientContext); + this.createTriggerCallable = + callableFactory.createUnaryCallable( + createTriggerTransportSettings, settings.createTriggerSettings(), clientContext); + this.createTriggerOperationCallable = + callableFactory.createOperationCallable( + createTriggerTransportSettings, + settings.createTriggerOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateTriggerCallable = + callableFactory.createUnaryCallable( + updateTriggerTransportSettings, settings.updateTriggerSettings(), clientContext); + this.updateTriggerOperationCallable = + callableFactory.createOperationCallable( + updateTriggerTransportSettings, + settings.updateTriggerOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteTriggerCallable = + callableFactory.createUnaryCallable( + deleteTriggerTransportSettings, settings.deleteTriggerSettings(), clientContext); + this.deleteTriggerOperationCallable = + callableFactory.createOperationCallable( + deleteTriggerTransportSettings, + settings.deleteTriggerOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getChannelCallable = + callableFactory.createUnaryCallable( + getChannelTransportSettings, settings.getChannelSettings(), clientContext); + this.listChannelsCallable = + callableFactory.createUnaryCallable( + listChannelsTransportSettings, settings.listChannelsSettings(), clientContext); + this.listChannelsPagedCallable = + callableFactory.createPagedCallable( + listChannelsTransportSettings, settings.listChannelsSettings(), clientContext); + this.createChannelCallable = + callableFactory.createUnaryCallable( + createChannelTransportSettings, settings.createChannelSettings(), clientContext); + this.createChannelOperationCallable = + callableFactory.createOperationCallable( + createChannelTransportSettings, + settings.createChannelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateChannelCallable = + callableFactory.createUnaryCallable( + updateChannelTransportSettings, settings.updateChannelSettings(), clientContext); + this.updateChannelOperationCallable = + callableFactory.createOperationCallable( + updateChannelTransportSettings, + settings.updateChannelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteChannelCallable = + callableFactory.createUnaryCallable( + deleteChannelTransportSettings, settings.deleteChannelSettings(), clientContext); + this.deleteChannelOperationCallable = + callableFactory.createOperationCallable( + deleteChannelTransportSettings, + settings.deleteChannelOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getProviderCallable = + callableFactory.createUnaryCallable( + getProviderTransportSettings, settings.getProviderSettings(), clientContext); + this.listProvidersCallable = + callableFactory.createUnaryCallable( + listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); + this.listProvidersPagedCallable = + callableFactory.createPagedCallable( + listProvidersTransportSettings, settings.listProvidersSettings(), clientContext); + this.getChannelConnectionCallable = + callableFactory.createUnaryCallable( + getChannelConnectionTransportSettings, + settings.getChannelConnectionSettings(), + clientContext); + this.listChannelConnectionsCallable = + callableFactory.createUnaryCallable( + listChannelConnectionsTransportSettings, + settings.listChannelConnectionsSettings(), + clientContext); + this.listChannelConnectionsPagedCallable = + callableFactory.createPagedCallable( + listChannelConnectionsTransportSettings, + settings.listChannelConnectionsSettings(), + clientContext); + this.createChannelConnectionCallable = + callableFactory.createUnaryCallable( + createChannelConnectionTransportSettings, + settings.createChannelConnectionSettings(), + clientContext); + this.createChannelConnectionOperationCallable = + callableFactory.createOperationCallable( + createChannelConnectionTransportSettings, + settings.createChannelConnectionOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteChannelConnectionCallable = + callableFactory.createUnaryCallable( + deleteChannelConnectionTransportSettings, + settings.deleteChannelConnectionSettings(), + clientContext); + this.deleteChannelConnectionOperationCallable = + callableFactory.createOperationCallable( + deleteChannelConnectionTransportSettings, + settings.deleteChannelConnectionOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(getTriggerMethodDescriptor); + methodDescriptors.add(listTriggersMethodDescriptor); + methodDescriptors.add(createTriggerMethodDescriptor); + methodDescriptors.add(updateTriggerMethodDescriptor); + methodDescriptors.add(deleteTriggerMethodDescriptor); + methodDescriptors.add(getChannelMethodDescriptor); + methodDescriptors.add(listChannelsMethodDescriptor); + methodDescriptors.add(createChannelMethodDescriptor); + methodDescriptors.add(updateChannelMethodDescriptor); + methodDescriptors.add(deleteChannelMethodDescriptor); + methodDescriptors.add(getProviderMethodDescriptor); + methodDescriptors.add(listProvidersMethodDescriptor); + methodDescriptors.add(getChannelConnectionMethodDescriptor); + methodDescriptors.add(listChannelConnectionsMethodDescriptor); + methodDescriptors.add(createChannelConnectionMethodDescriptor); + methodDescriptors.add(deleteChannelConnectionMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable getTriggerCallable() { + return getTriggerCallable; + } + + @Override + public UnaryCallable listTriggersCallable() { + return listTriggersCallable; + } + + @Override + public UnaryCallable listTriggersPagedCallable() { + return listTriggersPagedCallable; + } + + @Override + public UnaryCallable createTriggerCallable() { + return createTriggerCallable; + } + + @Override + public OperationCallable + createTriggerOperationCallable() { + return createTriggerOperationCallable; + } + + @Override + public UnaryCallable updateTriggerCallable() { + return updateTriggerCallable; + } + + @Override + public OperationCallable + updateTriggerOperationCallable() { + return updateTriggerOperationCallable; + } + + @Override + public UnaryCallable deleteTriggerCallable() { + return deleteTriggerCallable; + } + + @Override + public OperationCallable + deleteTriggerOperationCallable() { + return deleteTriggerOperationCallable; + } + + @Override + public UnaryCallable getChannelCallable() { + return getChannelCallable; + } + + @Override + public UnaryCallable listChannelsCallable() { + return listChannelsCallable; + } + + @Override + public UnaryCallable listChannelsPagedCallable() { + return listChannelsPagedCallable; + } + + @Override + public UnaryCallable createChannelCallable() { + return createChannelCallable; + } + + @Override + public OperationCallable + createChannelOperationCallable() { + return createChannelOperationCallable; + } + + @Override + public UnaryCallable updateChannelCallable() { + return updateChannelCallable; + } + + @Override + public OperationCallable + updateChannelOperationCallable() { + return updateChannelOperationCallable; + } + + @Override + public UnaryCallable deleteChannelCallable() { + return deleteChannelCallable; + } + + @Override + public OperationCallable + deleteChannelOperationCallable() { + return deleteChannelOperationCallable; + } + + @Override + public UnaryCallable getProviderCallable() { + return getProviderCallable; + } + + @Override + public UnaryCallable listProvidersCallable() { + return listProvidersCallable; + } + + @Override + public UnaryCallable + listProvidersPagedCallable() { + return listProvidersPagedCallable; + } + + @Override + public UnaryCallable + getChannelConnectionCallable() { + return getChannelConnectionCallable; + } + + @Override + public UnaryCallable + listChannelConnectionsCallable() { + return listChannelConnectionsCallable; + } + + @Override + public UnaryCallable + listChannelConnectionsPagedCallable() { + return listChannelConnectionsPagedCallable; + } + + @Override + public UnaryCallable + createChannelConnectionCallable() { + return createChannelConnectionCallable; + } + + @Override + public OperationCallable + createChannelConnectionOperationCallable() { + return createChannelConnectionOperationCallable; + } + + @Override + public UnaryCallable + deleteChannelConnectionCallable() { + return deleteChannelConnectionCallable; + } + + @Override + public OperationCallable + deleteChannelConnectionOperationCallable() { + return deleteChannelConnectionOperationCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java new file mode 100644 index 00000000..752f2c4a --- /dev/null +++ b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientHttpJsonTest.java @@ -0,0 +1,1761 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.eventarc.v1.stub.HttpJsonEventarcStub; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class EventarcClientHttpJsonTest { + private static MockHttpService mockService; + private static EventarcClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonEventarcStub.getMethodDescriptors(), EventarcSettings.getDefaultEndpoint()); + EventarcSettings settings = + EventarcSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + EventarcSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = EventarcClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void getTriggerTest() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + + Trigger actualResponse = client.getTrigger(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getTriggerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + client.getTrigger(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getTriggerTest2() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-3275/locations/location-3275/triggers/trigger-3275"; + + Trigger actualResponse = client.getTrigger(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getTriggerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3275/locations/location-3275/triggers/trigger-3275"; + client.getTrigger(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTriggersTest() throws Exception { + Trigger responsesElement = Trigger.newBuilder().build(); + ListTriggersResponse expectedResponse = + ListTriggersResponse.newBuilder() + .setNextPageToken("") + .addAllTriggers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListTriggersPagedResponse pagedListResponse = client.listTriggers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTriggersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTriggersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listTriggers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTriggersTest2() throws Exception { + Trigger responsesElement = Trigger.newBuilder().build(); + ListTriggersResponse expectedResponse = + ListTriggersResponse.newBuilder() + .setNextPageToken("") + .addAllTriggers(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListTriggersPagedResponse pagedListResponse = client.listTriggers(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTriggersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listTriggersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listTriggers(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTriggerTest() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTriggerTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + + Trigger actualResponse = client.createTriggerAsync(parent, trigger, triggerId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createTriggerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + client.createTriggerAsync(parent, trigger, triggerId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createTriggerTest2() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createTriggerTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + + Trigger actualResponse = client.createTriggerAsync(parent, trigger, triggerId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createTriggerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + client.createTriggerAsync(parent, trigger, triggerId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateTriggerTest() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateTriggerTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Trigger trigger = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + boolean allowMissing = true; + + Trigger actualResponse = client.updateTriggerAsync(trigger, updateMask, allowMissing).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateTriggerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Trigger trigger = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + boolean allowMissing = true; + client.updateTriggerAsync(trigger, updateMask, allowMissing).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteTriggerTest() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTriggerTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + boolean allowMissing = true; + + Trigger actualResponse = client.deleteTriggerAsync(name, allowMissing).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTriggerExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + boolean allowMissing = true; + client.deleteTriggerAsync(name, allowMissing).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteTriggerTest2() throws Exception { + Trigger expectedResponse = + Trigger.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .addAllEventFilters(new ArrayList()) + .setServiceAccount("serviceAccount1079137720") + .setDestination(Destination.newBuilder().build()) + .setTransport(Transport.newBuilder().build()) + .putAllLabels(new HashMap()) + .setChannel("channel738950403") + .setEtag("etag3123477") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteTriggerTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-3275/locations/location-3275/triggers/trigger-3275"; + boolean allowMissing = true; + + Trigger actualResponse = client.deleteTriggerAsync(name, allowMissing).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteTriggerExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3275/locations/location-3275/triggers/trigger-3275"; + boolean allowMissing = true; + client.deleteTriggerAsync(name, allowMissing).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getChannelTest() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + mockService.addResponse(expectedResponse); + + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + + Channel actualResponse = client.getChannel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getChannelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + client.getChannel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getChannelTest2() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-3296/locations/location-3296/channels/channel-3296"; + + Channel actualResponse = client.getChannel(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getChannelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3296/locations/location-3296/channels/channel-3296"; + client.getChannel(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChannelsTest() throws Exception { + Channel responsesElement = Channel.newBuilder().build(); + ListChannelsResponse expectedResponse = + ListChannelsResponse.newBuilder() + .setNextPageToken("") + .addAllChannels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListChannelsPagedResponse pagedListResponse = client.listChannels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getChannelsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listChannelsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listChannels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChannelsTest2() throws Exception { + Channel responsesElement = Channel.newBuilder().build(); + ListChannelsResponse expectedResponse = + ListChannelsResponse.newBuilder() + .setNextPageToken("") + .addAllChannels(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListChannelsPagedResponse pagedListResponse = client.listChannels(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getChannelsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listChannelsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listChannels(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createChannelTest() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createChannelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + + Channel actualResponse = client.createChannelAsync(parent, channel, channelId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createChannelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + client.createChannelAsync(parent, channel, channelId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createChannelTest2() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createChannelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + + Channel actualResponse = client.createChannelAsync(parent, channel, channelId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createChannelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + client.createChannelAsync(parent, channel, channelId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateChannelTest() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateChannelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Channel channel = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Channel actualResponse = client.updateChannelAsync(channel, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateChannelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Channel channel = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateChannelAsync(channel, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteChannelTest() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteChannelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + + Channel actualResponse = client.deleteChannelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteChannelExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + client.deleteChannelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteChannelTest2() throws Exception { + Channel expectedResponse = + Channel.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setUid("uid115792") + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setProvider("provider-987494927") + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteChannelTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-3296/locations/location-3296/channels/channel-3296"; + + Channel actualResponse = client.deleteChannelAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteChannelExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-3296/locations/location-3296/channels/channel-3296"; + client.deleteChannelAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getProviderTest() throws Exception { + Provider expectedResponse = + Provider.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .setDisplayName("displayName1714148973") + .addAllEventTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]"); + + Provider actualResponse = client.getProvider(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProviderExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]"); + client.getProvider(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProviderTest2() throws Exception { + Provider expectedResponse = + Provider.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .setDisplayName("displayName1714148973") + .addAllEventTypes(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9368/locations/location-9368/providers/provider-9368"; + + Provider actualResponse = client.getProvider(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getProviderExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9368/locations/location-9368/providers/provider-9368"; + client.getProvider(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProvidersTest() throws Exception { + Provider responsesElement = Provider.newBuilder().build(); + ListProvidersResponse expectedResponse = + ListProvidersResponse.newBuilder() + .setNextPageToken("") + .addAllProviders(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProvidersPagedResponse pagedListResponse = client.listProviders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProvidersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProvidersExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProviders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProvidersTest2() throws Exception { + Provider responsesElement = Provider.newBuilder().build(); + ListProvidersResponse expectedResponse = + ListProvidersResponse.newBuilder() + .setNextPageToken("") + .addAllProviders(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListProvidersPagedResponse pagedListResponse = client.listProviders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProvidersList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listProvidersExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listProviders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getChannelConnectionTest() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + mockService.addResponse(expectedResponse); + + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + + ChannelConnection actualResponse = client.getChannelConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getChannelConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + client.getChannelConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getChannelConnectionTest2() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + mockService.addResponse(expectedResponse); + + String name = + "projects/project-8642/locations/location-8642/channelConnections/channelConnection-8642"; + + ChannelConnection actualResponse = client.getChannelConnection(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getChannelConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8642/locations/location-8642/channelConnections/channelConnection-8642"; + client.getChannelConnection(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChannelConnectionsTest() throws Exception { + ChannelConnection responsesElement = ChannelConnection.newBuilder().build(); + ListChannelConnectionsResponse expectedResponse = + ListChannelConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllChannelConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListChannelConnectionsPagedResponse pagedListResponse = client.listChannelConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getChannelConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listChannelConnectionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listChannelConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listChannelConnectionsTest2() throws Exception { + ChannelConnection responsesElement = ChannelConnection.newBuilder().build(); + ListChannelConnectionsResponse expectedResponse = + ListChannelConnectionsResponse.newBuilder() + .setNextPageToken("") + .addAllChannelConnections(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListChannelConnectionsPagedResponse pagedListResponse = client.listChannelConnections(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getChannelConnectionsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listChannelConnectionsExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listChannelConnections(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createChannelConnectionTest() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createChannelConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + + ChannelConnection actualResponse = + client.createChannelConnectionAsync(parent, channelConnection, channelConnectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createChannelConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + client.createChannelConnectionAsync(parent, channelConnection, channelConnectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createChannelConnectionTest2() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createChannelConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + + ChannelConnection actualResponse = + client.createChannelConnectionAsync(parent, channelConnection, channelConnectionId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createChannelConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + client.createChannelConnectionAsync(parent, channelConnection, channelConnectionId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteChannelConnectionTest() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteChannelConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + + ChannelConnection actualResponse = client.deleteChannelConnectionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteChannelConnectionExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + client.deleteChannelConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteChannelConnectionTest2() throws Exception { + ChannelConnection expectedResponse = + ChannelConnection.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .setUid("uid115792") + .setChannel(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .setActivationToken("activationToken1276937859") + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteChannelConnectionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = + "projects/project-8642/locations/location-8642/channelConnections/channelConnection-8642"; + + ChannelConnection actualResponse = client.deleteChannelConnectionAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteChannelConnectionExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = + "projects/project-8642/locations/location-8642/channelConnections/channelConnection-8642"; + client.deleteChannelConnectionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } +} diff --git a/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java index 13cbde27..48fd8e61 100644 --- a/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java +++ b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/EventarcClientTest.java @@ -18,6 +18,7 @@ import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelConnectionsPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListChannelsPagedResponse; +import static com.google.cloud.eventarc.v1.EventarcClient.ListProvidersPagedResponse; import static com.google.cloud.eventarc.v1.EventarcClient.ListTriggersPagedResponse; import com.google.api.gax.core.NoCredentialsProvider; @@ -1020,6 +1021,174 @@ public void deleteChannelExceptionTest2() throws Exception { } } + @Test + public void getProviderTest() throws Exception { + Provider expectedResponse = + Provider.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .setDisplayName("displayName1714148973") + .addAllEventTypes(new ArrayList()) + .build(); + mockEventarc.addResponse(expectedResponse); + + ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]"); + + Provider actualResponse = client.getProvider(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProviderRequest actualRequest = ((GetProviderRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProviderExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]"); + client.getProvider(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getProviderTest2() throws Exception { + Provider expectedResponse = + Provider.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .setDisplayName("displayName1714148973") + .addAllEventTypes(new ArrayList()) + .build(); + mockEventarc.addResponse(expectedResponse); + + String name = "name3373707"; + + Provider actualResponse = client.getProvider(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetProviderRequest actualRequest = ((GetProviderRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getProviderExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + String name = "name3373707"; + client.getProvider(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProvidersTest() throws Exception { + Provider responsesElement = Provider.newBuilder().build(); + ListProvidersResponse expectedResponse = + ListProvidersResponse.newBuilder() + .setNextPageToken("") + .addAllProviders(Arrays.asList(responsesElement)) + .build(); + mockEventarc.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListProvidersPagedResponse pagedListResponse = client.listProviders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProvidersList().get(0), resources.get(0)); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProvidersRequest actualRequest = ((ListProvidersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProvidersExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listProviders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listProvidersTest2() throws Exception { + Provider responsesElement = Provider.newBuilder().build(); + ListProvidersResponse expectedResponse = + ListProvidersResponse.newBuilder() + .setNextPageToken("") + .addAllProviders(Arrays.asList(responsesElement)) + .build(); + mockEventarc.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListProvidersPagedResponse pagedListResponse = client.listProviders(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getProvidersList().get(0), resources.get(0)); + + List actualRequests = mockEventarc.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListProvidersRequest actualRequest = ((ListProvidersRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listProvidersExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEventarc.addException(exception); + + try { + String parent = "parent-995424086"; + client.listProviders(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void getChannelConnectionTest() throws Exception { ChannelConnection expectedResponse = diff --git a/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java index 6697af4f..88ebcf70 100644 --- a/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java +++ b/google-cloud-eventarc/src/test/java/com/google/cloud/eventarc/v1/MockEventarcImpl.java @@ -267,6 +267,47 @@ public void deleteChannel( } } + @Override + public void getProvider(GetProviderRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Provider) { + requests.add(request); + responseObserver.onNext(((Provider) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetProvider, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Provider.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listProviders( + ListProvidersRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListProvidersResponse) { + requests.add(request); + responseObserver.onNext(((ListProvidersResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListProviders, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListProvidersResponse.class.getName(), + Exception.class.getName()))); + } + } + @Override public void getChannelConnection( GetChannelConnectionRequest request, StreamObserver responseObserver) { diff --git a/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java b/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java index 657ddfcd..64047eb4 100644 --- a/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java +++ b/grpc-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcGrpc.java @@ -462,6 +462,93 @@ private EventarcGrpc() {} return getDeleteChannelMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetProviderRequest, com.google.cloud.eventarc.v1.Provider> + getGetProviderMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetProvider", + requestType = com.google.cloud.eventarc.v1.GetProviderRequest.class, + responseType = com.google.cloud.eventarc.v1.Provider.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetProviderRequest, com.google.cloud.eventarc.v1.Provider> + getGetProviderMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.GetProviderRequest, com.google.cloud.eventarc.v1.Provider> + getGetProviderMethod; + if ((getGetProviderMethod = EventarcGrpc.getGetProviderMethod) == null) { + synchronized (EventarcGrpc.class) { + if ((getGetProviderMethod = EventarcGrpc.getGetProviderMethod) == null) { + EventarcGrpc.getGetProviderMethod = + getGetProviderMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetProvider")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.GetProviderRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.Provider.getDefaultInstance())) + .setSchemaDescriptor(new EventarcMethodDescriptorSupplier("GetProvider")) + .build(); + } + } + } + return getGetProviderMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.ListProvidersRequest, + com.google.cloud.eventarc.v1.ListProvidersResponse> + getListProvidersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListProviders", + requestType = com.google.cloud.eventarc.v1.ListProvidersRequest.class, + responseType = com.google.cloud.eventarc.v1.ListProvidersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.ListProvidersRequest, + com.google.cloud.eventarc.v1.ListProvidersResponse> + getListProvidersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.eventarc.v1.ListProvidersRequest, + com.google.cloud.eventarc.v1.ListProvidersResponse> + getListProvidersMethod; + if ((getListProvidersMethod = EventarcGrpc.getListProvidersMethod) == null) { + synchronized (EventarcGrpc.class) { + if ((getListProvidersMethod = EventarcGrpc.getListProvidersMethod) == null) { + EventarcGrpc.getListProvidersMethod = + getListProvidersMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListProviders")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.ListProvidersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.eventarc.v1.ListProvidersResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EventarcMethodDescriptorSupplier("ListProviders")) + .build(); + } + } + } + return getListProvidersMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.eventarc.v1.GetChannelConnectionRequest, com.google.cloud.eventarc.v1.ChannelConnection> @@ -846,6 +933,35 @@ public void deleteChannel( getDeleteChannelMethod(), responseObserver); } + /** + * + * + *

+     * Get a single Provider.
+     * 
+ */ + public void getProvider( + com.google.cloud.eventarc.v1.GetProviderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetProviderMethod(), responseObserver); + } + + /** + * + * + *
+     * List providers.
+     * 
+ */ + public void listProviders( + com.google.cloud.eventarc.v1.ListProvidersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListProvidersMethod(), responseObserver); + } + /** * * @@ -969,6 +1085,19 @@ public final io.grpc.ServerServiceDefinition bindService() { new MethodHandlers< com.google.cloud.eventarc.v1.DeleteChannelRequest, com.google.longrunning.Operation>(this, METHODID_DELETE_CHANNEL))) + .addMethod( + getGetProviderMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.eventarc.v1.GetProviderRequest, + com.google.cloud.eventarc.v1.Provider>(this, METHODID_GET_PROVIDER))) + .addMethod( + getListProvidersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.eventarc.v1.ListProvidersRequest, + com.google.cloud.eventarc.v1.ListProvidersResponse>( + this, METHODID_LIST_PROVIDERS))) .addMethod( getGetChannelConnectionMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -1175,6 +1304,39 @@ public void deleteChannel( responseObserver); } + /** + * + * + *
+     * Get a single Provider.
+     * 
+ */ + public void getProvider( + com.google.cloud.eventarc.v1.GetProviderRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetProviderMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List providers.
+     * 
+ */ + public void listProviders( + com.google.cloud.eventarc.v1.ListProvidersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListProvidersMethod(), getCallOptions()), + request, + responseObserver); + } + /** * * @@ -1391,6 +1553,32 @@ public com.google.longrunning.Operation deleteChannel( getChannel(), getDeleteChannelMethod(), getCallOptions(), request); } + /** + * + * + *
+     * Get a single Provider.
+     * 
+ */ + public com.google.cloud.eventarc.v1.Provider getProvider( + com.google.cloud.eventarc.v1.GetProviderRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetProviderMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List providers.
+     * 
+ */ + public com.google.cloud.eventarc.v1.ListProvidersResponse listProviders( + com.google.cloud.eventarc.v1.ListProvidersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListProvidersMethod(), getCallOptions(), request); + } + /** * * @@ -1595,6 +1783,33 @@ protected EventarcFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getDeleteChannelMethod(), getCallOptions()), request); } + /** + * + * + *
+     * Get a single Provider.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getProvider(com.google.cloud.eventarc.v1.GetProviderRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetProviderMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List providers.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.eventarc.v1.ListProvidersResponse> + listProviders(com.google.cloud.eventarc.v1.ListProvidersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListProvidersMethod(), getCallOptions()), request); + } + /** * * @@ -1662,10 +1877,12 @@ protected EventarcFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions private static final int METHODID_CREATE_CHANNEL = 7; private static final int METHODID_UPDATE_CHANNEL = 8; private static final int METHODID_DELETE_CHANNEL = 9; - private static final int METHODID_GET_CHANNEL_CONNECTION = 10; - private static final int METHODID_LIST_CHANNEL_CONNECTIONS = 11; - private static final int METHODID_CREATE_CHANNEL_CONNECTION = 12; - private static final int METHODID_DELETE_CHANNEL_CONNECTION = 13; + private static final int METHODID_GET_PROVIDER = 10; + private static final int METHODID_LIST_PROVIDERS = 11; + private static final int METHODID_GET_CHANNEL_CONNECTION = 12; + private static final int METHODID_LIST_CHANNEL_CONNECTIONS = 13; + private static final int METHODID_CREATE_CHANNEL_CONNECTION = 14; + private static final int METHODID_DELETE_CHANNEL_CONNECTION = 15; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1736,6 +1953,18 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (com.google.cloud.eventarc.v1.DeleteChannelRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_PROVIDER: + serviceImpl.getProvider( + (com.google.cloud.eventarc.v1.GetProviderRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_PROVIDERS: + serviceImpl.listProviders( + (com.google.cloud.eventarc.v1.ListProvidersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; case METHODID_GET_CHANNEL_CONNECTION: serviceImpl.getChannelConnection( (com.google.cloud.eventarc.v1.GetChannelConnectionRequest) request, @@ -1831,6 +2060,8 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getCreateChannelMethod()) .addMethod(getUpdateChannelMethod()) .addMethod(getDeleteChannelMethod()) + .addMethod(getGetProviderMethod()) + .addMethod(getListProvidersMethod()) .addMethod(getGetChannelConnectionMethod()) .addMethod(getListChannelConnectionsMethod()) .addMethod(getCreateChannelConnectionMethod()) diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DiscoveryProto.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DiscoveryProto.java new file mode 100644 index 00000000..88db7970 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/DiscoveryProto.java @@ -0,0 +1,114 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +public final class DiscoveryProto { + private DiscoveryProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_Provider_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_Provider_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_EventType_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_EventType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_FilteringAttribute_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_FilteringAttribute_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n(google/cloud/eventarc/v1/discovery.pro" + + "to\022\030google.cloud.eventarc.v1\032\037google/api" + + "/field_behavior.proto\032\031google/api/resour" + + "ce.proto\"\361\001\n\010Provider\022\021\n\004name\030\001 \001(\tB\003\340A\003" + + "\022\031\n\014display_name\030\002 \001(\tB\003\340A\003\022=\n\013event_typ" + + "es\030\003 \003(\0132#.google.cloud.eventarc.v1.Even" + + "tTypeB\003\340A\003:x\352Au\n eventarc.googleapis.com" + + "/Provider\022 + * A representation of the event type resource. + * + * + * Protobuf type {@code google.cloud.eventarc.v1.EventType} + */ +public final class EventType extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.EventType) + EventTypeOrBuilder { + private static final long serialVersionUID = 0L; + // Use EventType.newBuilder() to construct. + private EventType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EventType() { + type_ = ""; + description_ = ""; + filteringAttributes_ = java.util.Collections.emptyList(); + eventSchemaUri_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EventType(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EventType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + filteringAttributes_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + filteringAttributes_.add( + input.readMessage( + com.google.cloud.eventarc.v1.FilteringAttribute.parser(), extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + eventSchemaUri_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + filteringAttributes_ = java.util.Collections.unmodifiableList(filteringAttributes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_EventType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_EventType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.EventType.class, + com.google.cloud.eventarc.v1.EventType.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + * + * + *
+   * Output only. The full name of the event type (for example,
+   * "google.cloud.storage.object.v1.finalized"). In the form of
+   * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+   * versioned and event schemas are guaranteed to remain backward compatible
+   * within one version. Note that event type versions and API versions do not
+   * need to match.
+   * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The full name of the event type (for example,
+   * "google.cloud.storage.object.v1.finalized"). In the form of
+   * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+   * versioned and event schemas are guaranteed to remain backward compatible
+   * within one version. Note that event type versions and API versions do not
+   * need to match.
+   * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. Human friendly description of what the event type is about.
+   * For example "Bucket created in Cloud Storage".
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human friendly description of what the event type is about.
+   * For example "Bucket created in Cloud Storage".
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTERING_ATTRIBUTES_FIELD_NUMBER = 3; + private java.util.List filteringAttributes_; + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getFilteringAttributesList() { + return filteringAttributes_; + } + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getFilteringAttributesOrBuilderList() { + return filteringAttributes_; + } + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getFilteringAttributesCount() { + return filteringAttributes_.size(); + } + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttribute getFilteringAttributes(int index) { + return filteringAttributes_.get(index); + } + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder getFilteringAttributesOrBuilder( + int index) { + return filteringAttributes_.get(index); + } + + public static final int EVENT_SCHEMA_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object eventSchemaUri_; + /** + * + * + *
+   * Output only. URI for the event schema.
+   * For example
+   * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+   * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The eventSchemaUri. + */ + @java.lang.Override + public java.lang.String getEventSchemaUri() { + java.lang.Object ref = eventSchemaUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventSchemaUri_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. URI for the event schema.
+   * For example
+   * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+   * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for eventSchemaUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventSchemaUriBytes() { + java.lang.Object ref = eventSchemaUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventSchemaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + for (int i = 0; i < filteringAttributes_.size(); i++) { + output.writeMessage(3, filteringAttributes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventSchemaUri_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, eventSchemaUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + for (int i = 0; i < filteringAttributes_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(3, filteringAttributes_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventSchemaUri_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, eventSchemaUri_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.EventType)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.EventType other = (com.google.cloud.eventarc.v1.EventType) obj; + + if (!getType().equals(other.getType())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getFilteringAttributesList().equals(other.getFilteringAttributesList())) return false; + if (!getEventSchemaUri().equals(other.getEventSchemaUri())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getFilteringAttributesCount() > 0) { + hash = (37 * hash) + FILTERING_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getFilteringAttributesList().hashCode(); + } + hash = (37 * hash) + EVENT_SCHEMA_URI_FIELD_NUMBER; + hash = (53 * hash) + getEventSchemaUri().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.EventType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.EventType parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.EventType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.EventType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A representation of the event type resource.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.EventType} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.EventType) + com.google.cloud.eventarc.v1.EventTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_EventType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_EventType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.EventType.class, + com.google.cloud.eventarc.v1.EventType.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.EventType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFilteringAttributesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + description_ = ""; + + if (filteringAttributesBuilder_ == null) { + filteringAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + filteringAttributesBuilder_.clear(); + } + eventSchemaUri_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_EventType_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.EventType getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.EventType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.EventType build() { + com.google.cloud.eventarc.v1.EventType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.EventType buildPartial() { + com.google.cloud.eventarc.v1.EventType result = + new com.google.cloud.eventarc.v1.EventType(this); + int from_bitField0_ = bitField0_; + result.type_ = type_; + result.description_ = description_; + if (filteringAttributesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + filteringAttributes_ = java.util.Collections.unmodifiableList(filteringAttributes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.filteringAttributes_ = filteringAttributes_; + } else { + result.filteringAttributes_ = filteringAttributesBuilder_.build(); + } + result.eventSchemaUri_ = eventSchemaUri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.EventType) { + return mergeFrom((com.google.cloud.eventarc.v1.EventType) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.EventType other) { + if (other == com.google.cloud.eventarc.v1.EventType.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (filteringAttributesBuilder_ == null) { + if (!other.filteringAttributes_.isEmpty()) { + if (filteringAttributes_.isEmpty()) { + filteringAttributes_ = other.filteringAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFilteringAttributesIsMutable(); + filteringAttributes_.addAll(other.filteringAttributes_); + } + onChanged(); + } + } else { + if (!other.filteringAttributes_.isEmpty()) { + if (filteringAttributesBuilder_.isEmpty()) { + filteringAttributesBuilder_.dispose(); + filteringAttributesBuilder_ = null; + filteringAttributes_ = other.filteringAttributes_; + bitField0_ = (bitField0_ & ~0x00000001); + filteringAttributesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFilteringAttributesFieldBuilder() + : null; + } else { + filteringAttributesBuilder_.addAllMessages(other.filteringAttributes_); + } + } + } + if (!other.getEventSchemaUri().isEmpty()) { + eventSchemaUri_ = other.eventSchemaUri_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.EventType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.eventarc.v1.EventType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * Output only. The full name of the event type (for example,
+     * "google.cloud.storage.object.v1.finalized"). In the form of
+     * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+     * versioned and event schemas are guaranteed to remain backward compatible
+     * within one version. Note that event type versions and API versions do not
+     * need to match.
+     * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The full name of the event type (for example,
+     * "google.cloud.storage.object.v1.finalized"). In the form of
+     * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+     * versioned and event schemas are guaranteed to remain backward compatible
+     * within one version. Note that event type versions and API versions do not
+     * need to match.
+     * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The full name of the event type (for example,
+     * "google.cloud.storage.object.v1.finalized"). In the form of
+     * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+     * versioned and event schemas are guaranteed to remain backward compatible
+     * within one version. Note that event type versions and API versions do not
+     * need to match.
+     * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The full name of the event type (for example,
+     * "google.cloud.storage.object.v1.finalized"). In the form of
+     * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+     * versioned and event schemas are guaranteed to remain backward compatible
+     * within one version. Note that event type versions and API versions do not
+     * need to match.
+     * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The full name of the event type (for example,
+     * "google.cloud.storage.object.v1.finalized"). In the form of
+     * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+     * versioned and event schemas are guaranteed to remain backward compatible
+     * within one version. Note that event type versions and API versions do not
+     * need to match.
+     * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Human friendly description of what the event type is about.
+     * For example "Bucket created in Cloud Storage".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human friendly description of what the event type is about.
+     * For example "Bucket created in Cloud Storage".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human friendly description of what the event type is about.
+     * For example "Bucket created in Cloud Storage".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human friendly description of what the event type is about.
+     * For example "Bucket created in Cloud Storage".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human friendly description of what the event type is about.
+     * For example "Bucket created in Cloud Storage".
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.util.List filteringAttributes_ = + java.util.Collections.emptyList(); + + private void ensureFilteringAttributesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + filteringAttributes_ = + new java.util.ArrayList( + filteringAttributes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.FilteringAttribute, + com.google.cloud.eventarc.v1.FilteringAttribute.Builder, + com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder> + filteringAttributesBuilder_; + + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFilteringAttributesList() { + if (filteringAttributesBuilder_ == null) { + return java.util.Collections.unmodifiableList(filteringAttributes_); + } else { + return filteringAttributesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getFilteringAttributesCount() { + if (filteringAttributesBuilder_ == null) { + return filteringAttributes_.size(); + } else { + return filteringAttributesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.FilteringAttribute getFilteringAttributes(int index) { + if (filteringAttributesBuilder_ == null) { + return filteringAttributes_.get(index); + } else { + return filteringAttributesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFilteringAttributes( + int index, com.google.cloud.eventarc.v1.FilteringAttribute value) { + if (filteringAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilteringAttributesIsMutable(); + filteringAttributes_.set(index, value); + onChanged(); + } else { + filteringAttributesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setFilteringAttributes( + int index, com.google.cloud.eventarc.v1.FilteringAttribute.Builder builderForValue) { + if (filteringAttributesBuilder_ == null) { + ensureFilteringAttributesIsMutable(); + filteringAttributes_.set(index, builderForValue.build()); + onChanged(); + } else { + filteringAttributesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFilteringAttributes(com.google.cloud.eventarc.v1.FilteringAttribute value) { + if (filteringAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilteringAttributesIsMutable(); + filteringAttributes_.add(value); + onChanged(); + } else { + filteringAttributesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFilteringAttributes( + int index, com.google.cloud.eventarc.v1.FilteringAttribute value) { + if (filteringAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilteringAttributesIsMutable(); + filteringAttributes_.add(index, value); + onChanged(); + } else { + filteringAttributesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFilteringAttributes( + com.google.cloud.eventarc.v1.FilteringAttribute.Builder builderForValue) { + if (filteringAttributesBuilder_ == null) { + ensureFilteringAttributesIsMutable(); + filteringAttributes_.add(builderForValue.build()); + onChanged(); + } else { + filteringAttributesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addFilteringAttributes( + int index, com.google.cloud.eventarc.v1.FilteringAttribute.Builder builderForValue) { + if (filteringAttributesBuilder_ == null) { + ensureFilteringAttributesIsMutable(); + filteringAttributes_.add(index, builderForValue.build()); + onChanged(); + } else { + filteringAttributesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllFilteringAttributes( + java.lang.Iterable values) { + if (filteringAttributesBuilder_ == null) { + ensureFilteringAttributesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, filteringAttributes_); + onChanged(); + } else { + filteringAttributesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearFilteringAttributes() { + if (filteringAttributesBuilder_ == null) { + filteringAttributes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + filteringAttributesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeFilteringAttributes(int index) { + if (filteringAttributesBuilder_ == null) { + ensureFilteringAttributesIsMutable(); + filteringAttributes_.remove(index); + onChanged(); + } else { + filteringAttributesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.FilteringAttribute.Builder getFilteringAttributesBuilder( + int index) { + return getFilteringAttributesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder getFilteringAttributesOrBuilder( + int index) { + if (filteringAttributesBuilder_ == null) { + return filteringAttributes_.get(index); + } else { + return filteringAttributesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFilteringAttributesOrBuilderList() { + if (filteringAttributesBuilder_ != null) { + return filteringAttributesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(filteringAttributes_); + } + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.FilteringAttribute.Builder addFilteringAttributesBuilder() { + return getFilteringAttributesFieldBuilder() + .addBuilder(com.google.cloud.eventarc.v1.FilteringAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.FilteringAttribute.Builder addFilteringAttributesBuilder( + int index) { + return getFilteringAttributesFieldBuilder() + .addBuilder(index, com.google.cloud.eventarc.v1.FilteringAttribute.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Filtering attributes for the event type.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getFilteringAttributesBuilderList() { + return getFilteringAttributesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.FilteringAttribute, + com.google.cloud.eventarc.v1.FilteringAttribute.Builder, + com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder> + getFilteringAttributesFieldBuilder() { + if (filteringAttributesBuilder_ == null) { + filteringAttributesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.FilteringAttribute, + com.google.cloud.eventarc.v1.FilteringAttribute.Builder, + com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder>( + filteringAttributes_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + filteringAttributes_ = null; + } + return filteringAttributesBuilder_; + } + + private java.lang.Object eventSchemaUri_ = ""; + /** + * + * + *
+     * Output only. URI for the event schema.
+     * For example
+     * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+     * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The eventSchemaUri. + */ + public java.lang.String getEventSchemaUri() { + java.lang.Object ref = eventSchemaUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + eventSchemaUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. URI for the event schema.
+     * For example
+     * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+     * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for eventSchemaUri. + */ + public com.google.protobuf.ByteString getEventSchemaUriBytes() { + java.lang.Object ref = eventSchemaUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + eventSchemaUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. URI for the event schema.
+     * For example
+     * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+     * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The eventSchemaUri to set. + * @return This builder for chaining. + */ + public Builder setEventSchemaUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + eventSchemaUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI for the event schema.
+     * For example
+     * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+     * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearEventSchemaUri() { + + eventSchemaUri_ = getDefaultInstance().getEventSchemaUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. URI for the event schema.
+     * For example
+     * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+     * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for eventSchemaUri to set. + * @return This builder for chaining. + */ + public Builder setEventSchemaUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + eventSchemaUri_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.EventType) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.EventType) + private static final com.google.cloud.eventarc.v1.EventType DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.EventType(); + } + + public static com.google.cloud.eventarc.v1.EventType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EventType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EventType(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.EventType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventTypeOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventTypeOrBuilder.java new file mode 100644 index 00000000..95f54d95 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventTypeOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +public interface EventTypeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.EventType) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The full name of the event type (for example,
+   * "google.cloud.storage.object.v1.finalized"). In the form of
+   * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+   * versioned and event schemas are guaranteed to remain backward compatible
+   * within one version. Note that event type versions and API versions do not
+   * need to match.
+   * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * Output only. The full name of the event type (for example,
+   * "google.cloud.storage.object.v1.finalized"). In the form of
+   * {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be
+   * versioned and event schemas are guaranteed to remain backward compatible
+   * within one version. Note that event type versions and API versions do not
+   * need to match.
+   * 
+ * + * string type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * Output only. Human friendly description of what the event type is about.
+   * For example "Bucket created in Cloud Storage".
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Human friendly description of what the event type is about.
+   * For example "Bucket created in Cloud Storage".
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getFilteringAttributesList(); + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.eventarc.v1.FilteringAttribute getFilteringAttributes(int index); + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getFilteringAttributesCount(); + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getFilteringAttributesOrBuilderList(); + /** + * + * + *
+   * Output only. Filtering attributes for the event type.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.FilteringAttribute filtering_attributes = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder getFilteringAttributesOrBuilder( + int index); + + /** + * + * + *
+   * Output only. URI for the event schema.
+   * For example
+   * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+   * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The eventSchemaUri. + */ + java.lang.String getEventSchemaUri(); + /** + * + * + *
+   * Output only. URI for the event schema.
+   * For example
+   * "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto"
+   * 
+ * + * string event_schema_uri = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for eventSchemaUri. + */ + com.google.protobuf.ByteString getEventSchemaUriBytes(); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java index b5d5a71a..cbb0319e 100644 --- a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/EventarcProto.java @@ -75,6 +75,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_eventarc_v1_DeleteChannelRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_eventarc_v1_DeleteChannelRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_GetProviderRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_ListProvidersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_eventarc_v1_ListProvidersResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_eventarc_v1_GetChannelConnectionRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -114,156 +126,174 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "to\032\037google/api/field_behavior.proto\032\031goo" + "gle/api/resource.proto\032&google/cloud/eve" + "ntarc/v1/channel.proto\0321google/cloud/eve" - + "ntarc/v1/channel_connection.proto\032&googl" - + "e/cloud/eventarc/v1/trigger.proto\032#googl" - + "e/longrunning/operations.proto\032 google/p" - + "rotobuf/field_mask.proto\032\037google/protobu" - + "f/timestamp.proto\"J\n\021GetTriggerRequest\0225" - + "\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventarc.googleapi" - + "s.com/Trigger\"\207\001\n\023ListTriggersRequest\0227\n" - + "\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.googleap" - + "is.com/Trigger\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npag" - + "e_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\"y\n\024ListT" - + "riggersResponse\0223\n\010triggers\030\001 \003(\0132!.goog" - + "le.cloud.eventarc.v1.Trigger\022\027\n\017next_pag" - + "e_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\275\001\n\024C" - + "reateTriggerRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002" - + "\372A!\022\037eventarc.googleapis.com/Trigger\0227\n\007" - + "trigger\030\002 \001(\0132!.google.cloud.eventarc.v1" - + ".TriggerB\003\340A\002\022\027\n\ntrigger_id\030\003 \001(\tB\003\340A\002\022\032" - + "\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\256\001\n\024UpdateTri" - + "ggerRequest\0222\n\007trigger\030\001 \001(\0132!.google.cl" - + "oud.eventarc.v1.Trigger\022/\n\013update_mask\030\002" - + " \001(\0132\032.google.protobuf.FieldMask\022\025\n\rallo" - + "w_missing\030\003 \001(\010\022\032\n\rvalidate_only\030\004 \001(\010B\003" - + "\340A\002\"\216\001\n\024DeleteTriggerRequest\0225\n\004name\030\001 \001" - + "(\tB\'\340A\002\372A!\n\037eventarc.googleapis.com/Trig" - + "ger\022\014\n\004etag\030\002 \001(\t\022\025\n\rallow_missing\030\003 \001(\010" - + "\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"J\n\021GetChann" - + "elRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventar" - + "c.googleapis.com/Channel\"\207\001\n\023ListChannel" - + "sRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eventa" - + "rc.googleapis.com/Channel\022\021\n\tpage_size\030\002" - + " \001(\005\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001" - + "(\t\"y\n\024ListChannelsResponse\0223\n\010channels\030\001" - + " \003(\0132!.google.cloud.eventarc.v1.Channel\022" - + "\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachable\030" - + "\003 \003(\t\"\275\001\n\024CreateChannelRequest\0227\n\006parent" - + "\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.googleapis.com/" - + "Channel\0227\n\007channel\030\002 \001(\0132!.google.cloud." - + "eventarc.v1.ChannelB\003\340A\002\022\027\n\nchannel_id\030\003" - + " \001(\tB\003\340A\002\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\227\001" - + "\n\024UpdateChannelRequest\0222\n\007channel\030\001 \001(\0132" - + "!.google.cloud.eventarc.v1.Channel\022/\n\013up" - + "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM" - + "ask\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\002\"i\n\024Delet" - + "eChannelRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037e" - + "ventarc.googleapis.com/Channel\022\032\n\rvalida" - + "te_only\030\002 \001(\010B\003\340A\002\"^\n\033GetChannelConnecti" - + "onRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)eventar" - + "c.googleapis.com/ChannelConnection\"\211\001\n\035L" - + "istChannelConnectionsRequest\022A\n\006parent\030\001" - + " \001(\tB1\340A\002\372A+\022)eventarc.googleapis.com/Ch" - + "annelConnection\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npa" - + "ge_token\030\003 \001(\t\"\230\001\n\036ListChannelConnection" - + "sResponse\022H\n\023channel_connections\030\001 \003(\0132+" - + ".google.cloud.eventarc.v1.ChannelConnect" - + "ion\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreacha" - + "ble\030\003 \003(\t\"\325\001\n\036CreateChannelConnectionReq" - + "uest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\022)eventarc.g" - + "oogleapis.com/ChannelConnection\022L\n\022chann" - + "el_connection\030\002 \001(\0132+.google.cloud.event" - + "arc.v1.ChannelConnectionB\003\340A\002\022\"\n\025channel" - + "_connection_id\030\003 \001(\tB\003\340A\002\"a\n\036DeleteChann" - + "elConnectionRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A" - + "+\n)eventarc.googleapis.com/ChannelConnec" - + "tion\"\200\002\n\021OperationMetadata\0224\n\013create_tim" - + "e\030\001 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\0221\n\010end_time\030\002 \001(\0132\032.google.protobuf.Tim" - + "estampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004verb" - + "\030\004 \001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340A\003" - + "\022#\n\026requested_cancellation\030\006 \001(\010B\003\340A\003\022\030\n" - + "\013api_version\030\007 \001(\tB\003\340A\0032\231\027\n\010Eventarc\022\231\001\n" - + "\nGetTrigger\022+.google.cloud.eventarc.v1.G" - + "etTriggerRequest\032!.google.cloud.eventarc" - + ".v1.Trigger\";\202\323\344\223\002.\022,/v1/{name=projects/" - + "*/locations/*/triggers/*}\332A\004name\022\254\001\n\014Lis" - + "tTriggers\022-.google.cloud.eventarc.v1.Lis" - + "tTriggersRequest\032..google.cloud.eventarc" - + ".v1.ListTriggersResponse\"=\202\323\344\223\002.\022,/v1/{p" - + "arent=projects/*/locations/*}/triggers\332A" - + "\006parent\022\330\001\n\rCreateTrigger\022..google.cloud" - + ".eventarc.v1.CreateTriggerRequest\032\035.goog" - + "le.longrunning.Operation\"x\202\323\344\223\0027\",/v1/{p" - + "arent=projects/*/locations/*}/triggers:\007" - + "trigger\332A\031parent,trigger,trigger_id\312A\034\n\007" - + "Trigger\022\021OperationMetadata\022\351\001\n\rUpdateTri" - + "gger\022..google.cloud.eventarc.v1.UpdateTr" - + "iggerRequest\032\035.google.longrunning.Operat" - + "ion\"\210\001\202\323\344\223\002?24/v1/{trigger.name=projects" - + "/*/locations/*/triggers/*}:\007trigger\332A!tr" - + "igger,update_mask,allow_missing\312A\034\n\007Trig" - + "ger\022\021OperationMetadata\022\310\001\n\rDeleteTrigger" - + "\022..google.cloud.eventarc.v1.DeleteTrigge" - + "rRequest\032\035.google.longrunning.Operation\"" - + "h\202\323\344\223\002.*,/v1/{name=projects/*/locations/" - + "*/triggers/*}\332A\022name,allow_missing\312A\034\n\007T" - + "rigger\022\021OperationMetadata\022\231\001\n\nGetChannel" - + "\022+.google.cloud.eventarc.v1.GetChannelRe" - + "quest\032!.google.cloud.eventarc.v1.Channel" - + "\";\202\323\344\223\002.\022,/v1/{name=projects/*/locations" - + "/*/channels/*}\332A\004name\022\254\001\n\014ListChannels\022-" - + ".google.cloud.eventarc.v1.ListChannelsRe" - + "quest\032..google.cloud.eventarc.v1.ListCha" - + "nnelsResponse\"=\202\323\344\223\002.\022,/v1/{parent=proje" - + "cts/*/locations/*}/channels\332A\006parent\022\330\001\n" - + "\rCreateChannel\022..google.cloud.eventarc.v" - + "1.CreateChannelRequest\032\035.google.longrunn" - + "ing.Operation\"x\202\323\344\223\0027\",/v1/{parent=proje" - + "cts/*/locations/*}/channels:\007channel\332A\031p" - + "arent,channel,channel_id\312A\034\n\007Channel\022\021Op" - + "erationMetadata\022\332\001\n\rUpdateChannel\022..goog" - + "le.cloud.eventarc.v1.UpdateChannelReques" - + "t\032\035.google.longrunning.Operation\"z\202\323\344\223\002?" - + "24/v1/{channel.name=projects/*/locations" - + "/*/channels/*}:\007channel\332A\023channel,update" - + "_mask\312A\034\n\007Channel\022\021OperationMetadata\022\272\001\n" - + "\rDeleteChannel\022..google.cloud.eventarc.v" - + "1.DeleteChannelRequest\032\035.google.longrunn" - + "ing.Operation\"Z\202\323\344\223\002.*,/v1/{name=project" - + "s/*/locations/*/channels/*}\332A\004name\312A\034\n\007C" - + "hannel\022\021OperationMetadata\022\301\001\n\024GetChannel" - + "Connection\0225.google.cloud.eventarc.v1.Ge" - + "tChannelConnectionRequest\032+.google.cloud" - + ".eventarc.v1.ChannelConnection\"E\202\323\344\223\0028\0226" - + "/v1/{name=projects/*/locations/*/channel" - + "Connections/*}\332A\004name\022\324\001\n\026ListChannelCon" - + "nections\0227.google.cloud.eventarc.v1.List" - + "ChannelConnectionsRequest\0328.google.cloud" - + ".eventarc.v1.ListChannelConnectionsRespo" - + "nse\"G\202\323\344\223\0028\0226/v1/{parent=projects/*/loca" - + "tions/*}/channelConnections\332A\006parent\022\242\002\n" - + "\027CreateChannelConnection\0228.google.cloud." - + "eventarc.v1.CreateChannelConnectionReque" - + "st\032\035.google.longrunning.Operation\"\255\001\202\323\344\223" - + "\002L\"6/v1/{parent=projects/*/locations/*}/" - + "channelConnections:\022channel_connection\332A" - + "/parent,channel_connection,channel_conne" - + "ction_id\312A&\n\021ChannelConnection\022\021Operatio" - + "nMetadata\022\342\001\n\027DeleteChannelConnection\0228." - + "google.cloud.eventarc.v1.DeleteChannelCo" - + "nnectionRequest\032\035.google.longrunning.Ope" - + "ration\"n\202\323\344\223\0028*6/v1/{name=projects/*/loc" - + "ations/*/channelConnections/*}\332A\004name\312A&" - + "\n\021ChannelConnection\022\021OperationMetadata\032K" - + "\312A\027eventarc.googleapis.com\322A.https://www" - + ".googleapis.com/auth/cloud-platformB\305\001\n\034" - + "com.google.cloud.eventarc.v1B\rEventarcPr" - + "otoP\001Z@google.golang.org/genproto/google" - + "apis/cloud/eventarc/v1;eventarc\252\002\030Google" - + ".Cloud.Eventarc.V1\312\002\030Google\\Cloud\\Eventa" - + "rc\\V1\352\002\033Google::Cloud::Eventarc::V1b\006pro" - + "to3" + + "ntarc/v1/channel_connection.proto\032(googl" + + "e/cloud/eventarc/v1/discovery.proto\032&goo" + + "gle/cloud/eventarc/v1/trigger.proto\032#goo" + + "gle/longrunning/operations.proto\032 google" + + "/protobuf/field_mask.proto\032\037google/proto" + + "buf/timestamp.proto\"J\n\021GetTriggerRequest" + + "\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037eventarc.googlea" + + "pis.com/Trigger\"\207\001\n\023ListTriggersRequest\022" + + "7\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.google" + + "apis.com/Trigger\022\021\n\tpage_size\030\002 \001(\005\022\022\n\np" + + "age_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\"y\n\024Lis" + + "tTriggersResponse\0223\n\010triggers\030\001 \003(\0132!.go" + + "ogle.cloud.eventarc.v1.Trigger\022\027\n\017next_p" + + "age_token\030\002 \001(\t\022\023\n\013unreachable\030\003 \003(\t\"\275\001\n" + + "\024CreateTriggerRequest\0227\n\006parent\030\001 \001(\tB\'\340" + + "A\002\372A!\022\037eventarc.googleapis.com/Trigger\0227" + + "\n\007trigger\030\002 \001(\0132!.google.cloud.eventarc." + + "v1.TriggerB\003\340A\002\022\027\n\ntrigger_id\030\003 \001(\tB\003\340A\002" + + "\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"\256\001\n\024UpdateT" + + "riggerRequest\0222\n\007trigger\030\001 \001(\0132!.google." + + "cloud.eventarc.v1.Trigger\022/\n\013update_mask" + + "\030\002 \001(\0132\032.google.protobuf.FieldMask\022\025\n\ral" + + "low_missing\030\003 \001(\010\022\032\n\rvalidate_only\030\004 \001(\010" + + "B\003\340A\002\"\216\001\n\024DeleteTriggerRequest\0225\n\004name\030\001" + + " \001(\tB\'\340A\002\372A!\n\037eventarc.googleapis.com/Tr" + + "igger\022\014\n\004etag\030\002 \001(\t\022\025\n\rallow_missing\030\003 \001" + + "(\010\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"J\n\021GetCha" + + "nnelRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n\037event" + + "arc.googleapis.com/Channel\"\207\001\n\023ListChann" + + "elsRequest\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\022\037even" + + "tarc.googleapis.com/Channel\022\021\n\tpage_size" + + "\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_by\030\004" + + " \001(\t\"y\n\024ListChannelsResponse\0223\n\010channels" + + "\030\001 \003(\0132!.google.cloud.eventarc.v1.Channe" + + "l\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" + + "e\030\003 \003(\t\"\275\001\n\024CreateChannelRequest\0227\n\006pare" + + "nt\030\001 \001(\tB\'\340A\002\372A!\022\037eventarc.googleapis.co" + + "m/Channel\0227\n\007channel\030\002 \001(\0132!.google.clou" + + "d.eventarc.v1.ChannelB\003\340A\002\022\027\n\nchannel_id" + + "\030\003 \001(\tB\003\340A\002\022\032\n\rvalidate_only\030\004 \001(\010B\003\340A\002\"" + + "\227\001\n\024UpdateChannelRequest\0222\n\007channel\030\001 \001(" + + "\0132!.google.cloud.eventarc.v1.Channel\022/\n\013" + + "update_mask\030\002 \001(\0132\032.google.protobuf.Fiel" + + "dMask\022\032\n\rvalidate_only\030\003 \001(\010B\003\340A\002\"i\n\024Del" + + "eteChannelRequest\0225\n\004name\030\001 \001(\tB\'\340A\002\372A!\n" + + "\037eventarc.googleapis.com/Channel\022\032\n\rvali" + + "date_only\030\002 \001(\010B\003\340A\002\"L\n\022GetProviderReque" + + "st\0226\n\004name\030\001 \001(\tB(\340A\002\372A\"\n eventarc.googl" + + "eapis.com/Provider\"\231\001\n\024ListProvidersRequ" + + "est\0228\n\006parent\030\001 \001(\tB(\340A\002\372A\"\022 eventarc.go" + + "ogleapis.com/Provider\022\021\n\tpage_size\030\002 \001(\005" + + "\022\022\n\npage_token\030\003 \001(\t\022\020\n\010order_by\030\004 \001(\t\022\016" + + "\n\006filter\030\005 \001(\t\"|\n\025ListProvidersResponse\022" + + "5\n\tproviders\030\001 \003(\0132\".google.cloud.eventa" + + "rc.v1.Provider\022\027\n\017next_page_token\030\002 \001(\t\022" + + "\023\n\013unreachable\030\003 \003(\t\"^\n\033GetChannelConnec" + + "tionRequest\022?\n\004name\030\001 \001(\tB1\340A\002\372A+\n)event" + + "arc.googleapis.com/ChannelConnection\"\211\001\n" + + "\035ListChannelConnectionsRequest\022A\n\006parent" + + "\030\001 \001(\tB1\340A\002\372A+\022)eventarc.googleapis.com/" + + "ChannelConnection\022\021\n\tpage_size\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"\230\001\n\036ListChannelConnecti" + + "onsResponse\022H\n\023channel_connections\030\001 \003(\013" + + "2+.google.cloud.eventarc.v1.ChannelConne" + + "ction\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreac" + + "hable\030\003 \003(\t\"\325\001\n\036CreateChannelConnectionR" + + "equest\022A\n\006parent\030\001 \001(\tB1\340A\002\372A+\022)eventarc" + + ".googleapis.com/ChannelConnection\022L\n\022cha" + + "nnel_connection\030\002 \001(\0132+.google.cloud.eve" + + "ntarc.v1.ChannelConnectionB\003\340A\002\022\"\n\025chann" + + "el_connection_id\030\003 \001(\tB\003\340A\002\"a\n\036DeleteCha" + + "nnelConnectionRequest\022?\n\004name\030\001 \001(\tB1\340A\002" + + "\372A+\n)eventarc.googleapis.com/ChannelConn" + + "ection\"\200\002\n\021OperationMetadata\0224\n\013create_t" + + "ime\030\001 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\0221\n\010end_time\030\002 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\022\023\n\006target\030\003 \001(\tB\003\340A\003\022\021\n\004ve" + + "rb\030\004 \001(\tB\003\340A\003\022\033\n\016status_message\030\005 \001(\tB\003\340" + + "A\003\022#\n\026requested_cancellation\030\006 \001(\010B\003\340A\003\022" + + "\030\n\013api_version\030\007 \001(\tB\003\340A\0032\354\031\n\010Eventarc\022\231" + + "\001\n\nGetTrigger\022+.google.cloud.eventarc.v1" + + ".GetTriggerRequest\032!.google.cloud.eventa" + + "rc.v1.Trigger\";\202\323\344\223\002.\022,/v1/{name=project" + + "s/*/locations/*/triggers/*}\332A\004name\022\254\001\n\014L" + + "istTriggers\022-.google.cloud.eventarc.v1.L" + + "istTriggersRequest\032..google.cloud.eventa" + + "rc.v1.ListTriggersResponse\"=\202\323\344\223\002.\022,/v1/" + + "{parent=projects/*/locations/*}/triggers" + + "\332A\006parent\022\330\001\n\rCreateTrigger\022..google.clo" + + "ud.eventarc.v1.CreateTriggerRequest\032\035.go" + + "ogle.longrunning.Operation\"x\202\323\344\223\0027\",/v1/" + + "{parent=projects/*/locations/*}/triggers" + + ":\007trigger\332A\031parent,trigger,trigger_id\312A\034" + + "\n\007Trigger\022\021OperationMetadata\022\351\001\n\rUpdateT" + + "rigger\022..google.cloud.eventarc.v1.Update" + + "TriggerRequest\032\035.google.longrunning.Oper" + + "ation\"\210\001\202\323\344\223\002?24/v1/{trigger.name=projec" + + "ts/*/locations/*/triggers/*}:\007trigger\332A!" + + "trigger,update_mask,allow_missing\312A\034\n\007Tr" + + "igger\022\021OperationMetadata\022\310\001\n\rDeleteTrigg" + + "er\022..google.cloud.eventarc.v1.DeleteTrig" + + "gerRequest\032\035.google.longrunning.Operatio" + + "n\"h\202\323\344\223\002.*,/v1/{name=projects/*/location" + + "s/*/triggers/*}\332A\022name,allow_missing\312A\034\n" + + "\007Trigger\022\021OperationMetadata\022\231\001\n\nGetChann" + + "el\022+.google.cloud.eventarc.v1.GetChannel" + + "Request\032!.google.cloud.eventarc.v1.Chann" + + "el\";\202\323\344\223\002.\022,/v1/{name=projects/*/locatio" + + "ns/*/channels/*}\332A\004name\022\254\001\n\014ListChannels" + + "\022-.google.cloud.eventarc.v1.ListChannels" + + "Request\032..google.cloud.eventarc.v1.ListC" + + "hannelsResponse\"=\202\323\344\223\002.\022,/v1/{parent=pro" + + "jects/*/locations/*}/channels\332A\006parent\022\330" + + "\001\n\rCreateChannel\022..google.cloud.eventarc" + + ".v1.CreateChannelRequest\032\035.google.longru" + + "nning.Operation\"x\202\323\344\223\0027\",/v1/{parent=pro" + + "jects/*/locations/*}/channels:\007channel\332A" + + "\031parent,channel,channel_id\312A\034\n\007Channel\022\021" + + "OperationMetadata\022\332\001\n\rUpdateChannel\022..go" + + "ogle.cloud.eventarc.v1.UpdateChannelRequ" + + "est\032\035.google.longrunning.Operation\"z\202\323\344\223" + + "\002?24/v1/{channel.name=projects/*/locatio" + + "ns/*/channels/*}:\007channel\332A\023channel,upda" + + "te_mask\312A\034\n\007Channel\022\021OperationMetadata\022\272" + + "\001\n\rDeleteChannel\022..google.cloud.eventarc" + + ".v1.DeleteChannelRequest\032\035.google.longru" + + "nning.Operation\"Z\202\323\344\223\002.*,/v1/{name=proje" + + "cts/*/locations/*/channels/*}\332A\004name\312A\034\n" + + "\007Channel\022\021OperationMetadata\022\235\001\n\013GetProvi" + + "der\022,.google.cloud.eventarc.v1.GetProvid" + + "erRequest\032\".google.cloud.eventarc.v1.Pro" + + "vider\"<\202\323\344\223\002/\022-/v1/{name=projects/*/loca" + + "tions/*/providers/*}\332A\004name\022\260\001\n\rListProv" + + "iders\022..google.cloud.eventarc.v1.ListPro" + + "vidersRequest\032/.google.cloud.eventarc.v1" + + ".ListProvidersResponse\">\202\323\344\223\002/\022-/v1/{par" + + "ent=projects/*/locations/*}/providers\332A\006" + + "parent\022\301\001\n\024GetChannelConnection\0225.google" + + ".cloud.eventarc.v1.GetChannelConnectionR" + + "equest\032+.google.cloud.eventarc.v1.Channe" + + "lConnection\"E\202\323\344\223\0028\0226/v1/{name=projects/" + + "*/locations/*/channelConnections/*}\332A\004na" + + "me\022\324\001\n\026ListChannelConnections\0227.google.c" + + "loud.eventarc.v1.ListChannelConnectionsR" + + "equest\0328.google.cloud.eventarc.v1.ListCh" + + "annelConnectionsResponse\"G\202\323\344\223\0028\0226/v1/{p" + + "arent=projects/*/locations/*}/channelCon" + + "nections\332A\006parent\022\242\002\n\027CreateChannelConne" + + "ction\0228.google.cloud.eventarc.v1.CreateC" + + "hannelConnectionRequest\032\035.google.longrun" + + "ning.Operation\"\255\001\202\323\344\223\002L\"6/v1/{parent=pro" + + "jects/*/locations/*}/channelConnections:" + + "\022channel_connection\332A/parent,channel_con" + + "nection,channel_connection_id\312A&\n\021Channe" + + "lConnection\022\021OperationMetadata\022\342\001\n\027Delet" + + "eChannelConnection\0228.google.cloud.eventa" + + "rc.v1.DeleteChannelConnectionRequest\032\035.g" + + "oogle.longrunning.Operation\"n\202\323\344\223\0028*6/v1" + + "/{name=projects/*/locations/*/channelCon" + + "nections/*}\332A\004name\312A&\n\021ChannelConnection" + + "\022\021OperationMetadata\032K\312A\027eventarc.googlea" + + "pis.com\322A.https://www.googleapis.com/aut" + + "h/cloud-platformB\305\001\n\034com.google.cloud.ev" + + "entarc.v1B\rEventarcProtoP\001Z@google.golan" + + "g.org/genproto/googleapis/cloud/eventarc" + + "/v1;eventarc\252\002\030Google.Cloud.Eventarc.V1\312" + + "\002\030Google\\Cloud\\Eventarc\\V1\352\002\033Google::Clo" + + "ud::Eventarc::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -275,6 +305,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.cloud.eventarc.v1.ChannelProto.getDescriptor(), com.google.cloud.eventarc.v1.ChannelConnectionProto.getDescriptor(), + com.google.cloud.eventarc.v1.DiscoveryProto.getDescriptor(), com.google.cloud.eventarc.v1.TriggerProto.getDescriptor(), com.google.longrunning.OperationsProto.getDescriptor(), com.google.protobuf.FieldMaskProto.getDescriptor(), @@ -376,8 +407,32 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Name", "ValidateOnly", }); - internal_static_google_cloud_eventarc_v1_GetChannelConnectionRequest_descriptor = + internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor = getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_eventarc_v1_GetProviderRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_eventarc_v1_ListProvidersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "OrderBy", "Filter", + }); + internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_eventarc_v1_ListProvidersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor, + new java.lang.String[] { + "Providers", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_eventarc_v1_GetChannelConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_eventarc_v1_GetChannelConnectionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_GetChannelConnectionRequest_descriptor, @@ -385,7 +440,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_eventarc_v1_ListChannelConnectionsRequest_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_eventarc_v1_ListChannelConnectionsRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_ListChannelConnectionsRequest_descriptor, @@ -393,7 +448,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "PageSize", "PageToken", }); internal_static_google_cloud_eventarc_v1_ListChannelConnectionsResponse_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_eventarc_v1_ListChannelConnectionsResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_ListChannelConnectionsResponse_descriptor, @@ -401,7 +456,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ChannelConnections", "NextPageToken", "Unreachable", }); internal_static_google_cloud_eventarc_v1_CreateChannelConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_eventarc_v1_CreateChannelConnectionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_CreateChannelConnectionRequest_descriptor, @@ -409,7 +464,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "ChannelConnection", "ChannelConnectionId", }); internal_static_google_cloud_eventarc_v1_DeleteChannelConnectionRequest_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_eventarc_v1_DeleteChannelConnectionRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_DeleteChannelConnectionRequest_descriptor, @@ -417,7 +472,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", }); internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_eventarc_v1_OperationMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_eventarc_v1_OperationMetadata_descriptor, @@ -447,6 +502,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(); com.google.cloud.eventarc.v1.ChannelProto.getDescriptor(); com.google.cloud.eventarc.v1.ChannelConnectionProto.getDescriptor(); + com.google.cloud.eventarc.v1.DiscoveryProto.getDescriptor(); com.google.cloud.eventarc.v1.TriggerProto.getDescriptor(); com.google.longrunning.OperationsProto.getDescriptor(); com.google.protobuf.FieldMaskProto.getDescriptor(); diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttribute.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttribute.java new file mode 100644 index 00000000..4cf387cc --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttribute.java @@ -0,0 +1,1006 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * A representation of the FilteringAttribute resource.
+ * Filtering attributes are per event type.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.FilteringAttribute} + */ +public final class FilteringAttribute extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.FilteringAttribute) + FilteringAttributeOrBuilder { + private static final long serialVersionUID = 0L; + // Use FilteringAttribute.newBuilder() to construct. + private FilteringAttribute(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FilteringAttribute() { + attribute_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FilteringAttribute(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FilteringAttribute( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + attribute_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: + { + required_ = input.readBool(); + break; + } + case 32: + { + pathPatternSupported_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_FilteringAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_FilteringAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.FilteringAttribute.class, + com.google.cloud.eventarc.v1.FilteringAttribute.Builder.class); + } + + public static final int ATTRIBUTE_FIELD_NUMBER = 1; + private volatile java.lang.Object attribute_; + /** + * + * + *
+   * Output only. Attribute used for filtering the event type.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The attribute. + */ + @java.lang.Override + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Attribute used for filtering the event type.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for attribute. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. Description of the purpose of the attribute.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Description of the purpose of the attribute.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUIRED_FIELD_NUMBER = 3; + private boolean required_; + /** + * + * + *
+   * Output only. If true, the triggers for this provider should always specify a filter
+   * on these attributes. Trigger creation will fail otherwise.
+   * 
+ * + * bool required = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + + public static final int PATH_PATTERN_SUPPORTED_FIELD_NUMBER = 4; + private boolean pathPatternSupported_; + /** + * + * + *
+   * Output only. If true, the attribute accepts matching expressions in the Eventarc
+   * PathPattern format.
+   * 
+ * + * bool path_pattern_supported = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pathPatternSupported. + */ + @java.lang.Override + public boolean getPathPatternSupported() { + return pathPatternSupported_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (required_ != false) { + output.writeBool(3, required_); + } + if (pathPatternSupported_ != false) { + output.writeBool(4, pathPatternSupported_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(attribute_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, attribute_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (required_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, required_); + } + if (pathPatternSupported_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(4, pathPatternSupported_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.FilteringAttribute)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.FilteringAttribute other = + (com.google.cloud.eventarc.v1.FilteringAttribute) obj; + + if (!getAttribute().equals(other.getAttribute())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (getRequired() != other.getRequired()) return false; + if (getPathPatternSupported() != other.getPathPatternSupported()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ATTRIBUTE_FIELD_NUMBER; + hash = (53 * hash) + getAttribute().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getRequired()); + hash = (37 * hash) + PATH_PATTERN_SUPPORTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getPathPatternSupported()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.FilteringAttribute prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A representation of the FilteringAttribute resource.
+   * Filtering attributes are per event type.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.FilteringAttribute} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.FilteringAttribute) + com.google.cloud.eventarc.v1.FilteringAttributeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_FilteringAttribute_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_FilteringAttribute_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.FilteringAttribute.class, + com.google.cloud.eventarc.v1.FilteringAttribute.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.FilteringAttribute.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + attribute_ = ""; + + description_ = ""; + + required_ = false; + + pathPatternSupported_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_FilteringAttribute_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttribute getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.FilteringAttribute.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttribute build() { + com.google.cloud.eventarc.v1.FilteringAttribute result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttribute buildPartial() { + com.google.cloud.eventarc.v1.FilteringAttribute result = + new com.google.cloud.eventarc.v1.FilteringAttribute(this); + result.attribute_ = attribute_; + result.description_ = description_; + result.required_ = required_; + result.pathPatternSupported_ = pathPatternSupported_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.FilteringAttribute) { + return mergeFrom((com.google.cloud.eventarc.v1.FilteringAttribute) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.FilteringAttribute other) { + if (other == com.google.cloud.eventarc.v1.FilteringAttribute.getDefaultInstance()) + return this; + if (!other.getAttribute().isEmpty()) { + attribute_ = other.attribute_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getRequired() != false) { + setRequired(other.getRequired()); + } + if (other.getPathPatternSupported() != false) { + setPathPatternSupported(other.getPathPatternSupported()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.FilteringAttribute parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.eventarc.v1.FilteringAttribute) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object attribute_ = ""; + /** + * + * + *
+     * Output only. Attribute used for filtering the event type.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The attribute. + */ + public java.lang.String getAttribute() { + java.lang.Object ref = attribute_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + attribute_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Attribute used for filtering the event type.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for attribute. + */ + public com.google.protobuf.ByteString getAttributeBytes() { + java.lang.Object ref = attribute_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + attribute_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Attribute used for filtering the event type.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The attribute to set. + * @return This builder for chaining. + */ + public Builder setAttribute(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + attribute_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attribute used for filtering the event type.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAttribute() { + + attribute_ = getDefaultInstance().getAttribute(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Attribute used for filtering the event type.
+     * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for attribute to set. + * @return This builder for chaining. + */ + public Builder setAttributeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + attribute_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. Description of the purpose of the attribute.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Description of the purpose of the attribute.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Description of the purpose of the attribute.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the purpose of the attribute.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Description of the purpose of the attribute.
+     * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private boolean required_; + /** + * + * + *
+     * Output only. If true, the triggers for this provider should always specify a filter
+     * on these attributes. Trigger creation will fail otherwise.
+     * 
+ * + * bool required = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The required. + */ + @java.lang.Override + public boolean getRequired() { + return required_; + } + /** + * + * + *
+     * Output only. If true, the triggers for this provider should always specify a filter
+     * on these attributes. Trigger creation will fail otherwise.
+     * 
+ * + * bool required = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The required to set. + * @return This builder for chaining. + */ + public Builder setRequired(boolean value) { + + required_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If true, the triggers for this provider should always specify a filter
+     * on these attributes. Trigger creation will fail otherwise.
+     * 
+ * + * bool required = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearRequired() { + + required_ = false; + onChanged(); + return this; + } + + private boolean pathPatternSupported_; + /** + * + * + *
+     * Output only. If true, the attribute accepts matching expressions in the Eventarc
+     * PathPattern format.
+     * 
+ * + * bool path_pattern_supported = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pathPatternSupported. + */ + @java.lang.Override + public boolean getPathPatternSupported() { + return pathPatternSupported_; + } + /** + * + * + *
+     * Output only. If true, the attribute accepts matching expressions in the Eventarc
+     * PathPattern format.
+     * 
+ * + * bool path_pattern_supported = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pathPatternSupported to set. + * @return This builder for chaining. + */ + public Builder setPathPatternSupported(boolean value) { + + pathPatternSupported_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If true, the attribute accepts matching expressions in the Eventarc
+     * PathPattern format.
+     * 
+ * + * bool path_pattern_supported = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPathPatternSupported() { + + pathPatternSupported_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.FilteringAttribute) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.FilteringAttribute) + private static final com.google.cloud.eventarc.v1.FilteringAttribute DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.FilteringAttribute(); + } + + public static com.google.cloud.eventarc.v1.FilteringAttribute getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FilteringAttribute parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FilteringAttribute(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.FilteringAttribute getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttributeOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttributeOrBuilder.java new file mode 100644 index 00000000..4de607b4 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/FilteringAttributeOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +public interface FilteringAttributeOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.FilteringAttribute) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Attribute used for filtering the event type.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The attribute. + */ + java.lang.String getAttribute(); + /** + * + * + *
+   * Output only. Attribute used for filtering the event type.
+   * 
+ * + * string attribute = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for attribute. + */ + com.google.protobuf.ByteString getAttributeBytes(); + + /** + * + * + *
+   * Output only. Description of the purpose of the attribute.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. Description of the purpose of the attribute.
+   * 
+ * + * string description = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. If true, the triggers for this provider should always specify a filter
+   * on these attributes. Trigger creation will fail otherwise.
+   * 
+ * + * bool required = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The required. + */ + boolean getRequired(); + + /** + * + * + *
+   * Output only. If true, the attribute accepts matching expressions in the Eventarc
+   * PathPattern format.
+   * 
+ * + * bool path_pattern_supported = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pathPatternSupported. + */ + boolean getPathPatternSupported(); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequest.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequest.java new file mode 100644 index 00000000..9cfd320f --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * The request message for the GetProvider method.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GetProviderRequest} + */ +public final class GetProviderRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.GetProviderRequest) + GetProviderRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetProviderRequest.newBuilder() to construct. + private GetProviderRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetProviderRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetProviderRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetProviderRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetProviderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GetProviderRequest.class, + com.google.cloud.eventarc.v1.GetProviderRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the provider to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the provider to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.GetProviderRequest)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.GetProviderRequest other = + (com.google.cloud.eventarc.v1.GetProviderRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.GetProviderRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for the GetProvider method.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.GetProviderRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.GetProviderRequest) + com.google.cloud.eventarc.v1.GetProviderRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetProviderRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.GetProviderRequest.class, + com.google.cloud.eventarc.v1.GetProviderRequest.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.GetProviderRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_GetProviderRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetProviderRequest getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.GetProviderRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetProviderRequest build() { + com.google.cloud.eventarc.v1.GetProviderRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetProviderRequest buildPartial() { + com.google.cloud.eventarc.v1.GetProviderRequest result = + new com.google.cloud.eventarc.v1.GetProviderRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.GetProviderRequest) { + return mergeFrom((com.google.cloud.eventarc.v1.GetProviderRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.GetProviderRequest other) { + if (other == com.google.cloud.eventarc.v1.GetProviderRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.GetProviderRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.eventarc.v1.GetProviderRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the provider to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the provider to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the provider to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the provider to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the provider to get.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.GetProviderRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.GetProviderRequest) + private static final com.google.cloud.eventarc.v1.GetProviderRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.GetProviderRequest(); + } + + public static com.google.cloud.eventarc.v1.GetProviderRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetProviderRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetProviderRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.GetProviderRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequestOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequestOrBuilder.java new file mode 100644 index 00000000..c5079d47 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/GetProviderRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +public interface GetProviderRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.GetProviderRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the provider to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the provider to get.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequest.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequest.java new file mode 100644 index 00000000..da8b4ef4 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequest.java @@ -0,0 +1,1321 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * The request message for the ListProviders method.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.ListProvidersRequest} + */ +public final class ListProvidersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.ListProvidersRequest) + ListProvidersRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProvidersRequest.newBuilder() to construct. + private ListProvidersRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProvidersRequest() { + parent_ = ""; + pageToken_ = ""; + orderBy_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProvidersRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProvidersRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + orderBy_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.ListProvidersRequest.class, + com.google.cloud.eventarc.v1.ListProvidersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent of the provider to get.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent of the provider to get.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of providers to return on each page.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The page token; provide the value from the `next_page_token` field in a
+   * previous `ListProviders` call to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListProviders` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The page token; provide the value from the `next_page_token` field in a
+   * previous `ListProviders` call to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListProviders` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 4; + private volatile java.lang.Object orderBy_; + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a
+   * comma-separated list of fields. The default sorting oder is ascending. To
+   * specify descending order for a field, append a `desc` suffix; for example:
+   * `name desc, _id`.
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a
+   * comma-separated list of fields. The default sorting oder is ascending. To
+   * specify descending order for a field, append a `desc` suffix; for example:
+   * `name desc, _id`.
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter field that the list request will filter on.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter field that the list request will filter on.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, orderBy_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.ListProvidersRequest)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.ListProvidersRequest other = + (com.google.cloud.eventarc.v1.ListProvidersRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.ListProvidersRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message for the ListProviders method.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.ListProvidersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.ListProvidersRequest) + com.google.cloud.eventarc.v1.ListProvidersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.ListProvidersRequest.class, + com.google.cloud.eventarc.v1.ListProvidersRequest.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.ListProvidersRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + orderBy_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersRequest getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.ListProvidersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersRequest build() { + com.google.cloud.eventarc.v1.ListProvidersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersRequest buildPartial() { + com.google.cloud.eventarc.v1.ListProvidersRequest result = + new com.google.cloud.eventarc.v1.ListProvidersRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.orderBy_ = orderBy_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.ListProvidersRequest) { + return mergeFrom((com.google.cloud.eventarc.v1.ListProvidersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.ListProvidersRequest other) { + if (other == com.google.cloud.eventarc.v1.ListProvidersRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.ListProvidersRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.eventarc.v1.ListProvidersRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent of the provider to get.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent of the provider to get.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent of the provider to get.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent of the provider to get.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent of the provider to get.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of providers to return on each page.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of providers to return on each page.
+     * 
+ * + * int32 page_size = 2; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of providers to return on each page.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The page token; provide the value from the `next_page_token` field in a
+     * previous `ListProviders` call to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListProviders` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The page token; provide the value from the `next_page_token` field in a
+     * previous `ListProviders` call to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListProviders` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The page token; provide the value from the `next_page_token` field in a
+     * previous `ListProviders` call to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListProviders` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The page token; provide the value from the `next_page_token` field in a
+     * previous `ListProviders` call to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListProviders` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The page token; provide the value from the `next_page_token` field in a
+     * previous `ListProviders` call to retrieve the subsequent page.
+     * When paginating, all other parameters provided to `ListProviders` must
+     * match the call that provided the page token.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a
+     * comma-separated list of fields. The default sorting oder is ascending. To
+     * specify descending order for a field, append a `desc` suffix; for example:
+     * `name desc, _id`.
+     * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a
+     * comma-separated list of fields. The default sorting oder is ascending. To
+     * specify descending order for a field, append a `desc` suffix; for example:
+     * `name desc, _id`.
+     * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a
+     * comma-separated list of fields. The default sorting oder is ascending. To
+     * specify descending order for a field, append a `desc` suffix; for example:
+     * `name desc, _id`.
+     * 
+ * + * string order_by = 4; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + orderBy_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a
+     * comma-separated list of fields. The default sorting oder is ascending. To
+     * specify descending order for a field, append a `desc` suffix; for example:
+     * `name desc, _id`.
+     * 
+ * + * string order_by = 4; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + + orderBy_ = getDefaultInstance().getOrderBy(); + onChanged(); + return this; + } + /** + * + * + *
+     * The sorting order of the resources returned. Value should be a
+     * comma-separated list of fields. The default sorting oder is ascending. To
+     * specify descending order for a field, append a `desc` suffix; for example:
+     * `name desc, _id`.
+     * 
+ * + * string order_by = 4; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + orderBy_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter field that the list request will filter on.
+     * 
+ * + * string filter = 5; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter field that the list request will filter on.
+     * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter field that the list request will filter on.
+     * 
+ * + * string filter = 5; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter field that the list request will filter on.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter field that the list request will filter on.
+     * 
+ * + * string filter = 5; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.ListProvidersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.ListProvidersRequest) + private static final com.google.cloud.eventarc.v1.ListProvidersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.ListProvidersRequest(); + } + + public static com.google.cloud.eventarc.v1.ListProvidersRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProvidersRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProvidersRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequestOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequestOrBuilder.java new file mode 100644 index 00000000..b385857b --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersRequestOrBuilder.java @@ -0,0 +1,154 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +public interface ListProvidersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.ListProvidersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent of the provider to get.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent of the provider to get.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of providers to return on each page.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The page token; provide the value from the `next_page_token` field in a
+   * previous `ListProviders` call to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListProviders` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The page token; provide the value from the `next_page_token` field in a
+   * previous `ListProviders` call to retrieve the subsequent page.
+   * When paginating, all other parameters provided to `ListProviders` must
+   * match the call that provided the page token.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a
+   * comma-separated list of fields. The default sorting oder is ascending. To
+   * specify descending order for a field, append a `desc` suffix; for example:
+   * `name desc, _id`.
+   * 
+ * + * string order_by = 4; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * The sorting order of the resources returned. Value should be a
+   * comma-separated list of fields. The default sorting oder is ascending. To
+   * specify descending order for a field, append a `desc` suffix; for example:
+   * `name desc, _id`.
+   * 
+ * + * string order_by = 4; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); + + /** + * + * + *
+   * The filter field that the list request will filter on.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter field that the list request will filter on.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java new file mode 100644 index 00000000..f083e7c4 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponse.java @@ -0,0 +1,1412 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * The response message for the `ListProviders` method.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.ListProvidersResponse} + */ +public final class ListProvidersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.ListProvidersResponse) + ListProvidersResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListProvidersResponse.newBuilder() to construct. + private ListProvidersResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListProvidersResponse() { + providers_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListProvidersResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListProvidersResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + providers_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + providers_.add( + input.readMessage( + com.google.cloud.eventarc.v1.Provider.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + unreachable_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + providers_ = java.util.Collections.unmodifiableList(providers_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.ListProvidersResponse.class, + com.google.cloud.eventarc.v1.ListProvidersResponse.Builder.class); + } + + public static final int PROVIDERS_FIELD_NUMBER = 1; + private java.util.List providers_; + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + @java.lang.Override + public java.util.List getProvidersList() { + return providers_; + } + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + @java.lang.Override + public java.util.List + getProvidersOrBuilderList() { + return providers_; + } + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + @java.lang.Override + public int getProvidersCount() { + return providers_.size(); + } + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.Provider getProviders(int index) { + return providers_.get(index); + } + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.ProviderOrBuilder getProvidersOrBuilder(int index) { + return providers_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * A page token that can be sent to ListProviders to request the next page.
+   * If this is empty, then there are no more pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A page token that can be sent to ListProviders to request the next page.
+   * If this is empty, then there are no more pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int UNREACHABLE_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList unreachable_; + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_; + } + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < providers_.size(); i++) { + output.writeMessage(1, providers_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < providers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, providers_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.ListProvidersResponse)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.ListProvidersResponse other = + (com.google.cloud.eventarc.v1.ListProvidersResponse) obj; + + if (!getProvidersList().equals(other.getProvidersList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getProvidersCount() > 0) { + hash = (37 * hash) + PROVIDERS_FIELD_NUMBER; + hash = (53 * hash) + getProvidersList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.ListProvidersResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The response message for the `ListProviders` method.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.ListProvidersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.ListProvidersResponse) + com.google.cloud.eventarc.v1.ListProvidersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.ListProvidersResponse.class, + com.google.cloud.eventarc.v1.ListProvidersResponse.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.ListProvidersResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getProvidersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (providersBuilder_ == null) { + providers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + providersBuilder_.clear(); + } + nextPageToken_ = ""; + + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.EventarcProto + .internal_static_google_cloud_eventarc_v1_ListProvidersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersResponse getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.ListProvidersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersResponse build() { + com.google.cloud.eventarc.v1.ListProvidersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersResponse buildPartial() { + com.google.cloud.eventarc.v1.ListProvidersResponse result = + new com.google.cloud.eventarc.v1.ListProvidersResponse(this); + int from_bitField0_ = bitField0_; + if (providersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + providers_ = java.util.Collections.unmodifiableList(providers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.providers_ = providers_; + } else { + result.providers_ = providersBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + if (((bitField0_ & 0x00000002) != 0)) { + unreachable_ = unreachable_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.unreachable_ = unreachable_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.ListProvidersResponse) { + return mergeFrom((com.google.cloud.eventarc.v1.ListProvidersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.ListProvidersResponse other) { + if (other == com.google.cloud.eventarc.v1.ListProvidersResponse.getDefaultInstance()) + return this; + if (providersBuilder_ == null) { + if (!other.providers_.isEmpty()) { + if (providers_.isEmpty()) { + providers_ = other.providers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureProvidersIsMutable(); + providers_.addAll(other.providers_); + } + onChanged(); + } + } else { + if (!other.providers_.isEmpty()) { + if (providersBuilder_.isEmpty()) { + providersBuilder_.dispose(); + providersBuilder_ = null; + providers_ = other.providers_; + bitField0_ = (bitField0_ & ~0x00000001); + providersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getProvidersFieldBuilder() + : null; + } else { + providersBuilder_.addAllMessages(other.providers_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureUnreachableIsMutable(); + unreachable_.addAll(other.unreachable_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.ListProvidersResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.eventarc.v1.ListProvidersResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List providers_ = + java.util.Collections.emptyList(); + + private void ensureProvidersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + providers_ = new java.util.ArrayList(providers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.Provider, + com.google.cloud.eventarc.v1.Provider.Builder, + com.google.cloud.eventarc.v1.ProviderOrBuilder> + providersBuilder_; + + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public java.util.List getProvidersList() { + if (providersBuilder_ == null) { + return java.util.Collections.unmodifiableList(providers_); + } else { + return providersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public int getProvidersCount() { + if (providersBuilder_ == null) { + return providers_.size(); + } else { + return providersBuilder_.getCount(); + } + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public com.google.cloud.eventarc.v1.Provider getProviders(int index) { + if (providersBuilder_ == null) { + return providers_.get(index); + } else { + return providersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder setProviders(int index, com.google.cloud.eventarc.v1.Provider value) { + if (providersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProvidersIsMutable(); + providers_.set(index, value); + onChanged(); + } else { + providersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder setProviders( + int index, com.google.cloud.eventarc.v1.Provider.Builder builderForValue) { + if (providersBuilder_ == null) { + ensureProvidersIsMutable(); + providers_.set(index, builderForValue.build()); + onChanged(); + } else { + providersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder addProviders(com.google.cloud.eventarc.v1.Provider value) { + if (providersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProvidersIsMutable(); + providers_.add(value); + onChanged(); + } else { + providersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder addProviders(int index, com.google.cloud.eventarc.v1.Provider value) { + if (providersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureProvidersIsMutable(); + providers_.add(index, value); + onChanged(); + } else { + providersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder addProviders(com.google.cloud.eventarc.v1.Provider.Builder builderForValue) { + if (providersBuilder_ == null) { + ensureProvidersIsMutable(); + providers_.add(builderForValue.build()); + onChanged(); + } else { + providersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder addProviders( + int index, com.google.cloud.eventarc.v1.Provider.Builder builderForValue) { + if (providersBuilder_ == null) { + ensureProvidersIsMutable(); + providers_.add(index, builderForValue.build()); + onChanged(); + } else { + providersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder addAllProviders( + java.lang.Iterable values) { + if (providersBuilder_ == null) { + ensureProvidersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, providers_); + onChanged(); + } else { + providersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder clearProviders() { + if (providersBuilder_ == null) { + providers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + providersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public Builder removeProviders(int index) { + if (providersBuilder_ == null) { + ensureProvidersIsMutable(); + providers_.remove(index); + onChanged(); + } else { + providersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public com.google.cloud.eventarc.v1.Provider.Builder getProvidersBuilder(int index) { + return getProvidersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public com.google.cloud.eventarc.v1.ProviderOrBuilder getProvidersOrBuilder(int index) { + if (providersBuilder_ == null) { + return providers_.get(index); + } else { + return providersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public java.util.List + getProvidersOrBuilderList() { + if (providersBuilder_ != null) { + return providersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(providers_); + } + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public com.google.cloud.eventarc.v1.Provider.Builder addProvidersBuilder() { + return getProvidersFieldBuilder() + .addBuilder(com.google.cloud.eventarc.v1.Provider.getDefaultInstance()); + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public com.google.cloud.eventarc.v1.Provider.Builder addProvidersBuilder(int index) { + return getProvidersFieldBuilder() + .addBuilder(index, com.google.cloud.eventarc.v1.Provider.getDefaultInstance()); + } + /** + * + * + *
+     * The requested providers, up to the number specified in `page_size`.
+     * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + public java.util.List getProvidersBuilderList() { + return getProvidersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.Provider, + com.google.cloud.eventarc.v1.Provider.Builder, + com.google.cloud.eventarc.v1.ProviderOrBuilder> + getProvidersFieldBuilder() { + if (providersBuilder_ == null) { + providersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.Provider, + com.google.cloud.eventarc.v1.Provider.Builder, + com.google.cloud.eventarc.v1.ProviderOrBuilder>( + providers_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + providers_ = null; + } + return providersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A page token that can be sent to ListProviders to request the next page.
+     * If this is empty, then there are no more pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A page token that can be sent to ListProviders to request the next page.
+     * If this is empty, then there are no more pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A page token that can be sent to ListProviders to request the next page.
+     * If this is empty, then there are no more pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that can be sent to ListProviders to request the next page.
+     * If this is empty, then there are no more pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A page token that can be sent to ListProviders to request the next page.
+     * If this is empty, then there are no more pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList unreachable_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUnreachableIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + unreachable_ = new com.google.protobuf.LazyStringArrayList(unreachable_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + public com.google.protobuf.ProtocolStringList getUnreachableList() { + return unreachable_.getUnmodifiableView(); + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + public int getUnreachableCount() { + return unreachable_.size(); + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + public java.lang.String getUnreachable(int index) { + return unreachable_.get(index); + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + public com.google.protobuf.ByteString getUnreachableBytes(int index) { + return unreachable_.getByteString(index); + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param index The index to set the value at. + * @param value The unreachable to set. + * @return This builder for chaining. + */ + public Builder setUnreachable(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param values The unreachable to add. + * @return This builder for chaining. + */ + public Builder addAllUnreachable(java.lang.Iterable values) { + ensureUnreachableIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, unreachable_); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @return This builder for chaining. + */ + public Builder clearUnreachable() { + unreachable_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Unreachable resources, if any.
+     * 
+ * + * repeated string unreachable = 3; + * + * @param value The bytes of the unreachable to add. + * @return This builder for chaining. + */ + public Builder addUnreachableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUnreachableIsMutable(); + unreachable_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.ListProvidersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.ListProvidersResponse) + private static final com.google.cloud.eventarc.v1.ListProvidersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.ListProvidersResponse(); + } + + public static com.google.cloud.eventarc.v1.ListProvidersResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListProvidersResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListProvidersResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.ListProvidersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java new file mode 100644 index 00000000..5635e77c --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ListProvidersResponseOrBuilder.java @@ -0,0 +1,155 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/eventarc.proto + +package com.google.cloud.eventarc.v1; + +public interface ListProvidersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.ListProvidersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + java.util.List getProvidersList(); + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + com.google.cloud.eventarc.v1.Provider getProviders(int index); + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + int getProvidersCount(); + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + java.util.List + getProvidersOrBuilderList(); + /** + * + * + *
+   * The requested providers, up to the number specified in `page_size`.
+   * 
+ * + * repeated .google.cloud.eventarc.v1.Provider providers = 1; + */ + com.google.cloud.eventarc.v1.ProviderOrBuilder getProvidersOrBuilder(int index); + + /** + * + * + *
+   * A page token that can be sent to ListProviders to request the next page.
+   * If this is empty, then there are no more pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A page token that can be sent to ListProviders to request the next page.
+   * If this is empty, then there are no more pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return A list containing the unreachable. + */ + java.util.List getUnreachableList(); + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @return The count of unreachable. + */ + int getUnreachableCount(); + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the element to return. + * @return The unreachable at the given index. + */ + java.lang.String getUnreachable(int index); + /** + * + * + *
+   * Unreachable resources, if any.
+   * 
+ * + * repeated string unreachable = 3; + * + * @param index The index of the value to return. + * @return The bytes of the unreachable at the given index. + */ + com.google.protobuf.ByteString getUnreachableBytes(int index); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Provider.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Provider.java new file mode 100644 index 00000000..d0b26dd8 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/Provider.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +/** + * + * + *
+ * A representation of the Provider resource.
+ * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.Provider} + */ +public final class Provider extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.eventarc.v1.Provider) + ProviderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Provider.newBuilder() to construct. + private Provider(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Provider() { + name_ = ""; + displayName_ = ""; + eventTypes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Provider(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Provider( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + eventTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + eventTypes_.add( + input.readMessage( + com.google.cloud.eventarc.v1.EventType.parser(), extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + eventTypes_ = java.util.Collections.unmodifiableList(eventTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_Provider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_Provider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.Provider.class, + com.google.cloud.eventarc.v1.Provider.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+   * format.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+   * format.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_TYPES_FIELD_NUMBER = 3; + private java.util.List eventTypes_; + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getEventTypesList() { + return eventTypes_; + } + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getEventTypesOrBuilderList() { + return eventTypes_; + } + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getEventTypesCount() { + return eventTypes_.size(); + } + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.EventType getEventTypes(int index) { + return eventTypes_.get(index); + } + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.eventarc.v1.EventTypeOrBuilder getEventTypesOrBuilder(int index) { + return eventTypes_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + for (int i = 0; i < eventTypes_.size(); i++) { + output.writeMessage(3, eventTypes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (int i = 0; i < eventTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, eventTypes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.eventarc.v1.Provider)) { + return super.equals(obj); + } + com.google.cloud.eventarc.v1.Provider other = (com.google.cloud.eventarc.v1.Provider) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getEventTypesList().equals(other.getEventTypesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (getEventTypesCount() > 0) { + hash = (37 * hash) + EVENT_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getEventTypesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.Provider parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.Provider parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.eventarc.v1.Provider parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.eventarc.v1.Provider prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A representation of the Provider resource.
+   * 
+ * + * Protobuf type {@code google.cloud.eventarc.v1.Provider} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.eventarc.v1.Provider) + com.google.cloud.eventarc.v1.ProviderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_Provider_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_Provider_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.eventarc.v1.Provider.class, + com.google.cloud.eventarc.v1.Provider.Builder.class); + } + + // Construct using com.google.cloud.eventarc.v1.Provider.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEventTypesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + if (eventTypesBuilder_ == null) { + eventTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + eventTypesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.eventarc.v1.DiscoveryProto + .internal_static_google_cloud_eventarc_v1_Provider_descriptor; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.Provider getDefaultInstanceForType() { + return com.google.cloud.eventarc.v1.Provider.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.Provider build() { + com.google.cloud.eventarc.v1.Provider result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.Provider buildPartial() { + com.google.cloud.eventarc.v1.Provider result = + new com.google.cloud.eventarc.v1.Provider(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + if (eventTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + eventTypes_ = java.util.Collections.unmodifiableList(eventTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.eventTypes_ = eventTypes_; + } else { + result.eventTypes_ = eventTypesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.eventarc.v1.Provider) { + return mergeFrom((com.google.cloud.eventarc.v1.Provider) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.eventarc.v1.Provider other) { + if (other == com.google.cloud.eventarc.v1.Provider.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (eventTypesBuilder_ == null) { + if (!other.eventTypes_.isEmpty()) { + if (eventTypes_.isEmpty()) { + eventTypes_ = other.eventTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEventTypesIsMutable(); + eventTypes_.addAll(other.eventTypes_); + } + onChanged(); + } + } else { + if (!other.eventTypes_.isEmpty()) { + if (eventTypesBuilder_.isEmpty()) { + eventTypesBuilder_.dispose(); + eventTypesBuilder_ = null; + eventTypes_ = other.eventTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + eventTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEventTypesFieldBuilder() + : null; + } else { + eventTypesBuilder_.addAllMessages(other.eventTypes_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.eventarc.v1.Provider parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.eventarc.v1.Provider) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+     * format.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+     * format.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+     * format.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+     * format.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+     * format.
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+     * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.util.List eventTypes_ = + java.util.Collections.emptyList(); + + private void ensureEventTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + eventTypes_ = new java.util.ArrayList(eventTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.EventType, + com.google.cloud.eventarc.v1.EventType.Builder, + com.google.cloud.eventarc.v1.EventTypeOrBuilder> + eventTypesBuilder_; + + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEventTypesList() { + if (eventTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(eventTypes_); + } else { + return eventTypesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEventTypesCount() { + if (eventTypesBuilder_ == null) { + return eventTypes_.size(); + } else { + return eventTypesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.EventType getEventTypes(int index) { + if (eventTypesBuilder_ == null) { + return eventTypes_.get(index); + } else { + return eventTypesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEventTypes(int index, com.google.cloud.eventarc.v1.EventType value) { + if (eventTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventTypesIsMutable(); + eventTypes_.set(index, value); + onChanged(); + } else { + eventTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEventTypes( + int index, com.google.cloud.eventarc.v1.EventType.Builder builderForValue) { + if (eventTypesBuilder_ == null) { + ensureEventTypesIsMutable(); + eventTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + eventTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventTypes(com.google.cloud.eventarc.v1.EventType value) { + if (eventTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventTypesIsMutable(); + eventTypes_.add(value); + onChanged(); + } else { + eventTypesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventTypes(int index, com.google.cloud.eventarc.v1.EventType value) { + if (eventTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEventTypesIsMutable(); + eventTypes_.add(index, value); + onChanged(); + } else { + eventTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventTypes(com.google.cloud.eventarc.v1.EventType.Builder builderForValue) { + if (eventTypesBuilder_ == null) { + ensureEventTypesIsMutable(); + eventTypes_.add(builderForValue.build()); + onChanged(); + } else { + eventTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEventTypes( + int index, com.google.cloud.eventarc.v1.EventType.Builder builderForValue) { + if (eventTypesBuilder_ == null) { + ensureEventTypesIsMutable(); + eventTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + eventTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEventTypes( + java.lang.Iterable values) { + if (eventTypesBuilder_ == null) { + ensureEventTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, eventTypes_); + onChanged(); + } else { + eventTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEventTypes() { + if (eventTypesBuilder_ == null) { + eventTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + eventTypesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEventTypes(int index) { + if (eventTypesBuilder_ == null) { + ensureEventTypesIsMutable(); + eventTypes_.remove(index); + onChanged(); + } else { + eventTypesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.EventType.Builder getEventTypesBuilder(int index) { + return getEventTypesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.EventTypeOrBuilder getEventTypesOrBuilder(int index) { + if (eventTypesBuilder_ == null) { + return eventTypes_.get(index); + } else { + return eventTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEventTypesOrBuilderList() { + if (eventTypesBuilder_ != null) { + return eventTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(eventTypes_); + } + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.EventType.Builder addEventTypesBuilder() { + return getEventTypesFieldBuilder() + .addBuilder(com.google.cloud.eventarc.v1.EventType.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.eventarc.v1.EventType.Builder addEventTypesBuilder(int index) { + return getEventTypesFieldBuilder() + .addBuilder(index, com.google.cloud.eventarc.v1.EventType.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Event types for this provider.
+     * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEventTypesBuilderList() { + return getEventTypesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.EventType, + com.google.cloud.eventarc.v1.EventType.Builder, + com.google.cloud.eventarc.v1.EventTypeOrBuilder> + getEventTypesFieldBuilder() { + if (eventTypesBuilder_ == null) { + eventTypesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.eventarc.v1.EventType, + com.google.cloud.eventarc.v1.EventType.Builder, + com.google.cloud.eventarc.v1.EventTypeOrBuilder>( + eventTypes_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + eventTypes_ = null; + } + return eventTypesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.eventarc.v1.Provider) + } + + // @@protoc_insertion_point(class_scope:google.cloud.eventarc.v1.Provider) + private static final com.google.cloud.eventarc.v1.Provider DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.eventarc.v1.Provider(); + } + + public static com.google.cloud.eventarc.v1.Provider getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Provider parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Provider(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.eventarc.v1.Provider getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderName.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderName.java new file mode 100644 index 00000000..fe9daf1a --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class ProviderName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PROVIDER = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/providers/{provider}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String provider; + + @Deprecated + protected ProviderName() { + project = null; + location = null; + provider = null; + } + + private ProviderName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + provider = Preconditions.checkNotNull(builder.getProvider()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProvider() { + return provider; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ProviderName of(String project, String location, String provider) { + return newBuilder().setProject(project).setLocation(location).setProvider(provider).build(); + } + + public static String format(String project, String location, String provider) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setProvider(provider) + .build() + .toString(); + } + + public static ProviderName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PROVIDER.validatedMatch( + formattedString, "ProviderName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("provider")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ProviderName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PROVIDER.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (provider != null) { + fieldMapBuilder.put("provider", provider); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PROVIDER.instantiate( + "project", project, "location", location, "provider", provider); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ProviderName that = ((ProviderName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.provider, that.provider); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(provider); + return h; + } + + /** Builder for projects/{project}/locations/{location}/providers/{provider}. */ + public static class Builder { + private String project; + private String location; + private String provider; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getProvider() { + return provider; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setProvider(String provider) { + this.provider = provider; + return this; + } + + private Builder(ProviderName providerName) { + this.project = providerName.project; + this.location = providerName.location; + this.provider = providerName.provider; + } + + public ProviderName build() { + return new ProviderName(this); + } + } +} diff --git a/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderOrBuilder.java b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderOrBuilder.java new file mode 100644 index 00000000..5a9200c1 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/java/com/google/cloud/eventarc/v1/ProviderOrBuilder.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/eventarc/v1/discovery.proto + +package com.google.cloud.eventarc.v1; + +public interface ProviderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.eventarc.v1.Provider) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+   * format.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. In `projects/{project}/locations/{location}/providers/{provider_id}`
+   * format.
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Output only. Human friendly name for the Provider. For example "Cloud Storage".
+   * 
+ * + * string display_name = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEventTypesList(); + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.eventarc.v1.EventType getEventTypes(int index); + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEventTypesCount(); + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEventTypesOrBuilderList(); + /** + * + * + *
+   * Output only. Event types for this provider.
+   * 
+ * + * + * repeated .google.cloud.eventarc.v1.EventType event_types = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.eventarc.v1.EventTypeOrBuilder getEventTypesOrBuilder(int index); +} diff --git a/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/discovery.proto b/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/discovery.proto new file mode 100644 index 00000000..44633de8 --- /dev/null +++ b/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/discovery.proto @@ -0,0 +1,86 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.eventarc.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/eventarc/v1;eventarc"; +option java_multiple_files = true; +option java_outer_classname = "DiscoveryProto"; +option java_package = "com.google.cloud.eventarc.v1"; + +// A representation of the Provider resource. +message Provider { + option (google.api.resource) = { + type: "eventarc.googleapis.com/Provider" + pattern: "projects/{project}/locations/{location}/providers/{provider}" + plural: "providers" + singular: "provider" + }; + + // Output only. In `projects/{project}/locations/{location}/providers/{provider_id}` + // format. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human friendly name for the Provider. For example "Cloud Storage". + string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Event types for this provider. + repeated EventType event_types = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A representation of the event type resource. +message EventType { + // Output only. The full name of the event type (for example, + // "google.cloud.storage.object.v1.finalized"). In the form of + // {provider-specific-prefix}.{resource}.{version}.{verb}. Types MUST be + // versioned and event schemas are guaranteed to remain backward compatible + // within one version. Note that event type versions and API versions do not + // need to match. + string type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human friendly description of what the event type is about. + // For example "Bucket created in Cloud Storage". + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Filtering attributes for the event type. + repeated FilteringAttribute filtering_attributes = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. URI for the event schema. + // For example + // "https://github.com/googleapis/google-cloudevents/blob/master/proto/google/events/cloud/storage/v1/events.proto" + string event_schema_uri = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A representation of the FilteringAttribute resource. +// Filtering attributes are per event type. +message FilteringAttribute { + // Output only. Attribute used for filtering the event type. + string attribute = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Description of the purpose of the attribute. + string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, the triggers for this provider should always specify a filter + // on these attributes. Trigger creation will fail otherwise. + bool required = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, the attribute accepts matching expressions in the Eventarc + // PathPattern format. + bool path_pattern_supported = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto b/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto index 41aa8483..69310678 100644 --- a/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto +++ b/proto-google-cloud-eventarc-v1/src/main/proto/google/cloud/eventarc/v1/eventarc.proto @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/eventarc/v1/channel.proto"; import "google/cloud/eventarc/v1/channel_connection.proto"; +import "google/cloud/eventarc/v1/discovery.proto"; import "google/cloud/eventarc/v1/trigger.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; @@ -149,6 +150,22 @@ service Eventarc { }; } + // Get a single Provider. + rpc GetProvider(GetProviderRequest) returns (Provider) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/providers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List providers. + rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/providers" + }; + option (google.api.method_signature) = "parent"; + } + // Get a single ChannelConnection. rpc GetChannelConnection(GetChannelConnectionRequest) returns (ChannelConnection) { option (google.api.http) = { @@ -409,6 +426,60 @@ message DeleteChannelRequest { bool validate_only = 2 [(google.api.field_behavior) = REQUIRED]; } +// The request message for the GetProvider method. +message GetProviderRequest { + // Required. The name of the provider to get. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "eventarc.googleapis.com/Provider" + } + ]; +} + +// The request message for the ListProviders method. +message ListProvidersRequest { + // Required. The parent of the provider to get. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "eventarc.googleapis.com/Provider" + } + ]; + + // The maximum number of providers to return on each page. + int32 page_size = 2; + + // The page token; provide the value from the `next_page_token` field in a + // previous `ListProviders` call to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListProviders` must + // match the call that provided the page token. + string page_token = 3; + + // The sorting order of the resources returned. Value should be a + // comma-separated list of fields. The default sorting oder is ascending. To + // specify descending order for a field, append a `desc` suffix; for example: + // `name desc, _id`. + string order_by = 4; + + // The filter field that the list request will filter on. + string filter = 5; +} + +// The response message for the `ListProviders` method. +message ListProvidersResponse { + // The requested providers, up to the number specified in `page_size`. + repeated Provider providers = 1; + + // A page token that can be sent to ListProviders to request the next page. + // If this is empty, then there are no more pages. + string next_page_token = 2; + + // Unreachable resources, if any. + repeated string unreachable = 3; +} + // The request message for the GetChannelConnection method. message GetChannelConnectionRequest { // Required. The name of the channel connection to get. diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 00000000..12ac41b0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.EventarcSettings; +import com.google.cloud.eventarc.v1.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + EventarcSettings eventarcSettings = + EventarcSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + EventarcClient eventarcClient = EventarcClient.create(eventarcSettings); + } +} +// [END eventarc_v1_generated_eventarcclient_create_setcredentialsprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider1.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 00000000..f8c3608b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_create_setcredentialsprovider1_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.EventarcSettings; + +public class SyncCreateSetCredentialsProvider1 { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider1(); + } + + public static void syncCreateSetCredentialsProvider1() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + EventarcSettings eventarcSettings = + EventarcSettings.newBuilder() + .setTransportChannelProvider( + EventarcSettings.defaultHttpJsonTransportProviderBuilder().build()) + .build(); + EventarcClient eventarcClient = EventarcClient.create(eventarcSettings); + } +} +// [END eventarc_v1_generated_eventarcclient_create_setcredentialsprovider1_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetEndpoint.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetEndpoint.java new file mode 100644 index 00000000..ed9e2272 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/create/SyncCreateSetEndpoint.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_create_setendpoint_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.EventarcSettings; +import com.google.cloud.eventarc.v1.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + EventarcSettings eventarcSettings = + EventarcSettings.newBuilder().setEndpoint(myEndpoint).build(); + EventarcClient eventarcClient = EventarcClient.create(eventarcSettings); + } +} +// [END eventarc_v1_generated_eventarcclient_create_setendpoint_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannel.java new file mode 100644 index 00000000..e8f860bc --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannel.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.CreateChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateChannel { + + public static void main(String[] args) throws Exception { + asyncCreateChannel(); + } + + public static void asyncCreateChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelRequest request = + CreateChannelRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannel(Channel.newBuilder().build()) + .setChannelId("channelId1461735806") + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.createChannelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannel_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannelLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannelLRO.java new file mode 100644 index 00000000..80c3e98e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/AsyncCreateChannelLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannel_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.CreateChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.OperationMetadata; + +public class AsyncCreateChannelLRO { + + public static void main(String[] args) throws Exception { + asyncCreateChannelLRO(); + } + + public static void asyncCreateChannelLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelRequest request = + CreateChannelRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannel(Channel.newBuilder().build()) + .setChannelId("channelId1461735806") + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.createChannelOperationCallable().futureCall(request); + // Do something. + Channel response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannel_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannel.java new file mode 100644 index 00000000..e084300f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannel.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannel_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.CreateChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannel { + + public static void main(String[] args) throws Exception { + syncCreateChannel(); + } + + public static void syncCreateChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelRequest request = + CreateChannelRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannel(Channel.newBuilder().build()) + .setChannelId("channelId1461735806") + .setValidateOnly(true) + .build(); + Channel response = eventarcClient.createChannelAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannel_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelLocationnameChannelString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelLocationnameChannelString.java new file mode 100644 index 00000000..9c95d6de --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelLocationnameChannelString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannel_locationnamechannelstring_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannelLocationnameChannelString { + + public static void main(String[] args) throws Exception { + syncCreateChannelLocationnameChannelString(); + } + + public static void syncCreateChannelLocationnameChannelString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannel_locationnamechannelstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelStringChannelString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelStringChannelString.java new file mode 100644 index 00000000..56d9d907 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannel/SyncCreateChannelStringChannelString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannel_stringchannelstring_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannelStringChannelString { + + public static void main(String[] args) throws Exception { + syncCreateChannelStringChannelString(); + } + + public static void syncCreateChannelStringChannelString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Channel channel = Channel.newBuilder().build(); + String channelId = "channelId1461735806"; + Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannel_stringchannelstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnection.java new file mode 100644 index 00000000..a6f3c2b0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnection.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannelconnection_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateChannelConnection { + + public static void main(String[] args) throws Exception { + asyncCreateChannelConnection(); + } + + public static void asyncCreateChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelConnectionRequest request = + CreateChannelConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannelConnection(ChannelConnection.newBuilder().build()) + .setChannelConnectionId("channelConnectionId-1246974660") + .build(); + ApiFuture future = + eventarcClient.createChannelConnectionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannelconnection_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnectionLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnectionLRO.java new file mode 100644 index 00000000..07c28d5f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/AsyncCreateChannelConnectionLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannelconnection_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.OperationMetadata; + +public class AsyncCreateChannelConnectionLRO { + + public static void main(String[] args) throws Exception { + asyncCreateChannelConnectionLRO(); + } + + public static void asyncCreateChannelConnectionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelConnectionRequest request = + CreateChannelConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannelConnection(ChannelConnection.newBuilder().build()) + .setChannelConnectionId("channelConnectionId-1246974660") + .build(); + OperationFuture future = + eventarcClient.createChannelConnectionOperationCallable().futureCall(request); + // Do something. + ChannelConnection response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannelconnection_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnection.java new file mode 100644 index 00000000..3d0884ee --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnection.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createchannelconnection_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.CreateChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannelConnection { + + public static void main(String[] args) throws Exception { + syncCreateChannelConnection(); + } + + public static void syncCreateChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateChannelConnectionRequest request = + CreateChannelConnectionRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setChannelConnection(ChannelConnection.newBuilder().build()) + .setChannelConnectionId("channelConnectionId-1246974660") + .build(); + ChannelConnection response = eventarcClient.createChannelConnectionAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createchannelconnection_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionLocationnameChannelconnectionString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionLocationnameChannelconnectionString.java new file mode 100644 index 00000000..e3e448d8 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionLocationnameChannelconnectionString.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START +// eventarc_v1_generated_eventarcclient_createchannelconnection_locationnamechannelconnectionstring_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannelConnectionLocationnameChannelconnectionString { + + public static void main(String[] args) throws Exception { + syncCreateChannelConnectionLocationnameChannelconnectionString(); + } + + public static void syncCreateChannelConnectionLocationnameChannelconnectionString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + ChannelConnection response = + eventarcClient + .createChannelConnectionAsync(parent, channelConnection, channelConnectionId) + .get(); + } + } +} +// [END +// eventarc_v1_generated_eventarcclient_createchannelconnection_locationnamechannelconnectionstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionStringChannelconnectionString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionStringChannelconnectionString.java new file mode 100644 index 00000000..ef79b25f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createchannelconnection/SyncCreateChannelConnectionStringChannelconnectionString.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START +// eventarc_v1_generated_eventarcclient_createchannelconnection_stringchannelconnectionstring_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncCreateChannelConnectionStringChannelconnectionString { + + public static void main(String[] args) throws Exception { + syncCreateChannelConnectionStringChannelconnectionString(); + } + + public static void syncCreateChannelConnectionStringChannelconnectionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + ChannelConnection channelConnection = ChannelConnection.newBuilder().build(); + String channelConnectionId = "channelConnectionId-1246974660"; + ChannelConnection response = + eventarcClient + .createChannelConnectionAsync(parent, channelConnection, channelConnectionId) + .get(); + } + } +} +// [END +// eventarc_v1_generated_eventarcclient_createchannelconnection_stringchannelconnectionstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTrigger.java new file mode 100644 index 00000000..5d39c574 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTrigger.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createtrigger_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.CreateTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.longrunning.Operation; + +public class AsyncCreateTrigger { + + public static void main(String[] args) throws Exception { + asyncCreateTrigger(); + } + + public static void asyncCreateTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateTriggerRequest request = + CreateTriggerRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setTrigger(Trigger.newBuilder().build()) + .setTriggerId("triggerId-648752909") + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.createTriggerCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createtrigger_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTriggerLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTriggerLRO.java new file mode 100644 index 00000000..4708d9c6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/AsyncCreateTriggerLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createtrigger_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.CreateTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Trigger; + +public class AsyncCreateTriggerLRO { + + public static void main(String[] args) throws Exception { + asyncCreateTriggerLRO(); + } + + public static void asyncCreateTriggerLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateTriggerRequest request = + CreateTriggerRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setTrigger(Trigger.newBuilder().build()) + .setTriggerId("triggerId-648752909") + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.createTriggerOperationCallable().futureCall(request); + // Do something. + Trigger response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createtrigger_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTrigger.java new file mode 100644 index 00000000..1cb53c87 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTrigger.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createtrigger_sync] +import com.google.cloud.eventarc.v1.CreateTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncCreateTrigger { + + public static void main(String[] args) throws Exception { + syncCreateTrigger(); + } + + public static void syncCreateTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + CreateTriggerRequest request = + CreateTriggerRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setTrigger(Trigger.newBuilder().build()) + .setTriggerId("triggerId-648752909") + .setValidateOnly(true) + .build(); + Trigger response = eventarcClient.createTriggerAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createtrigger_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerLocationnameTriggerString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerLocationnameTriggerString.java new file mode 100644 index 00000000..9f72409f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerLocationnameTriggerString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createtrigger_locationnametriggerstring_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncCreateTriggerLocationnameTriggerString { + + public static void main(String[] args) throws Exception { + syncCreateTriggerLocationnameTriggerString(); + } + + public static void syncCreateTriggerLocationnameTriggerString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createtrigger_locationnametriggerstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerStringTriggerString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerStringTriggerString.java new file mode 100644 index 00000000..f9f361ed --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/createtrigger/SyncCreateTriggerStringTriggerString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_createtrigger_stringtriggerstring_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncCreateTriggerStringTriggerString { + + public static void main(String[] args) throws Exception { + syncCreateTriggerStringTriggerString(); + } + + public static void syncCreateTriggerStringTriggerString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Trigger trigger = Trigger.newBuilder().build(); + String triggerId = "triggerId-648752909"; + Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_createtrigger_stringtriggerstring_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannel.java new file mode 100644 index 00000000..0223da87 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannel.java @@ -0,0 +1,47 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.DeleteChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteChannel { + + public static void main(String[] args) throws Exception { + asyncDeleteChannel(); + } + + public static void asyncDeleteChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelRequest request = + DeleteChannelRequest.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.deleteChannelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannel_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannelLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannelLRO.java new file mode 100644 index 00000000..5b31bd23 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/AsyncDeleteChannelLRO.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannel_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.DeleteChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.OperationMetadata; + +public class AsyncDeleteChannelLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteChannelLRO(); + } + + public static void asyncDeleteChannelLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelRequest request = + DeleteChannelRequest.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.deleteChannelOperationCallable().futureCall(request); + // Do something. + Channel response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannel_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannel.java new file mode 100644 index 00000000..470b9186 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannel.java @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannel_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.DeleteChannelRequest; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannel { + + public static void main(String[] args) throws Exception { + syncDeleteChannel(); + } + + public static void syncDeleteChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelRequest request = + DeleteChannelRequest.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .setValidateOnly(true) + .build(); + Channel response = eventarcClient.deleteChannelAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannel_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelChannelname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelChannelname.java new file mode 100644 index 00000000..29d5991a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelChannelname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannel_channelname_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannelChannelname { + + public static void main(String[] args) throws Exception { + syncDeleteChannelChannelname(); + } + + public static void syncDeleteChannelChannelname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + Channel response = eventarcClient.deleteChannelAsync(name).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannel_channelname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelString.java new file mode 100644 index 00000000..e388eb28 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannel/SyncDeleteChannelString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannel_string_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannelString { + + public static void main(String[] args) throws Exception { + syncDeleteChannelString(); + } + + public static void syncDeleteChannelString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString(); + Channel response = eventarcClient.deleteChannelAsync(name).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannel_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnection.java new file mode 100644 index 00000000..b43c3043 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnection.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannelconnection_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteChannelConnection { + + public static void main(String[] args) throws Exception { + asyncDeleteChannelConnection(); + } + + public static void asyncDeleteChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelConnectionRequest request = + DeleteChannelConnectionRequest.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .build(); + ApiFuture future = + eventarcClient.deleteChannelConnectionCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannelconnection_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnectionLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnectionLRO.java new file mode 100644 index 00000000..baae085a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/AsyncDeleteChannelConnectionLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannelconnection_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.OperationMetadata; + +public class AsyncDeleteChannelConnectionLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteChannelConnectionLRO(); + } + + public static void asyncDeleteChannelConnectionLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelConnectionRequest request = + DeleteChannelConnectionRequest.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .build(); + OperationFuture future = + eventarcClient.deleteChannelConnectionOperationCallable().futureCall(request); + // Do something. + ChannelConnection response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannelconnection_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnection.java new file mode 100644 index 00000000..27f5ea9f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnection.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannelconnection_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.DeleteChannelConnectionRequest; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannelConnection { + + public static void main(String[] args) throws Exception { + syncDeleteChannelConnection(); + } + + public static void syncDeleteChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteChannelConnectionRequest request = + DeleteChannelConnectionRequest.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .build(); + ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannelconnection_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionChannelconnectionname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionChannelconnectionname.java new file mode 100644 index 00000000..9f261fdd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionChannelconnectionname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannelconnection_channelconnectionname_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannelConnectionChannelconnectionname { + + public static void main(String[] args) throws Exception { + syncDeleteChannelConnectionChannelconnectionname(); + } + + public static void syncDeleteChannelConnectionChannelconnectionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannelconnection_channelconnectionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionString.java new file mode 100644 index 00000000..e5b83a89 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletechannelconnection/SyncDeleteChannelConnectionString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletechannelconnection_string_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncDeleteChannelConnectionString { + + public static void main(String[] args) throws Exception { + syncDeleteChannelConnectionString(); + } + + public static void syncDeleteChannelConnectionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString(); + ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletechannelconnection_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTrigger.java new file mode 100644 index 00000000..64149844 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTrigger.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletetrigger_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.DeleteTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.TriggerName; +import com.google.longrunning.Operation; + +public class AsyncDeleteTrigger { + + public static void main(String[] args) throws Exception { + asyncDeleteTrigger(); + } + + public static void asyncDeleteTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteTriggerRequest request = + DeleteTriggerRequest.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setEtag("etag3123477") + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.deleteTriggerCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletetrigger_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTriggerLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTriggerLRO.java new file mode 100644 index 00000000..75ed2ce2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/AsyncDeleteTriggerLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletetrigger_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.DeleteTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class AsyncDeleteTriggerLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteTriggerLRO(); + } + + public static void asyncDeleteTriggerLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteTriggerRequest request = + DeleteTriggerRequest.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setEtag("etag3123477") + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.deleteTriggerOperationCallable().futureCall(request); + // Do something. + Trigger response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletetrigger_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTrigger.java new file mode 100644 index 00000000..dc70603f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTrigger.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletetrigger_sync] +import com.google.cloud.eventarc.v1.DeleteTriggerRequest; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncDeleteTrigger { + + public static void main(String[] args) throws Exception { + syncDeleteTrigger(); + } + + public static void syncDeleteTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + DeleteTriggerRequest request = + DeleteTriggerRequest.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .setEtag("etag3123477") + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + Trigger response = eventarcClient.deleteTriggerAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletetrigger_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerStringBoolean.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerStringBoolean.java new file mode 100644 index 00000000..890b3e68 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerStringBoolean.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletetrigger_stringboolean_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncDeleteTriggerStringBoolean { + + public static void main(String[] args) throws Exception { + syncDeleteTriggerStringBoolean(); + } + + public static void syncDeleteTriggerStringBoolean() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString(); + boolean allowMissing = true; + Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletetrigger_stringboolean_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerTriggernameBoolean.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerTriggernameBoolean.java new file mode 100644 index 00000000..8c68c38b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/deletetrigger/SyncDeleteTriggerTriggernameBoolean.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_deletetrigger_triggernameboolean_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncDeleteTriggerTriggernameBoolean { + + public static void main(String[] args) throws Exception { + syncDeleteTriggerTriggernameBoolean(); + } + + public static void syncDeleteTriggerTriggernameBoolean() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + boolean allowMissing = true; + Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_deletetrigger_triggernameboolean_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/AsyncGetChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/AsyncGetChannel.java new file mode 100644 index 00000000..e1a74656 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/AsyncGetChannel.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetChannelRequest; + +public class AsyncGetChannel { + + public static void main(String[] args) throws Exception { + asyncGetChannel(); + } + + public static void asyncGetChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetChannelRequest request = + GetChannelRequest.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .build(); + ApiFuture future = eventarcClient.getChannelCallable().futureCall(request); + // Do something. + Channel response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannel_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannel.java new file mode 100644 index 00000000..b0918d7e --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannel.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannel_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetChannelRequest; + +public class SyncGetChannel { + + public static void main(String[] args) throws Exception { + syncGetChannel(); + } + + public static void syncGetChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetChannelRequest request = + GetChannelRequest.newBuilder() + .setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString()) + .build(); + Channel response = eventarcClient.getChannel(request); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannel_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelChannelname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelChannelname.java new file mode 100644 index 00000000..f6760dc5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelChannelname.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannel_channelname_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncGetChannelChannelname { + + public static void main(String[] args) throws Exception { + syncGetChannelChannelname(); + } + + public static void syncGetChannelChannelname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]"); + Channel response = eventarcClient.getChannel(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannel_channelname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelString.java new file mode 100644 index 00000000..7d3d95a0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannel/SyncGetChannelString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannel_string_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.ChannelName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncGetChannelString { + + public static void main(String[] args) throws Exception { + syncGetChannelString(); + } + + public static void syncGetChannelString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString(); + Channel response = eventarcClient.getChannel(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannel_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/AsyncGetChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/AsyncGetChannelConnection.java new file mode 100644 index 00000000..cba3caf7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/AsyncGetChannelConnection.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannelconnection_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; + +public class AsyncGetChannelConnection { + + public static void main(String[] args) throws Exception { + asyncGetChannelConnection(); + } + + public static void asyncGetChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetChannelConnectionRequest request = + GetChannelConnectionRequest.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .build(); + ApiFuture future = + eventarcClient.getChannelConnectionCallable().futureCall(request); + // Do something. + ChannelConnection response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannelconnection_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnection.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnection.java new file mode 100644 index 00000000..dd105c47 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnection.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannelconnection_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetChannelConnectionRequest; + +public class SyncGetChannelConnection { + + public static void main(String[] args) throws Exception { + syncGetChannelConnection(); + } + + public static void syncGetChannelConnection() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetChannelConnectionRequest request = + GetChannelConnectionRequest.newBuilder() + .setName( + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]") + .toString()) + .build(); + ChannelConnection response = eventarcClient.getChannelConnection(request); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannelconnection_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionChannelconnectionname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionChannelconnectionname.java new file mode 100644 index 00000000..64e1f095 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionChannelconnectionname.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannelconnection_channelconnectionname_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncGetChannelConnectionChannelconnectionname { + + public static void main(String[] args) throws Exception { + syncGetChannelConnectionChannelconnectionname(); + } + + public static void syncGetChannelConnectionChannelconnectionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ChannelConnectionName name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]"); + ChannelConnection response = eventarcClient.getChannelConnection(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannelconnection_channelconnectionname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionString.java new file mode 100644 index 00000000..42d35215 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getchannelconnection/SyncGetChannelConnectionString.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getchannelconnection_string_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.ChannelConnectionName; +import com.google.cloud.eventarc.v1.EventarcClient; + +public class SyncGetChannelConnectionString { + + public static void main(String[] args) throws Exception { + syncGetChannelConnectionString(); + } + + public static void syncGetChannelConnectionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = + ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString(); + ChannelConnection response = eventarcClient.getChannelConnection(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getchannelconnection_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/AsyncGetProvider.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/AsyncGetProvider.java new file mode 100644 index 00000000..525fbd63 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/AsyncGetProvider.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getprovider_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetProviderRequest; +import com.google.cloud.eventarc.v1.Provider; +import com.google.cloud.eventarc.v1.ProviderName; + +public class AsyncGetProvider { + + public static void main(String[] args) throws Exception { + asyncGetProvider(); + } + + public static void asyncGetProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetProviderRequest request = + GetProviderRequest.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .build(); + ApiFuture future = eventarcClient.getProviderCallable().futureCall(request); + // Do something. + Provider response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getprovider_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProvider.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProvider.java new file mode 100644 index 00000000..1dee5dac --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProvider.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getprovider_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetProviderRequest; +import com.google.cloud.eventarc.v1.Provider; +import com.google.cloud.eventarc.v1.ProviderName; + +public class SyncGetProvider { + + public static void main(String[] args) throws Exception { + syncGetProvider(); + } + + public static void syncGetProvider() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetProviderRequest request = + GetProviderRequest.newBuilder() + .setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString()) + .build(); + Provider response = eventarcClient.getProvider(request); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getprovider_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderProvidername.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderProvidername.java new file mode 100644 index 00000000..8803da00 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderProvidername.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getprovider_providername_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Provider; +import com.google.cloud.eventarc.v1.ProviderName; + +public class SyncGetProviderProvidername { + + public static void main(String[] args) throws Exception { + syncGetProviderProvidername(); + } + + public static void syncGetProviderProvidername() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]"); + Provider response = eventarcClient.getProvider(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getprovider_providername_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderString.java new file mode 100644 index 00000000..be5960f5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/getprovider/SyncGetProviderString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_getprovider_string_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Provider; +import com.google.cloud.eventarc.v1.ProviderName; + +public class SyncGetProviderString { + + public static void main(String[] args) throws Exception { + syncGetProviderString(); + } + + public static void syncGetProviderString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString(); + Provider response = eventarcClient.getProvider(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_getprovider_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/AsyncGetTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/AsyncGetTrigger.java new file mode 100644 index 00000000..cc4af542 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/AsyncGetTrigger.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_gettrigger_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class AsyncGetTrigger { + + public static void main(String[] args) throws Exception { + asyncGetTrigger(); + } + + public static void asyncGetTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetTriggerRequest request = + GetTriggerRequest.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .build(); + ApiFuture future = eventarcClient.getTriggerCallable().futureCall(request); + // Do something. + Trigger response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_gettrigger_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTrigger.java new file mode 100644 index 00000000..85304edd --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTrigger.java @@ -0,0 +1,43 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_gettrigger_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.GetTriggerRequest; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncGetTrigger { + + public static void main(String[] args) throws Exception { + syncGetTrigger(); + } + + public static void syncGetTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + GetTriggerRequest request = + GetTriggerRequest.newBuilder() + .setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString()) + .build(); + Trigger response = eventarcClient.getTrigger(request); + } + } +} +// [END eventarc_v1_generated_eventarcclient_gettrigger_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerString.java new file mode 100644 index 00000000..51cd334c --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerString.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_gettrigger_string_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncGetTriggerString { + + public static void main(String[] args) throws Exception { + syncGetTriggerString(); + } + + public static void syncGetTriggerString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString(); + Trigger response = eventarcClient.getTrigger(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_gettrigger_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerTriggername.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerTriggername.java new file mode 100644 index 00000000..c0c4adb4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/gettrigger/SyncGetTriggerTriggername.java @@ -0,0 +1,39 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_gettrigger_triggername_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.TriggerName; + +public class SyncGetTriggerTriggername { + + public static void main(String[] args) throws Exception { + syncGetTriggerTriggername(); + } + + public static void syncGetTriggerTriggername() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]"); + Trigger response = eventarcClient.getTrigger(name); + } + } +} +// [END eventarc_v1_generated_eventarcclient_gettrigger_triggername_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnections.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnections.java new file mode 100644 index 00000000..c902b8ec --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnections.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannelconnections_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; +import com.google.cloud.eventarc.v1.LocationName; + +public class AsyncListChannelConnections { + + public static void main(String[] args) throws Exception { + asyncListChannelConnections(); + } + + public static void asyncListChannelConnections() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelConnectionsRequest request = + ListChannelConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + eventarcClient.listChannelConnectionsPagedCallable().futureCall(request); + // Do something. + for (ChannelConnection element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannelconnections_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnectionsPaged.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnectionsPaged.java new file mode 100644 index 00000000..07dd93d1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/AsyncListChannelConnectionsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannelconnections_paged_async] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; +import com.google.cloud.eventarc.v1.ListChannelConnectionsResponse; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListChannelConnectionsPaged { + + public static void main(String[] args) throws Exception { + asyncListChannelConnectionsPaged(); + } + + public static void asyncListChannelConnectionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelConnectionsRequest request = + ListChannelConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListChannelConnectionsResponse response = + eventarcClient.listChannelConnectionsCallable().call(request); + for (ChannelConnection element : response.getChannelConnectionsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannelconnections_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnections.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnections.java new file mode 100644 index 00000000..559be5c7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnections.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannelconnections_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelConnectionsRequest; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannelConnections { + + public static void main(String[] args) throws Exception { + syncListChannelConnections(); + } + + public static void syncListChannelConnections() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelConnectionsRequest request = + ListChannelConnectionsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (ChannelConnection element : + eventarcClient.listChannelConnections(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannelconnections_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsLocationname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsLocationname.java new file mode 100644 index 00000000..47f1c9d1 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannelconnections_locationname_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannelConnectionsLocationname { + + public static void main(String[] args) throws Exception { + syncListChannelConnectionsLocationname(); + } + + public static void syncListChannelConnectionsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannelconnections_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsString.java new file mode 100644 index 00000000..88cd2893 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannelconnections/SyncListChannelConnectionsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannelconnections_string_sync] +import com.google.cloud.eventarc.v1.ChannelConnection; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannelConnectionsString { + + public static void main(String[] args) throws Exception { + syncListChannelConnectionsString(); + } + + public static void syncListChannelConnectionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannelconnections_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannels.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannels.java new file mode 100644 index 00000000..dc3f6220 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannels.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannels_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelsRequest; +import com.google.cloud.eventarc.v1.LocationName; + +public class AsyncListChannels { + + public static void main(String[] args) throws Exception { + asyncListChannels(); + } + + public static void asyncListChannels() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelsRequest request = + ListChannelsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = eventarcClient.listChannelsPagedCallable().futureCall(request); + // Do something. + for (Channel element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannels_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannelsPaged.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannelsPaged.java new file mode 100644 index 00000000..9a64fa6b --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/AsyncListChannelsPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannels_paged_async] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelsRequest; +import com.google.cloud.eventarc.v1.ListChannelsResponse; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListChannelsPaged { + + public static void main(String[] args) throws Exception { + asyncListChannelsPaged(); + } + + public static void asyncListChannelsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelsRequest request = + ListChannelsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListChannelsResponse response = eventarcClient.listChannelsCallable().call(request); + for (Channel element : response.getChannelsList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannels_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannels.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannels.java new file mode 100644 index 00000000..ca8ef3ab --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannels.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannels_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListChannelsRequest; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannels { + + public static void main(String[] args) throws Exception { + syncListChannels(); + } + + public static void syncListChannels() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListChannelsRequest request = + ListChannelsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + for (Channel element : eventarcClient.listChannels(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannels_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsLocationname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsLocationname.java new file mode 100644 index 00000000..317d5d31 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannels_locationname_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannelsLocationname { + + public static void main(String[] args) throws Exception { + syncListChannelsLocationname(); + } + + public static void syncListChannelsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Channel element : eventarcClient.listChannels(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannels_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsString.java new file mode 100644 index 00000000..a3e1edef --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listchannels/SyncListChannelsString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listchannels_string_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; + +public class SyncListChannelsString { + + public static void main(String[] args) throws Exception { + syncListChannelsString(); + } + + public static void syncListChannelsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Channel element : eventarcClient.listChannels(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listchannels_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProviders.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProviders.java new file mode 100644 index 00000000..319072f6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProviders.java @@ -0,0 +1,52 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listproviders_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Provider; + +public class AsyncListProviders { + + public static void main(String[] args) throws Exception { + asyncListProviders(); + } + + public static void asyncListProviders() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListProvidersRequest request = + ListProvidersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + ApiFuture future = eventarcClient.listProvidersPagedCallable().futureCall(request); + // Do something. + for (Provider element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listproviders_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProvidersPaged.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProvidersPaged.java new file mode 100644 index 00000000..0162de93 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/AsyncListProvidersPaged.java @@ -0,0 +1,60 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listproviders_paged_async] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.ListProvidersResponse; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Provider; +import com.google.common.base.Strings; + +public class AsyncListProvidersPaged { + + public static void main(String[] args) throws Exception { + asyncListProvidersPaged(); + } + + public static void asyncListProvidersPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListProvidersRequest request = + ListProvidersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + while (true) { + ListProvidersResponse response = eventarcClient.listProvidersCallable().call(request); + for (Provider element : response.getProvidersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listproviders_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProviders.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProviders.java new file mode 100644 index 00000000..6fc33be6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProviders.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listproviders_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListProvidersRequest; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Provider; + +public class SyncListProviders { + + public static void main(String[] args) throws Exception { + syncListProviders(); + } + + public static void syncListProviders() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListProvidersRequest request = + ListProvidersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setFilter("filter-1274492040") + .build(); + for (Provider element : eventarcClient.listProviders(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listproviders_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersLocationname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersLocationname.java new file mode 100644 index 00000000..49f69125 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listproviders_locationname_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Provider; + +public class SyncListProvidersLocationname { + + public static void main(String[] args) throws Exception { + syncListProvidersLocationname(); + } + + public static void syncListProvidersLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Provider element : eventarcClient.listProviders(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listproviders_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersString.java new file mode 100644 index 00000000..210827f2 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listproviders/SyncListProvidersString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listproviders_string_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Provider; + +public class SyncListProvidersString { + + public static void main(String[] args) throws Exception { + syncListProvidersString(); + } + + public static void syncListProvidersString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Provider element : eventarcClient.listProviders(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listproviders_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggers.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggers.java new file mode 100644 index 00000000..f2f324f0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggers.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listtriggers_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListTriggersRequest; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class AsyncListTriggers { + + public static void main(String[] args) throws Exception { + asyncListTriggers(); + } + + public static void asyncListTriggers() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListTriggersRequest request = + ListTriggersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = eventarcClient.listTriggersPagedCallable().futureCall(request); + // Do something. + for (Trigger element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listtriggers_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggersPaged.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggersPaged.java new file mode 100644 index 00000000..d02a801a --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/AsyncListTriggersPaged.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listtriggers_paged_async] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListTriggersRequest; +import com.google.cloud.eventarc.v1.ListTriggersResponse; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.common.base.Strings; + +public class AsyncListTriggersPaged { + + public static void main(String[] args) throws Exception { + asyncListTriggersPaged(); + } + + public static void asyncListTriggersPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListTriggersRequest request = + ListTriggersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request); + for (Trigger element : response.getTriggersList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listtriggers_paged_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggers.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggers.java new file mode 100644 index 00000000..7a4d7a76 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggers.java @@ -0,0 +1,48 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listtriggers_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.ListTriggersRequest; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncListTriggers { + + public static void main(String[] args) throws Exception { + syncListTriggers(); + } + + public static void syncListTriggers() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + ListTriggersRequest request = + ListTriggersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .build(); + for (Trigger element : eventarcClient.listTriggers(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listtriggers_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersLocationname.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersLocationname.java new file mode 100644 index 00000000..d5fc24a7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersLocationname.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listtriggers_locationname_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncListTriggersLocationname { + + public static void main(String[] args) throws Exception { + syncListTriggersLocationname(); + } + + public static void syncListTriggersLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listtriggers_locationname_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersString.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersString.java new file mode 100644 index 00000000..9828d66d --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/listtriggers/SyncListTriggersString.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_listtriggers_string_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.LocationName; +import com.google.cloud.eventarc.v1.Trigger; + +public class SyncListTriggersString { + + public static void main(String[] args) throws Exception { + syncListTriggersString(); + } + + public static void syncListTriggersString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END eventarc_v1_generated_eventarcclient_listtriggers_string_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannel.java new file mode 100644 index 00000000..4755f248 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannel.java @@ -0,0 +1,49 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatechannel_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateChannel { + + public static void main(String[] args) throws Exception { + asyncUpdateChannel(); + } + + public static void asyncUpdateChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateChannelRequest request = + UpdateChannelRequest.newBuilder() + .setChannel(Channel.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.updateChannelCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatechannel_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannelLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannelLRO.java new file mode 100644 index 00000000..c04019a5 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/AsyncUpdateChannelLRO.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatechannel_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateChannelLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateChannelLRO(); + } + + public static void asyncUpdateChannelLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateChannelRequest request = + UpdateChannelRequest.newBuilder() + .setChannel(Channel.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.updateChannelOperationCallable().futureCall(request); + // Do something. + Channel response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatechannel_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannel.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannel.java new file mode 100644 index 00000000..993fa0ea --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannel.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatechannel_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.UpdateChannelRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateChannel { + + public static void main(String[] args) throws Exception { + syncUpdateChannel(); + } + + public static void syncUpdateChannel() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateChannelRequest request = + UpdateChannelRequest.newBuilder() + .setChannel(Channel.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setValidateOnly(true) + .build(); + Channel response = eventarcClient.updateChannelAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatechannel_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannelChannelFieldmask.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannelChannelFieldmask.java new file mode 100644 index 00000000..939ea572 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatechannel/SyncUpdateChannelChannelFieldmask.java @@ -0,0 +1,40 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatechannel_channelfieldmask_sync] +import com.google.cloud.eventarc.v1.Channel; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateChannelChannelFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateChannelChannelFieldmask(); + } + + public static void syncUpdateChannelChannelFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + Channel channel = Channel.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Channel response = eventarcClient.updateChannelAsync(channel, updateMask).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatechannel_channelfieldmask_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTrigger.java new file mode 100644 index 00000000..222d3fb7 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTrigger.java @@ -0,0 +1,50 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatetrigger_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateTrigger { + + public static void main(String[] args) throws Exception { + asyncUpdateTrigger(); + } + + public static void asyncUpdateTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateTriggerRequest request = + UpdateTriggerRequest.newBuilder() + .setTrigger(Trigger.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + ApiFuture future = eventarcClient.updateTriggerCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatetrigger_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTriggerLRO.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTriggerLRO.java new file mode 100644 index 00000000..c49341fe --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/AsyncUpdateTriggerLRO.java @@ -0,0 +1,51 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatetrigger_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.OperationMetadata; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateTriggerLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateTriggerLRO(); + } + + public static void asyncUpdateTriggerLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateTriggerRequest request = + UpdateTriggerRequest.newBuilder() + .setTrigger(Trigger.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + OperationFuture future = + eventarcClient.updateTriggerOperationCallable().futureCall(request); + // Do something. + Trigger response = future.get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatetrigger_lro_async] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTrigger.java new file mode 100644 index 00000000..a277b5f0 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTrigger.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatetrigger_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.cloud.eventarc.v1.UpdateTriggerRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateTrigger { + + public static void main(String[] args) throws Exception { + syncUpdateTrigger(); + } + + public static void syncUpdateTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + UpdateTriggerRequest request = + UpdateTriggerRequest.newBuilder() + .setTrigger(Trigger.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .setAllowMissing(true) + .setValidateOnly(true) + .build(); + Trigger response = eventarcClient.updateTriggerAsync(request).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatetrigger_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTriggerTriggerFieldmaskBoolean.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTriggerTriggerFieldmaskBoolean.java new file mode 100644 index 00000000..b550f72f --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcclient/updatetrigger/SyncUpdateTriggerTriggerFieldmaskBoolean.java @@ -0,0 +1,41 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcclient_updatetrigger_triggerfieldmaskboolean_sync] +import com.google.cloud.eventarc.v1.EventarcClient; +import com.google.cloud.eventarc.v1.Trigger; +import com.google.protobuf.FieldMask; + +public class SyncUpdateTriggerTriggerFieldmaskBoolean { + + public static void main(String[] args) throws Exception { + syncUpdateTriggerTriggerFieldmaskBoolean(); + } + + public static void syncUpdateTriggerTriggerFieldmaskBoolean() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (EventarcClient eventarcClient = EventarcClient.create()) { + Trigger trigger = Trigger.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + boolean allowMissing = true; + Trigger response = eventarcClient.updateTriggerAsync(trigger, updateMask, allowMissing).get(); + } + } +} +// [END eventarc_v1_generated_eventarcclient_updatetrigger_triggerfieldmaskboolean_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcsettings/gettrigger/SyncGetTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcsettings/gettrigger/SyncGetTrigger.java new file mode 100644 index 00000000..507552f6 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/eventarcsettings/gettrigger/SyncGetTrigger.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.samples; + +// [START eventarc_v1_generated_eventarcsettings_gettrigger_sync] +import com.google.cloud.eventarc.v1.EventarcSettings; +import java.time.Duration; + +public class SyncGetTrigger { + + public static void main(String[] args) throws Exception { + syncGetTrigger(); + } + + public static void syncGetTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + EventarcSettings.Builder eventarcSettingsBuilder = EventarcSettings.newBuilder(); + eventarcSettingsBuilder + .getTriggerSettings() + .setRetrySettings( + eventarcSettingsBuilder + .getTriggerSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + EventarcSettings eventarcSettings = eventarcSettingsBuilder.build(); + } +} +// [END eventarc_v1_generated_eventarcsettings_gettrigger_sync] diff --git a/samples/snippets/generated/com/google/cloud/eventarc/v1/stub/eventarcstubsettings/gettrigger/SyncGetTrigger.java b/samples/snippets/generated/com/google/cloud/eventarc/v1/stub/eventarcstubsettings/gettrigger/SyncGetTrigger.java new file mode 100644 index 00000000..965817d4 --- /dev/null +++ b/samples/snippets/generated/com/google/cloud/eventarc/v1/stub/eventarcstubsettings/gettrigger/SyncGetTrigger.java @@ -0,0 +1,45 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.eventarc.v1.stub.samples; + +// [START eventarc_v1_generated_eventarcstubsettings_gettrigger_sync] +import com.google.cloud.eventarc.v1.stub.EventarcStubSettings; +import java.time.Duration; + +public class SyncGetTrigger { + + public static void main(String[] args) throws Exception { + syncGetTrigger(); + } + + public static void syncGetTrigger() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + EventarcStubSettings.Builder eventarcSettingsBuilder = EventarcStubSettings.newBuilder(); + eventarcSettingsBuilder + .getTriggerSettings() + .setRetrySettings( + eventarcSettingsBuilder + .getTriggerSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + EventarcStubSettings eventarcSettings = eventarcSettingsBuilder.build(); + } +} +// [END eventarc_v1_generated_eventarcstubsettings_gettrigger_sync]