From 4665842440004a186f9509517e6d84895af4eb85 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 5 Apr 2022 13:11:57 -0700 Subject: [PATCH 01/18] feat: write to files --- .../generator/gapic/composer/Composer.java | 39 ++++++- .../generator/gapic/protowriter/Writer.java | 105 ++++++++++++------ 2 files changed, 111 insertions(+), 33 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index 63cf049dd0..0297e84741 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -32,10 +32,12 @@ import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.Sample; import com.google.api.generator.gapic.model.Service; import com.google.api.generator.gapic.model.Transport; import com.google.common.annotations.VisibleForTesting; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -45,7 +47,7 @@ public static List composeServiceClasses(GapicContext context) { clazzes.addAll(generateServiceClasses(context)); clazzes.addAll(generateMockClasses(context, context.mixinServices())); clazzes.addAll(generateResourceNameHelperClasses(context)); - return addApacheLicense(clazzes); + return addApacheLicense(composeSamples(clazzes, context.gapicMetadata().getProtoPackage())); } public static GapicPackageInfo composePackageInfo(GapicContext context) { @@ -186,6 +188,39 @@ public static List generateTestClasses(GapicContext context) { return clazzes; } + private static List composeSamples(List clazzes, String protoPackage) { + // parse protoPackage for apiVersion and apiShortName + String[] pakkage = protoPackage.split("\\."); + String apiVersion; + String apiShortName; + // e.g. v1, v2, v1beta1 + if (pakkage[pakkage.length - 1].matches("v[0-9].*")) { + apiVersion = pakkage[pakkage.length - 1]; + apiShortName = pakkage[pakkage.length - 2]; + } else { + apiVersion = ""; + apiShortName = pakkage[pakkage.length - 1]; + } + // Include license header, apiShortName, and apiVersion + return clazzes.stream() + .map( + gapicClass -> { + List samples = + gapicClass.samples().stream() + .map(sample -> updateSample(sample, apiShortName, apiVersion)) + .collect(Collectors.toList()); + return gapicClass.withSamples(samples); + }) + .collect(Collectors.toList()); + } + + private static Sample updateSample(Sample sample, String apiShortName, String apiVersion) { + return sample + .withHeader(Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)) + .withRegionTag( + sample.regionTag().withApiVersion(apiVersion).withApiShortName(apiShortName)); + } + @VisibleForTesting protected static List addApacheLicense(List gapicClassList) { return gapicClassList.stream() @@ -197,7 +232,7 @@ protected static List addApacheLicense(List gapicClassLi .toBuilder() .setFileHeader(CommentComposer.APACHE_LICENSE_COMMENT) .build(); - return GapicClass.create(gapicClass.kind(), classWithHeader); + return GapicClass.create(gapicClass.kind(), classWithHeader, gapicClass.samples()); }) .collect(Collectors.toList()); } diff --git a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java index 634174acca..e953bc8ea5 100644 --- a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java +++ b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java @@ -17,9 +17,11 @@ import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.PackageInfoDefinition; import com.google.api.generator.engine.writer.JavaWriterVisitor; +import com.google.api.generator.gapic.composer.samplecode.SampleCodeWriter; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicContext; import com.google.api.generator.gapic.model.GapicPackageInfo; +import com.google.api.generator.gapic.model.Sample; import com.google.protobuf.ByteString; import com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse; import com.google.protobuf.util.JsonFormat; @@ -43,7 +45,7 @@ public static CodeGeneratorResponse write( String outputFilePath) { ByteString.Output output = ByteString.newOutput(); JavaWriterVisitor codeWriter = new JavaWriterVisitor(); - JarOutputStream jos = null; + JarOutputStream jos; try { jos = new JarOutputStream(output); } catch (IOException e) { @@ -51,44 +53,96 @@ public static CodeGeneratorResponse write( } for (GapicClass gapicClazz : clazzes) { - ClassDefinition clazz = gapicClazz.classDefinition(); + String classPath = writeClazz(gapicClazz, codeWriter, jos); + writeSamples(gapicClazz, getSamplePackage(gapicClazz), classPath, jos); + } + + writeMetadataFile(context, writePackageInfo(gapicPackageInfo, codeWriter, jos), jos); + + try { + jos.finish(); + jos.flush(); + } catch (IOException e) { + throw new GapicWriterException(e.getMessage()); + } + + CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder(); + response + .setSupportedFeatures(CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL_VALUE) + .addFileBuilder() + .setName(outputFilePath) + .setContentBytes(output.toByteString()); + return response.build(); + } - clazz.accept(codeWriter); - String code = codeWriter.write(); - codeWriter.clear(); + private static String writeClazz( + GapicClass gapicClazz, JavaWriterVisitor codeWriter, JarOutputStream jos) { + ClassDefinition clazz = gapicClazz.classDefinition(); + + clazz.accept(codeWriter); + String code = codeWriter.write(); + codeWriter.clear(); + + String path = getPath(clazz.packageString(), clazz.classIdentifier().name()); + String className = clazz.classIdentifier().name(); + JarEntry jarEntry = new JarEntry(String.format("%s/%s.java", path, className)); + try { + jos.putNextEntry(jarEntry); + jos.write(code.getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + throw new GapicWriterException( + String.format( + "Could not write code for class %s.%s: %s", + clazz.packageString(), clazz.classIdentifier().name(), e.getMessage())); + } + return path; + } - String path = getPath(clazz.packageString(), clazz.classIdentifier().name()); - String className = clazz.classIdentifier().name(); - JarEntry jarEntry = new JarEntry(String.format("%s/%s.java", path, className)); + private static void writeSamples( + GapicClass gapicClazz, String pakkage, String clazzPath, JarOutputStream jos) { + for (Sample sample : gapicClazz.samples()) { + JarEntry jarEntry = + new JarEntry( + String.format( + "samples/snippets/generated/%s/%s/%s/%s.java", + clazzPath, + sample.regionTag().serviceName().toLowerCase(), + sample.regionTag().rpcName().toLowerCase(), + sample.generateSampleFileName())); + String executableSampleCode = SampleCodeWriter.writeExecutableSample(sample, pakkage); try { jos.putNextEntry(jarEntry); - jos.write(code.getBytes(StandardCharsets.UTF_8)); + jos.write(executableSampleCode.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { throw new GapicWriterException( String.format( - "Could not write code for class %s.%s: %s", - clazz.packageString(), clazz.classIdentifier().name(), e.getMessage())); + "Could not write sample code for %s/%s.: %s", + clazzPath, sample.name(), e.getMessage())); } } + } - // Write the package info. + private static String writePackageInfo( + GapicPackageInfo gapicPackageInfo, JavaWriterVisitor codeWriter, JarOutputStream jos) { PackageInfoDefinition packageInfo = gapicPackageInfo.packageInfo(); packageInfo.accept(codeWriter); String code = codeWriter.write(); codeWriter.clear(); - String path = "src/main/java/" + packageInfo.pakkage().replaceAll("\\.", "/"); - JarEntry jarEntry = new JarEntry(String.format("%s/package-info.java", path)); + String packagePath = "src/main/java/" + packageInfo.pakkage().replaceAll("\\.", "/"); + JarEntry jarEntry = new JarEntry(String.format("%s/package-info.java", packagePath)); try { jos.putNextEntry(jarEntry); jos.write(code.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { throw new GapicWriterException("Could not write code for package-info.java"); } + return packagePath; + } + private static void writeMetadataFile(GapicContext context, String path, JarOutputStream jos) { if (context.gapicMetadataEnabled()) { - // Write the mdatadata file. - jarEntry = new JarEntry(String.format("%s/gapic_metadata.json", path)); + JarEntry jarEntry = new JarEntry(String.format("%s/gapic_metadata.json", path)); try { jos.putNextEntry(jarEntry); jos.write( @@ -97,21 +151,6 @@ public static CodeGeneratorResponse write( throw new GapicWriterException("Could not write gapic_metadata.json"); } } - - try { - jos.finish(); - jos.flush(); - } catch (IOException e) { - throw new GapicWriterException(e.getMessage()); - } - - CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder(); - response - .setSupportedFeatures(CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL_VALUE) - .addFileBuilder() - .setName(outputFilePath) - .setContentBytes(output.toByteString()); - return response.build(); } private static String getPath(String pakkage, String className) { @@ -128,4 +167,8 @@ private static String getPath(String pakkage, String className) { } return path; } + + private static String getSamplePackage(GapicClass gapicClazz) { + return gapicClazz.classDefinition().packageString().concat(".samples"); + } } From 4906d278dce261b0495d44a7c1d416823f313ae6 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 5 Apr 2022 13:12:23 -0700 Subject: [PATCH 02/18] test: update test scripts --- scripts/diff_gen_and_golden.sh | 8 ++++++-- scripts/update_golden.sh | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/diff_gen_and_golden.sh b/scripts/diff_gen_and_golden.sh index dfd1dfda26..0fba834bbe 100755 --- a/scripts/diff_gen_and_golden.sh +++ b/scripts/diff_gen_and_golden.sh @@ -8,6 +8,10 @@ RAW_SRCJAR=$( find . -name '*_java_gapic_srcjar_raw.srcjar' ) mkdir unpacked src cd unpacked unzip -q -c "../${RAW_SRCJAR}" temp-codegen.srcjar | jar x + +mkdir -p ../samples/snippets/generated/ +cp -r samples/snippets/generated/**/* ../samples/snippets/generated + cp -r src/main/java/* ../src cp -r src/test/java/* ../src [ -d proto ] && cp -r proto/src/main/java/* ../src @@ -17,7 +21,7 @@ cd .. find src -type f ! -name '*.java' -a ! -name '*gapic_metadata.json' -delete find src -type f -name 'PlaceholderFile.java' -delete find src -type d -empty -delete - # This will not print diff_output to the console unless `--test_output=all` option # is enabled, it only emits the comparison results to the test.log. -diff -ru src test/integration/goldens/${API_NAME} +diff -ru src test/integration/goldens/${API_NAME}/src +diff -ru samples test/integration/goldens/${API_NAME}/samples \ No newline at end of file diff --git a/scripts/update_golden.sh b/scripts/update_golden.sh index ba72594be1..ece95265d5 100755 --- a/scripts/update_golden.sh +++ b/scripts/update_golden.sh @@ -17,9 +17,13 @@ cd ${BUILD_WORKSPACE_DIRECTORY}/test/integration/goldens/${API_NAME} find . -name '*.java' -delete find . -name 'gapic_metadata.json' -delete -cp -r ${UNPACK_DIR}/src/main/java/* . -cp -r ${UNPACK_DIR}/src/test/java/* . -[ -d ${UNPACK_DIR}/proto ] && cp -r ${UNPACK_DIR}/proto/src/main/java/* . +mkdir -p ./src +cp -r ${UNPACK_DIR}/src/main/java/* ./src +cp -r ${UNPACK_DIR}/src/test/java/* ./src +[ -d ${UNPACK_DIR}/proto ] && cp -r ${UNPACK_DIR}/proto/src/main/java/* ./src + +mkdir -p ./samples/snippets/generated +cp -r ${UNPACK_DIR}/samples/snippets/generated/**/* ./samples/snippets/generated find . -name 'PlaceholderFile.java' -delete find . -type d -empty -delete From cf7b00af4253f6945640ded6b499af080c4553e3 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 5 Apr 2022 13:12:29 -0700 Subject: [PATCH 03/18] test: goldens --- .../AsyncAnalyzeIamPolicy.java | 49 ++++++++++++ .../SyncAnalyzeIamPolicy.java | 45 +++++++++++ .../AsyncAnalyzeIamPolicyLongrunning.java | 49 ++++++++++++ .../AsyncAnalyzeIamPolicyLongrunning_LRO.java | 51 +++++++++++++ .../SyncAnalyzeIamPolicyLongrunning.java | 46 +++++++++++ .../analyzemove/AsyncAnalyzeMove.java | 47 ++++++++++++ .../analyzemove/SyncAnalyzeMove.java | 43 +++++++++++ .../AsyncBatchGetAssetsHistory.java | 54 +++++++++++++ .../SyncBatchGetAssetsHistory.java | 50 ++++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../createfeed/AsyncCreateFeed.java | 47 ++++++++++++ .../createfeed/SyncCreateFeed.java | 44 +++++++++++ .../createfeed/SyncCreateFeed_String.java | 38 ++++++++++ .../deletefeed/AsyncDeleteFeed.java | 46 +++++++++++ .../deletefeed/SyncDeleteFeed.java | 43 +++++++++++ .../deletefeed/SyncDeleteFeed_Feedname.java | 39 ++++++++++ .../deletefeed/SyncDeleteFeed_String.java | 39 ++++++++++ .../exportassets/AsyncExportAssets.java | 55 ++++++++++++++ .../exportassets/AsyncExportAssets_LRO.java | 56 ++++++++++++++ .../exportassets/SyncExportAssets.java | 52 +++++++++++++ .../getfeed/AsyncGetFeed.java | 46 +++++++++++ .../getfeed/SyncGetFeed.java | 43 +++++++++++ .../getfeed/SyncGetFeed_Feedname.java | 39 ++++++++++ .../getfeed/SyncGetFeed_String.java | 39 ++++++++++ .../listassets/AsyncListAssets.java | 57 ++++++++++++++ .../listassets/AsyncListAssets_Paged.java | 65 ++++++++++++++++ .../listassets/SyncListAssets.java | 54 +++++++++++++ .../SyncListAssets_Resourcename.java | 42 ++++++++++ .../listassets/SyncListAssets_String.java | 41 ++++++++++ .../listfeeds/AsyncListFeeds.java | 44 +++++++++++ .../listfeeds/SyncListFeeds.java | 40 ++++++++++ .../listfeeds/SyncListFeeds_String.java | 38 ++++++++++ .../AsyncSearchAllIamPolicies.java | 54 +++++++++++++ .../AsyncSearchAllIamPolicies_Paged.java | 62 +++++++++++++++ .../SyncSearchAllIamPolicies.java | 51 +++++++++++++ ...SyncSearchAllIamPolicies_StringString.java | 42 ++++++++++ .../AsyncSearchAllResources.java | 56 ++++++++++++++ .../AsyncSearchAllResources_Paged.java | 64 ++++++++++++++++ .../SyncSearchAllResources.java | 53 +++++++++++++ ...chAllResources_StringStringListstring.java | 45 +++++++++++ .../updatefeed/AsyncUpdateFeed.java | 47 ++++++++++++ .../updatefeed/SyncUpdateFeed.java | 44 +++++++++++ .../updatefeed/SyncUpdateFeed_Feed.java | 38 ++++++++++ .../SyncBatchGetAssetsHistory.java | 45 +++++++++++ .../SyncBatchGetAssetsHistory.java | 46 +++++++++++ .../cloud/asset/v1/AssetServiceClient.java | 0 .../asset/v1/AssetServiceClientTest.java | 0 .../cloud/asset/v1/AssetServiceSettings.java | 0 .../com/google/cloud/asset/v1/FeedName.java | 0 .../cloud/asset/v1/MockAssetService.java | 0 .../cloud/asset/v1/MockAssetServiceImpl.java | 0 .../google/cloud/asset/v1/gapic_metadata.json | 0 .../google/cloud/asset/v1/package-info.java | 0 .../cloud/asset/v1/stub/AssetServiceStub.java | 0 .../v1/stub/AssetServiceStubSettings.java | 0 .../stub/GrpcAssetServiceCallableFactory.java | 0 .../asset/v1/stub/GrpcAssetServiceStub.java | 0 .../AsyncCheckAndMutateRow.java | 56 ++++++++++++++ .../SyncCheckAndMutateRow.java | 52 +++++++++++++ ...ringRowfilterListmutationListmutation.java | 51 +++++++++++++ ...wfilterListmutationListmutationString.java | 52 +++++++++++++ ...ringRowfilterListmutationListmutation.java | 51 +++++++++++++ ...wfilterListmutationListmutationString.java | 53 +++++++++++++ .../SyncCreate_SetCredentialsProvider.java | 42 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 39 ++++++++++ .../mutaterow/AsyncMutateRow.java | 53 +++++++++++++ .../mutaterow/SyncMutateRow.java | 49 ++++++++++++ ...utateRow_StringBytestringListmutation.java | 45 +++++++++++ ...ow_StringBytestringListmutationString.java | 47 ++++++++++++ ...teRow_TablenameBytestringListmutation.java | 45 +++++++++++ ...TablenameBytestringListmutationString.java | 47 ++++++++++++ .../mutaterows/AsyncMutateRows.java | 51 +++++++++++++ .../AsyncReadModifyWriteRow.java | 53 +++++++++++++ .../SyncReadModifyWriteRow.java | 49 ++++++++++++ ...ringBytestringListreadmodifywriterule.java | 47 ++++++++++++ ...testringListreadmodifywriteruleString.java | 48 ++++++++++++ ...nameBytestringListreadmodifywriterule.java | 47 ++++++++++++ ...testringListreadmodifywriteruleString.java | 48 ++++++++++++ .../readrows/AsyncReadRows.java | 54 +++++++++++++ .../samplerowkeys/AsyncSampleRowKeys.java | 49 ++++++++++++ .../mutaterow/SyncMutateRow.java | 46 +++++++++++ .../mutaterow/SyncMutateRow.java | 46 +++++++++++ .../com/google/bigtable/v2/TableName.java | 0 .../data/v2/BaseBigtableDataClient.java | 0 .../data/v2/BaseBigtableDataClientTest.java | 0 .../data/v2/BaseBigtableDataSettings.java | 0 .../cloud/bigtable/data/v2/MockBigtable.java | 0 .../bigtable/data/v2/MockBigtableImpl.java | 0 .../bigtable/data/v2/gapic_metadata.json | 0 .../cloud/bigtable/data/v2/package-info.java | 0 .../bigtable/data/v2/stub/BigtableStub.java | 0 .../data/v2/stub/BigtableStubSettings.java | 0 .../v2/stub/GrpcBigtableCallableFactory.java | 0 .../data/v2/stub/GrpcBigtableStub.java | 0 .../aggregatedlist/AsyncAggregatedList.java | 54 +++++++++++++ .../AsyncAggregatedList_Paged.java | 61 +++++++++++++++ .../aggregatedlist/SyncAggregatedList.java | 51 +++++++++++++ .../SyncAggregatedList_String.java | 42 ++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../addressesclient/delete/AsyncDelete.java | 48 ++++++++++++ .../delete/AsyncDelete_LRO.java | 49 ++++++++++++ .../addressesclient/delete/SyncDelete.java | 45 +++++++++++ .../delete/SyncDelete_StringStringString.java | 40 ++++++++++ .../addressesclient/insert/AsyncInsert.java | 49 ++++++++++++ .../insert/AsyncInsert_LRO.java | 50 ++++++++++++ .../addressesclient/insert/SyncInsert.java | 46 +++++++++++ .../SyncInsert_StringStringAddress.java | 41 ++++++++++ .../addressesclient/list/AsyncList.java | 52 +++++++++++++ .../addressesclient/list/AsyncList_Paged.java | 60 +++++++++++++++ .../addressesclient/list/SyncList.java | 49 ++++++++++++ .../list/SyncList_StringStringString.java | 42 ++++++++++ .../aggregatedlist/SyncAggregatedList.java | 45 +++++++++++ .../SyncCreate_SetCredentialsProvider.java | 42 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 39 ++++++++++ .../regionoperationsclient/get/AsyncGet.java | 47 ++++++++++++ .../regionoperationsclient/get/SyncGet.java | 44 +++++++++++ .../get/SyncGet_StringStringString.java | 40 ++++++++++ .../wait/AsyncWait.java | 47 ++++++++++++ .../regionoperationsclient/wait/SyncWait.java | 44 +++++++++++ .../wait/SyncWait_StringStringString.java | 40 ++++++++++ .../regionoperationssettings/get/SyncGet.java | 46 +++++++++++ .../aggregatedlist/SyncAggregatedList.java | 45 +++++++++++ .../get/SyncGet.java | 46 +++++++++++ .../compute/v1small/AddressesClient.java | 0 .../compute/v1small/AddressesClientTest.java | 0 .../compute/v1small/AddressesSettings.java | 0 .../v1small/RegionOperationsClient.java | 0 .../v1small/RegionOperationsClientTest.java | 0 .../v1small/RegionOperationsSettings.java | 0 .../cloud/compute/v1small/gapic_metadata.json | 0 .../cloud/compute/v1small/package-info.java | 0 .../compute/v1small/stub/AddressesStub.java | 0 .../v1small/stub/AddressesStubSettings.java | 0 .../HttpJsonAddressesCallableFactory.java | 0 .../v1small/stub/HttpJsonAddressesStub.java | 0 ...tpJsonRegionOperationsCallableFactory.java | 0 .../stub/HttpJsonRegionOperationsStub.java | 0 .../v1small/stub/RegionOperationsStub.java | 0 .../stub/RegionOperationsStubSettings.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../AsyncGenerateAccessToken.java | 52 +++++++++++++ .../SyncGenerateAccessToken.java | 48 ++++++++++++ ...countnameListstringListstringDuration.java | 47 ++++++++++++ ...en_StringListstringListstringDuration.java | 46 +++++++++++ .../generateidtoken/AsyncGenerateIdToken.java | 51 +++++++++++++ .../generateidtoken/SyncGenerateIdToken.java | 47 ++++++++++++ ...iceaccountnameListstringStringBoolean.java | 46 +++++++++++ ...IdToken_StringListstringStringBoolean.java | 45 +++++++++++ .../signblob/AsyncSignBlob.java | 51 +++++++++++++ .../signblob/SyncSignBlob.java | 47 ++++++++++++ ...erviceaccountnameListstringBytestring.java | 44 +++++++++++ ...ncSignBlob_StringListstringBytestring.java | 44 +++++++++++ .../signjwt/AsyncSignJwt.java | 50 ++++++++++++ .../signjwt/SyncSignJwt.java | 46 +++++++++++ ...wt_ServiceaccountnameListstringString.java | 43 +++++++++++ .../SyncSignJwt_StringListstringString.java | 43 +++++++++++ .../SyncGenerateAccessToken.java | 46 +++++++++++ .../SyncGenerateAccessToken.java | 46 +++++++++++ .../v1/IAMCredentialsClientTest.java | 0 .../credentials/v1/IamCredentialsClient.java | 0 .../v1/IamCredentialsSettings.java | 0 .../credentials/v1/MockIAMCredentials.java | 0 .../v1/MockIAMCredentialsImpl.java | 0 .../credentials/v1/ServiceAccountName.java | 0 .../iam/credentials/v1/gapic_metadata.json | 0 .../iam/credentials/v1/package-info.java | 0 .../GrpcIamCredentialsCallableFactory.java | 0 .../v1/stub/GrpcIamCredentialsStub.java | 0 .../v1/stub/IamCredentialsStub.java | 0 .../v1/stub/IamCredentialsStubSettings.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 47 ++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 44 +++++++++++ .../setiampolicy/AsyncSetIamPolicy.java | 46 +++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 43 +++++++++++ .../AsyncTestIamPermissions.java | 48 ++++++++++++ .../SyncTestIamPermissions.java | 44 +++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 45 +++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 45 +++++++++++ .../com/google/iam/v1/IAMPolicyClient.java | 0 .../google/iam/v1/IAMPolicyClientTest.java | 0 .../com/google/iam/v1/IAMPolicySettings.java | 0 .../com/google/iam/v1/MockIAMPolicy.java | 0 .../com/google/iam/v1/MockIAMPolicyImpl.java | 0 .../com/google/iam/v1/gapic_metadata.json | 0 .../com/google/iam/v1/package-info.java | 0 .../v1/stub/GrpcIAMPolicyCallableFactory.java | 0 .../google/iam/v1/stub/GrpcIAMPolicyStub.java | 0 .../com/google/iam/v1/stub/IAMPolicyStub.java | 0 .../iam/v1/stub/IAMPolicyStubSettings.java | 0 .../AsyncAsymmetricDecrypt.java | 59 ++++++++++++++ .../SyncAsymmetricDecrypt.java | 55 ++++++++++++++ ...ecrypt_CryptokeyversionnameBytestring.java | 45 +++++++++++ ...yncAsymmetricDecrypt_StringBytestring.java | 46 +++++++++++ .../asymmetricsign/AsyncAsymmetricSign.java | 59 ++++++++++++++ .../asymmetricsign/SyncAsymmetricSign.java | 55 ++++++++++++++ ...metricSign_CryptokeyversionnameDigest.java | 44 +++++++++++ .../SyncAsymmetricSign_StringDigest.java | 45 +++++++++++ .../SyncCreate_SetCredentialsProvider.java | 42 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 39 ++++++++++ .../createcryptokey/AsyncCreateCryptoKey.java | 51 +++++++++++++ .../createcryptokey/SyncCreateCryptoKey.java | 47 ++++++++++++ ...eCryptoKey_KeyringnameStringCryptokey.java | 43 +++++++++++ ...CreateCryptoKey_StringStringCryptokey.java | 43 +++++++++++ .../AsyncCreateCryptoKeyVersion.java | 51 +++++++++++++ .../SyncCreateCryptoKeyVersion.java | 47 ++++++++++++ ...Version_CryptokeynameCryptokeyversion.java | 43 +++++++++++ ...yptoKeyVersion_StringCryptokeyversion.java | 43 +++++++++++ .../createimportjob/AsyncCreateImportJob.java | 50 ++++++++++++ .../createimportjob/SyncCreateImportJob.java | 46 +++++++++++ ...eImportJob_KeyringnameStringImportjob.java | 43 +++++++++++ ...CreateImportJob_StringStringImportjob.java | 43 +++++++++++ .../createkeyring/AsyncCreateKeyRing.java | 50 ++++++++++++ .../createkeyring/SyncCreateKeyRing.java | 46 +++++++++++ ...eateKeyRing_LocationnameStringKeyring.java | 42 ++++++++++ ...SyncCreateKeyRing_StringStringKeyring.java | 42 ++++++++++ .../decrypt/AsyncDecrypt.java | 56 ++++++++++++++ .../decrypt/SyncDecrypt.java | 52 +++++++++++++ .../SyncDecrypt_CryptokeynameBytestring.java | 43 +++++++++++ .../decrypt/SyncDecrypt_StringBytestring.java | 43 +++++++++++ .../AsyncDestroyCryptoKeyVersion.java | 55 ++++++++++++++ .../SyncDestroyCryptoKeyVersion.java | 51 +++++++++++++ ...CryptoKeyVersion_Cryptokeyversionname.java | 42 ++++++++++ .../SyncDestroyCryptoKeyVersion_String.java | 43 +++++++++++ .../encrypt/AsyncEncrypt.java | 56 ++++++++++++++ .../encrypt/SyncEncrypt.java | 52 +++++++++++++ .../SyncEncrypt_ResourcenameBytestring.java | 43 +++++++++++ .../encrypt/SyncEncrypt_StringBytestring.java | 43 +++++++++++ .../getcryptokey/AsyncGetCryptoKey.java | 50 ++++++++++++ .../getcryptokey/SyncGetCryptoKey.java | 46 +++++++++++ .../SyncGetCryptoKey_Cryptokeyname.java | 41 ++++++++++ .../getcryptokey/SyncGetCryptoKey_String.java | 41 ++++++++++ .../AsyncGetCryptoKeyVersion.java | 55 ++++++++++++++ .../SyncGetCryptoKeyVersion.java | 51 +++++++++++++ ...CryptoKeyVersion_Cryptokeyversionname.java | 42 ++++++++++ .../SyncGetCryptoKeyVersion_String.java | 43 +++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 52 +++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 48 ++++++++++++ .../getimportjob/AsyncGetImportJob.java | 50 ++++++++++++ .../getimportjob/SyncGetImportJob.java | 46 +++++++++++ .../SyncGetImportJob_Importjobname.java | 41 ++++++++++ .../getimportjob/SyncGetImportJob_String.java | 41 ++++++++++ .../getkeyring/AsyncGetKeyRing.java | 48 ++++++++++++ .../getkeyring/SyncGetKeyRing.java | 44 +++++++++++ .../SyncGetKeyRing_Keyringname.java | 40 ++++++++++ .../getkeyring/SyncGetKeyRing_String.java | 40 ++++++++++ .../getlocation/AsyncGetLocation.java | 44 +++++++++++ .../getlocation/SyncGetLocation.java | 40 ++++++++++ .../getpublickey/AsyncGetPublicKey.java | 55 ++++++++++++++ .../getpublickey/SyncGetPublicKey.java | 51 +++++++++++++ ...SyncGetPublicKey_Cryptokeyversionname.java | 42 ++++++++++ .../getpublickey/SyncGetPublicKey_String.java | 43 +++++++++++ .../AsyncImportCryptoKeyVersion.java | 51 +++++++++++++ .../SyncImportCryptoKeyVersion.java | 47 ++++++++++++ .../listcryptokeys/AsyncListCryptoKeys.java | 54 +++++++++++++ .../AsyncListCryptoKeys_Paged.java | 62 +++++++++++++++ .../listcryptokeys/SyncListCryptoKeys.java | 50 ++++++++++++ .../SyncListCryptoKeys_Keyringname.java | 42 ++++++++++ .../SyncListCryptoKeys_String.java | 42 ++++++++++ .../AsyncListCryptoKeyVersions.java | 56 ++++++++++++++ .../AsyncListCryptoKeyVersions_Paged.java | 64 ++++++++++++++++ .../SyncListCryptoKeyVersions.java | 53 +++++++++++++ ...ncListCryptoKeyVersions_Cryptokeyname.java | 44 +++++++++++ .../SyncListCryptoKeyVersions_String.java | 44 +++++++++++ .../listimportjobs/AsyncListImportJobs.java | 54 +++++++++++++ .../AsyncListImportJobs_Paged.java | 62 +++++++++++++++ .../listimportjobs/SyncListImportJobs.java | 50 ++++++++++++ .../SyncListImportJobs_Keyringname.java | 42 ++++++++++ .../SyncListImportJobs_String.java | 42 ++++++++++ .../listkeyrings/AsyncListKeyRings.java | 54 +++++++++++++ .../listkeyrings/AsyncListKeyRings_Paged.java | 62 +++++++++++++++ .../listkeyrings/SyncListKeyRings.java | 50 ++++++++++++ .../SyncListKeyRings_Locationname.java | 42 ++++++++++ .../listkeyrings/SyncListKeyRings_String.java | 42 ++++++++++ .../listlocations/AsyncListLocations.java | 52 +++++++++++++ .../AsyncListLocations_Paged.java | 60 +++++++++++++++ .../listlocations/SyncListLocations.java | 48 ++++++++++++ .../AsyncRestoreCryptoKeyVersion.java | 55 ++++++++++++++ .../SyncRestoreCryptoKeyVersion.java | 51 +++++++++++++ ...CryptoKeyVersion_Cryptokeyversionname.java | 42 ++++++++++ .../SyncRestoreCryptoKeyVersion_String.java | 43 +++++++++++ .../AsyncTestIamPermissions.java | 52 +++++++++++++ .../SyncTestIamPermissions.java | 48 ++++++++++++ .../updatecryptokey/AsyncUpdateCryptoKey.java | 49 ++++++++++++ .../updatecryptokey/SyncUpdateCryptoKey.java | 45 +++++++++++ ...yncUpdateCryptoKey_CryptokeyFieldmask.java | 41 ++++++++++ .../AsyncUpdateCryptoKeyPrimaryVersion.java | 51 +++++++++++++ .../SyncUpdateCryptoKeyPrimaryVersion.java | 47 ++++++++++++ ...KeyPrimaryVersion_CryptokeynameString.java | 43 +++++++++++ ...eCryptoKeyPrimaryVersion_StringString.java | 43 +++++++++++ .../AsyncUpdateCryptoKeyVersion.java | 49 ++++++++++++ .../SyncUpdateCryptoKeyVersion.java | 45 +++++++++++ ...oKeyVersion_CryptokeyversionFieldmask.java | 42 ++++++++++ .../getkeyring/SyncGetKeyRing.java | 47 ++++++++++++ .../getkeyring/SyncGetKeyRing.java | 47 ++++++++++++ .../google/cloud/kms/v1/CryptoKeyName.java | 0 .../cloud/kms/v1/CryptoKeyVersionName.java | 0 .../google/cloud/kms/v1/ImportJobName.java | 0 .../kms/v1/KeyManagementServiceClient.java | 0 .../v1/KeyManagementServiceClientTest.java | 0 .../kms/v1/KeyManagementServiceSettings.java | 0 .../com/google/cloud/kms/v1/KeyRingName.java | 0 .../com/google/cloud/kms/v1/LocationName.java | 0 .../kms/v1/MockKeyManagementService.java | 0 .../kms/v1/MockKeyManagementServiceImpl.java | 0 .../google/cloud/kms/v1/gapic_metadata.json | 0 .../com/google/cloud/kms/v1/package-info.java | 0 ...pcKeyManagementServiceCallableFactory.java | 0 .../v1/stub/GrpcKeyManagementServiceStub.java | 0 .../kms/v1/stub/KeyManagementServiceStub.java | 0 .../KeyManagementServiceStubSettings.java | 0 .../google/cloud/location/MockLocations.java | 0 .../cloud/location/MockLocationsImpl.java | 0 .../com/google/iam/v1/MockIAMPolicy.java | 0 .../com/google/iam/v1/MockIAMPolicyImpl.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../createbook/AsyncCreateBook.java | 47 ++++++++++++ .../createbook/SyncCreateBook.java | 44 +++++++++++ .../SyncCreateBook_ShelfnameBook.java | 40 ++++++++++ .../createbook/SyncCreateBook_StringBook.java | 40 ++++++++++ .../createshelf/AsyncCreateShelf.java | 43 +++++++++++ .../createshelf/SyncCreateShelf.java | 40 ++++++++++ .../createshelf/SyncCreateShelf_Shelf.java | 38 ++++++++++ .../deletebook/AsyncDeleteBook.java | 46 +++++++++++ .../deletebook/SyncDeleteBook.java | 43 +++++++++++ .../deletebook/SyncDeleteBook_Bookname.java | 39 ++++++++++ .../deletebook/SyncDeleteBook_String.java | 39 ++++++++++ .../deleteshelf/AsyncDeleteShelf.java | 44 +++++++++++ .../deleteshelf/SyncDeleteShelf.java | 41 ++++++++++ .../SyncDeleteShelf_Shelfname.java | 39 ++++++++++ .../deleteshelf/SyncDeleteShelf_String.java | 39 ++++++++++ .../getbook/AsyncGetBook.java | 44 +++++++++++ .../getbook/SyncGetBook.java | 41 ++++++++++ .../getbook/SyncGetBook_Bookname.java | 39 ++++++++++ .../getbook/SyncGetBook_String.java | 39 ++++++++++ .../getshelf/AsyncGetShelf.java | 44 +++++++++++ .../getshelf/SyncGetShelf.java | 41 ++++++++++ .../getshelf/SyncGetShelf_Shelfname.java | 39 ++++++++++ .../getshelf/SyncGetShelf_String.java | 39 ++++++++++ .../listbooks/AsyncListBooks.java | 50 ++++++++++++ .../listbooks/AsyncListBooks_Paged.java | 58 ++++++++++++++ .../listbooks/SyncListBooks.java | 47 ++++++++++++ .../listbooks/SyncListBooks_Shelfname.java | 41 ++++++++++ .../listbooks/SyncListBooks_String.java | 41 ++++++++++ .../listshelves/AsyncListShelves.java | 48 ++++++++++++ .../listshelves/AsyncListShelves_Paged.java | 56 ++++++++++++++ .../listshelves/SyncListShelves.java | 45 +++++++++++ .../mergeshelves/AsyncMergeShelves.java | 47 ++++++++++++ .../mergeshelves/SyncMergeShelves.java | 44 +++++++++++ .../SyncMergeShelves_ShelfnameShelfname.java | 40 ++++++++++ .../SyncMergeShelves_ShelfnameString.java | 40 ++++++++++ .../SyncMergeShelves_StringShelfname.java | 40 ++++++++++ .../SyncMergeShelves_StringString.java | 40 ++++++++++ .../movebook/AsyncMoveBook.java | 48 ++++++++++++ .../movebook/SyncMoveBook.java | 45 +++++++++++ .../SyncMoveBook_BooknameShelfname.java | 41 ++++++++++ .../movebook/SyncMoveBook_BooknameString.java | 41 ++++++++++ .../SyncMoveBook_StringShelfname.java | 41 ++++++++++ .../movebook/SyncMoveBook_StringString.java | 41 ++++++++++ .../updatebook/AsyncUpdateBook.java | 47 ++++++++++++ .../updatebook/SyncUpdateBook.java | 44 +++++++++++ .../SyncUpdateBook_BookFieldmask.java | 40 ++++++++++ .../createshelf/SyncCreateShelf.java | 46 +++++++++++ .../createshelf/SyncCreateShelf.java | 46 +++++++++++ .../library/v1/LibraryServiceClient.java | 0 .../library/v1/LibraryServiceClientTest.java | 0 .../library/v1/LibraryServiceSettings.java | 0 .../library/v1/MockLibraryService.java | 0 .../library/v1/MockLibraryServiceImpl.java | 0 .../example/library/v1/gapic_metadata.json | 0 .../example/library/v1/package-info.java | 0 .../GrpcLibraryServiceCallableFactory.java | 0 .../v1/stub/GrpcLibraryServiceStub.java | 0 .../library/v1/stub/LibraryServiceStub.java | 0 .../v1/stub/LibraryServiceStubSettings.java | 0 .../google/example/library/v1/BookName.java | 0 .../google/example/library/v1/ShelfName.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 37 +++++++++ .../createbucket/AsyncCreateBucket.java | 48 ++++++++++++ .../createbucket/SyncCreateBucket.java | 45 +++++++++++ .../createexclusion/AsyncCreateExclusion.java | 47 ++++++++++++ .../createexclusion/SyncCreateExclusion.java | 44 +++++++++++ ...lusion_BillingaccountnameLogexclusion.java | 40 ++++++++++ ...reateExclusion_FoldernameLogexclusion.java | 40 ++++++++++ ...xclusion_OrganizationnameLogexclusion.java | 40 ++++++++++ ...eateExclusion_ProjectnameLogexclusion.java | 40 ++++++++++ ...yncCreateExclusion_StringLogexclusion.java | 40 ++++++++++ .../createsink/AsyncCreateSink.java | 48 ++++++++++++ .../createsink/SyncCreateSink.java | 45 +++++++++++ ...cCreateSink_BillingaccountnameLogsink.java | 40 ++++++++++ .../SyncCreateSink_FoldernameLogsink.java | 40 ++++++++++ ...yncCreateSink_OrganizationnameLogsink.java | 40 ++++++++++ .../SyncCreateSink_ProjectnameLogsink.java | 40 ++++++++++ .../SyncCreateSink_StringLogsink.java | 40 ++++++++++ .../createview/AsyncCreateView.java | 47 ++++++++++++ .../createview/SyncCreateView.java | 44 +++++++++++ .../deletebucket/AsyncDeleteBucket.java | 48 ++++++++++++ .../deletebucket/SyncDeleteBucket.java | 45 +++++++++++ .../deleteexclusion/AsyncDeleteExclusion.java | 47 ++++++++++++ .../deleteexclusion/SyncDeleteExclusion.java | 44 +++++++++++ .../SyncDeleteExclusion_Logexclusionname.java | 39 ++++++++++ .../SyncDeleteExclusion_String.java | 39 ++++++++++ .../deletesink/AsyncDeleteSink.java | 46 +++++++++++ .../deletesink/SyncDeleteSink.java | 43 +++++++++++ .../SyncDeleteSink_Logsinkname.java | 39 ++++++++++ .../deletesink/SyncDeleteSink_String.java | 39 ++++++++++ .../deleteview/AsyncDeleteView.java | 49 ++++++++++++ .../deleteview/SyncDeleteView.java | 46 +++++++++++ .../getbucket/AsyncGetBucket.java | 48 ++++++++++++ .../configclient/getbucket/SyncGetBucket.java | 45 +++++++++++ .../getcmeksettings/AsyncGetCmekSettings.java | 46 +++++++++++ .../getcmeksettings/SyncGetCmekSettings.java | 43 +++++++++++ .../getexclusion/AsyncGetExclusion.java | 47 ++++++++++++ .../getexclusion/SyncGetExclusion.java | 44 +++++++++++ .../SyncGetExclusion_Logexclusionname.java | 39 ++++++++++ .../getexclusion/SyncGetExclusion_String.java | 39 ++++++++++ .../v2/configclient/getsink/AsyncGetSink.java | 46 +++++++++++ .../v2/configclient/getsink/SyncGetSink.java | 43 +++++++++++ .../getsink/SyncGetSink_Logsinkname.java | 39 ++++++++++ .../getsink/SyncGetSink_String.java | 39 ++++++++++ .../v2/configclient/getview/AsyncGetView.java | 49 ++++++++++++ .../v2/configclient/getview/SyncGetView.java | 46 +++++++++++ .../listbuckets/AsyncListBuckets.java | 50 ++++++++++++ .../listbuckets/AsyncListBuckets_Paged.java | 58 ++++++++++++++ .../listbuckets/SyncListBuckets.java | 47 ++++++++++++ ...istBuckets_Billingaccountlocationname.java | 42 ++++++++++ .../SyncListBuckets_Folderlocationname.java | 41 ++++++++++ .../SyncListBuckets_Locationname.java | 41 ++++++++++ ...cListBuckets_Organizationlocationname.java | 41 ++++++++++ .../listbuckets/SyncListBuckets_String.java | 41 ++++++++++ .../listexclusions/AsyncListExclusions.java | 51 +++++++++++++ .../AsyncListExclusions_Paged.java | 58 ++++++++++++++ .../listexclusions/SyncListExclusions.java | 47 ++++++++++++ ...SyncListExclusions_Billingaccountname.java | 41 ++++++++++ .../SyncListExclusions_Foldername.java | 41 ++++++++++ .../SyncListExclusions_Organizationname.java | 41 ++++++++++ .../SyncListExclusions_Projectname.java | 41 ++++++++++ .../SyncListExclusions_String.java | 41 ++++++++++ .../listsinks/AsyncListSinks.java | 50 ++++++++++++ .../listsinks/AsyncListSinks_Paged.java | 58 ++++++++++++++ .../configclient/listsinks/SyncListSinks.java | 47 ++++++++++++ .../SyncListSinks_Billingaccountname.java | 41 ++++++++++ .../listsinks/SyncListSinks_Foldername.java | 41 ++++++++++ .../SyncListSinks_Organizationname.java | 41 ++++++++++ .../listsinks/SyncListSinks_Projectname.java | 41 ++++++++++ .../listsinks/SyncListSinks_String.java | 41 ++++++++++ .../listviews/AsyncListViews.java | 49 ++++++++++++ .../listviews/AsyncListViews_Paged.java | 57 ++++++++++++++ .../configclient/listviews/SyncListViews.java | 46 +++++++++++ .../listviews/SyncListViews_String.java | 40 ++++++++++ .../undeletebucket/AsyncUndeleteBucket.java | 48 ++++++++++++ .../undeletebucket/SyncUndeleteBucket.java | 45 +++++++++++ .../updatebucket/AsyncUpdateBucket.java | 51 +++++++++++++ .../updatebucket/SyncUpdateBucket.java | 48 ++++++++++++ .../AsyncUpdateCmekSettings.java | 49 ++++++++++++ .../SyncUpdateCmekSettings.java | 45 +++++++++++ .../updateexclusion/AsyncUpdateExclusion.java | 50 ++++++++++++ .../updateexclusion/SyncUpdateExclusion.java | 47 ++++++++++++ ...LogexclusionnameLogexclusionFieldmask.java | 42 ++++++++++ ...Exclusion_StringLogexclusionFieldmask.java | 42 ++++++++++ .../updatesink/AsyncUpdateSink.java | 50 ++++++++++++ .../updatesink/SyncUpdateSink.java | 47 ++++++++++++ .../SyncUpdateSink_LogsinknameLogsink.java | 40 ++++++++++ ...pdateSink_LogsinknameLogsinkFieldmask.java | 42 ++++++++++ .../SyncUpdateSink_StringLogsink.java | 40 ++++++++++ ...SyncUpdateSink_StringLogsinkFieldmask.java | 42 ++++++++++ .../updateview/AsyncUpdateView.java | 48 ++++++++++++ .../updateview/SyncUpdateView.java | 45 +++++++++++ .../getbucket/SyncGetBucket.java | 45 +++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 37 +++++++++ .../deletelog/AsyncDeleteLog.java | 46 +++++++++++ .../deletelog/SyncDeleteLog.java | 43 +++++++++++ .../deletelog/SyncDeleteLog_Logname.java | 39 ++++++++++ .../deletelog/SyncDeleteLog_String.java | 39 ++++++++++ .../listlogentries/AsyncListLogEntries.java | 52 +++++++++++++ .../AsyncListLogEntries_Paged.java | 60 +++++++++++++++ .../listlogentries/SyncListLogEntries.java | 49 ++++++++++++ ...ListLogEntries_ListstringStringString.java | 45 +++++++++++ .../loggingclient/listlogs/AsyncListLogs.java | 51 +++++++++++++ .../listlogs/AsyncListLogs_Paged.java | 59 ++++++++++++++ .../loggingclient/listlogs/SyncListLogs.java | 48 ++++++++++++ .../SyncListLogs_Billingaccountname.java | 40 ++++++++++ .../listlogs/SyncListLogs_Foldername.java | 40 ++++++++++ .../SyncListLogs_Organizationname.java | 40 ++++++++++ .../listlogs/SyncListLogs_Projectname.java | 40 ++++++++++ .../listlogs/SyncListLogs_String.java | 40 ++++++++++ ...AsyncListMonitoredResourceDescriptors.java | 49 ++++++++++++ ...istMonitoredResourceDescriptors_Paged.java | 57 ++++++++++++++ .../SyncListMonitoredResourceDescriptors.java | 46 +++++++++++ .../taillogentries/AsyncTailLogEntries.java | 52 +++++++++++++ .../writelogentries/AsyncWriteLogEntries.java | 56 ++++++++++++++ .../writelogentries/SyncWriteLogEntries.java | 52 +++++++++++++ ...edresourceMapstringstringListlogentry.java | 50 ++++++++++++ ...edresourceMapstringstringListlogentry.java | 50 ++++++++++++ .../deletelog/SyncDeleteLog.java | 45 +++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 37 +++++++++ .../createlogmetric/AsyncCreateLogMetric.java | 47 ++++++++++++ .../createlogmetric/SyncCreateLogMetric.java | 44 +++++++++++ ...cCreateLogMetric_ProjectnameLogmetric.java | 40 ++++++++++ .../SyncCreateLogMetric_StringLogmetric.java | 40 ++++++++++ .../deletelogmetric/AsyncDeleteLogMetric.java | 46 +++++++++++ .../deletelogmetric/SyncDeleteLogMetric.java | 43 +++++++++++ .../SyncDeleteLogMetric_Logmetricname.java | 39 ++++++++++ .../SyncDeleteLogMetric_String.java | 39 ++++++++++ .../getlogmetric/AsyncGetLogMetric.java | 46 +++++++++++ .../getlogmetric/SyncGetLogMetric.java | 43 +++++++++++ .../SyncGetLogMetric_Logmetricname.java | 39 ++++++++++ .../getlogmetric/SyncGetLogMetric_String.java | 39 ++++++++++ .../listlogmetrics/AsyncListLogMetrics.java | 50 ++++++++++++ .../AsyncListLogMetrics_Paged.java | 58 ++++++++++++++ .../listlogmetrics/SyncListLogMetrics.java | 47 ++++++++++++ .../SyncListLogMetrics_Projectname.java | 41 ++++++++++ .../SyncListLogMetrics_String.java | 41 ++++++++++ .../updatelogmetric/AsyncUpdateLogMetric.java | 47 ++++++++++++ .../updatelogmetric/SyncUpdateLogMetric.java | 44 +++++++++++ ...pdateLogMetric_LogmetricnameLogmetric.java | 40 ++++++++++ .../SyncUpdateLogMetric_StringLogmetric.java | 40 ++++++++++ .../getlogmetric/SyncGetLogMetric.java | 45 +++++++++++ .../getbucket/SyncGetBucket.java | 46 +++++++++++ .../deletelog/SyncDeleteLog.java | 46 +++++++++++ .../getlogmetric/SyncGetLogMetric.java | 46 +++++++++++ .../google/cloud/logging/v2/ConfigClient.java | 0 .../cloud/logging/v2/ConfigClientTest.java | 0 .../cloud/logging/v2/ConfigSettings.java | 0 .../cloud/logging/v2/LoggingClient.java | 0 .../cloud/logging/v2/LoggingClientTest.java | 0 .../cloud/logging/v2/LoggingSettings.java | 0 .../cloud/logging/v2/MetricsClient.java | 0 .../cloud/logging/v2/MetricsClientTest.java | 0 .../cloud/logging/v2/MetricsSettings.java | 0 .../cloud/logging/v2/MockConfigServiceV2.java | 0 .../logging/v2/MockConfigServiceV2Impl.java | 0 .../logging/v2/MockLoggingServiceV2.java | 0 .../logging/v2/MockLoggingServiceV2Impl.java | 0 .../logging/v2/MockMetricsServiceV2.java | 0 .../logging/v2/MockMetricsServiceV2Impl.java | 0 .../cloud/logging/v2/gapic_metadata.json | 0 .../google/cloud/logging/v2/package-info.java | 0 .../logging/v2/stub/ConfigServiceV2Stub.java | 0 .../v2/stub/ConfigServiceV2StubSettings.java | 0 .../GrpcConfigServiceV2CallableFactory.java | 0 .../v2/stub/GrpcConfigServiceV2Stub.java | 0 .../GrpcLoggingServiceV2CallableFactory.java | 0 .../v2/stub/GrpcLoggingServiceV2Stub.java | 0 .../GrpcMetricsServiceV2CallableFactory.java | 0 .../v2/stub/GrpcMetricsServiceV2Stub.java | 0 .../logging/v2/stub/LoggingServiceV2Stub.java | 0 .../v2/stub/LoggingServiceV2StubSettings.java | 0 .../logging/v2/stub/MetricsServiceV2Stub.java | 0 .../v2/stub/MetricsServiceV2StubSettings.java | 0 .../v2/BillingAccountLocationName.java | 0 .../google/logging/v2/BillingAccountName.java | 0 .../google/logging/v2/CmekSettingsName.java | 0 .../google/logging/v2/FolderLocationName.java | 0 .../com/google/logging/v2/FolderName.java | 0 .../com/google/logging/v2/LocationName.java | 0 .../com/google/logging/v2/LogBucketName.java | 0 .../google/logging/v2/LogExclusionName.java | 0 .../com/google/logging/v2/LogMetricName.java | 0 .../com/google/logging/v2/LogName.java | 0 .../com/google/logging/v2/LogSinkName.java | 0 .../com/google/logging/v2/LogViewName.java | 0 .../logging/v2/OrganizationLocationName.java | 0 .../google/logging/v2/OrganizationName.java | 0 .../com/google/logging/v2/ProjectName.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../createschema/AsyncCreateSchema.java | 48 ++++++++++++ .../createschema/SyncCreateSchema.java | 45 +++++++++++ ...cCreateSchema_ProjectnameSchemaString.java | 41 ++++++++++ .../SyncCreateSchema_StringSchemaString.java | 41 ++++++++++ .../deleteschema/AsyncDeleteSchema.java | 46 +++++++++++ .../deleteschema/SyncDeleteSchema.java | 43 +++++++++++ .../SyncDeleteSchema_Schemaname.java | 39 ++++++++++ .../deleteschema/SyncDeleteSchema_String.java | 39 ++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 48 ++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 45 +++++++++++ .../getschema/AsyncGetSchema.java | 48 ++++++++++++ .../getschema/SyncGetSchema.java | 45 +++++++++++ .../getschema/SyncGetSchema_Schemaname.java | 39 ++++++++++ .../getschema/SyncGetSchema_String.java | 39 ++++++++++ .../listschemas/AsyncListSchemas.java | 52 +++++++++++++ .../listschemas/AsyncListSchemas_Paged.java | 60 +++++++++++++++ .../listschemas/SyncListSchemas.java | 49 ++++++++++++ .../SyncListSchemas_Projectname.java | 41 ++++++++++ .../listschemas/SyncListSchemas_String.java | 41 ++++++++++ .../setiampolicy/AsyncSetIamPolicy.java | 47 ++++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 44 +++++++++++ .../AsyncTestIamPermissions.java | 49 ++++++++++++ .../SyncTestIamPermissions.java | 45 +++++++++++ .../validatemessage/AsyncValidateMessage.java | 51 +++++++++++++ .../validatemessage/SyncValidateMessage.java | 47 ++++++++++++ .../validateschema/AsyncValidateSchema.java | 49 ++++++++++++ .../validateschema/SyncValidateSchema.java | 45 +++++++++++ .../SyncValidateSchema_ProjectnameSchema.java | 41 ++++++++++ .../SyncValidateSchema_StringSchema.java | 41 ++++++++++ .../createschema/SyncCreateSchema.java | 45 +++++++++++ .../createtopic/SyncCreateTopic.java | 45 +++++++++++ .../createschema/SyncCreateSchema.java | 46 +++++++++++ .../SyncCreateSubscription.java | 46 +++++++++++ .../acknowledge/AsyncAcknowledge.java | 48 ++++++++++++ .../acknowledge/SyncAcknowledge.java | 45 +++++++++++ .../SyncAcknowledge_StringListstring.java | 42 ++++++++++ ...cknowledge_SubscriptionnameListstring.java | 42 ++++++++++ .../SyncCreate_SetCredentialsProvider.java | 42 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 39 ++++++++++ .../createsnapshot/AsyncCreateSnapshot.java | 51 +++++++++++++ .../createsnapshot/SyncCreateSnapshot.java | 47 ++++++++++++ ...SyncCreateSnapshot_SnapshotnameString.java | 41 ++++++++++ ...Snapshot_SnapshotnameSubscriptionname.java | 41 ++++++++++ .../SyncCreateSnapshot_StringString.java | 41 ++++++++++ ...CreateSnapshot_StringSubscriptionname.java | 41 ++++++++++ .../AsyncCreateSubscription.java | 67 ++++++++++++++++ .../SyncCreateSubscription.java | 63 +++++++++++++++ ...ubscription_StringStringPushconfigInt.java | 45 +++++++++++ ...cription_StringTopicnamePushconfigInt.java | 45 +++++++++++ ...n_SubscriptionnameStringPushconfigInt.java | 45 +++++++++++ ...ubscriptionnameTopicnamePushconfigInt.java | 46 +++++++++++ .../deletesnapshot/AsyncDeleteSnapshot.java | 47 ++++++++++++ .../deletesnapshot/SyncDeleteSnapshot.java | 43 +++++++++++ .../SyncDeleteSnapshot_Snapshotname.java | 39 ++++++++++ .../SyncDeleteSnapshot_String.java | 39 ++++++++++ .../AsyncDeleteSubscription.java | 47 ++++++++++++ .../SyncDeleteSubscription.java | 43 +++++++++++ .../SyncDeleteSubscription_String.java | 39 ++++++++++ ...ncDeleteSubscription_Subscriptionname.java | 39 ++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 48 ++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 45 +++++++++++ .../getsnapshot/AsyncGetSnapshot.java | 47 ++++++++++++ .../getsnapshot/SyncGetSnapshot.java | 43 +++++++++++ .../SyncGetSnapshot_Snapshotname.java | 39 ++++++++++ .../getsnapshot/SyncGetSnapshot_String.java | 39 ++++++++++ .../getsubscription/AsyncGetSubscription.java | 47 ++++++++++++ .../getsubscription/SyncGetSubscription.java | 43 +++++++++++ .../SyncGetSubscription_String.java | 39 ++++++++++ .../SyncGetSubscription_Subscriptionname.java | 39 ++++++++++ .../listsnapshots/AsyncListSnapshots.java | 51 +++++++++++++ .../AsyncListSnapshots_Paged.java | 59 ++++++++++++++ .../listsnapshots/SyncListSnapshots.java | 47 ++++++++++++ .../SyncListSnapshots_Projectname.java | 41 ++++++++++ .../SyncListSnapshots_String.java | 41 ++++++++++ .../AsyncListSubscriptions.java | 51 +++++++++++++ .../AsyncListSubscriptions_Paged.java | 59 ++++++++++++++ .../SyncListSubscriptions.java | 47 ++++++++++++ .../SyncListSubscriptions_Projectname.java | 41 ++++++++++ .../SyncListSubscriptions_String.java | 41 ++++++++++ .../AsyncModifyAckDeadline.java | 50 ++++++++++++ .../SyncModifyAckDeadline.java | 46 +++++++++++ ...ModifyAckDeadline_StringListstringInt.java | 43 +++++++++++ ...eadline_SubscriptionnameListstringInt.java | 43 +++++++++++ .../AsyncModifyPushConfig.java | 49 ++++++++++++ .../SyncModifyPushConfig.java | 45 +++++++++++ ...SyncModifyPushConfig_StringPushconfig.java | 41 ++++++++++ ...PushConfig_SubscriptionnamePushconfig.java | 41 ++++++++++ .../pull/AsyncPull.java | 48 ++++++++++++ .../pull/SyncPull.java | 45 +++++++++++ .../pull/SyncPull_StringBooleanInt.java | 42 ++++++++++ .../pull/SyncPull_StringInt.java | 40 ++++++++++ .../SyncPull_SubscriptionnameBooleanInt.java | 42 ++++++++++ .../pull/SyncPull_SubscriptionnameInt.java | 40 ++++++++++ .../seek/AsyncSeek.java | 46 +++++++++++ .../seek/SyncSeek.java | 43 +++++++++++ .../setiampolicy/AsyncSetIamPolicy.java | 47 ++++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 44 +++++++++++ .../streamingpull/AsyncStreamingPull.java | 57 ++++++++++++++ .../AsyncTestIamPermissions.java | 49 ++++++++++++ .../SyncTestIamPermissions.java | 45 +++++++++++ .../updatesnapshot/AsyncUpdateSnapshot.java | 48 ++++++++++++ .../updatesnapshot/SyncUpdateSnapshot.java | 44 +++++++++++ .../AsyncUpdateSubscription.java | 48 ++++++++++++ .../SyncUpdateSubscription.java | 44 +++++++++++ .../SyncCreateSubscription.java | 46 +++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../createtopic/AsyncCreateTopic.java | 55 ++++++++++++++ .../createtopic/SyncCreateTopic.java | 52 +++++++++++++ .../createtopic/SyncCreateTopic_String.java | 39 ++++++++++ .../SyncCreateTopic_Topicname.java | 39 ++++++++++ .../deletetopic/AsyncDeleteTopic.java | 46 +++++++++++ .../deletetopic/SyncDeleteTopic.java | 43 +++++++++++ .../deletetopic/SyncDeleteTopic_String.java | 39 ++++++++++ .../SyncDeleteTopic_Topicname.java | 39 ++++++++++ .../AsyncDetachSubscription.java | 47 ++++++++++++ .../SyncDetachSubscription.java | 43 +++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 48 ++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 45 +++++++++++ .../gettopic/AsyncGetTopic.java | 46 +++++++++++ .../gettopic/SyncGetTopic.java | 43 +++++++++++ .../gettopic/SyncGetTopic_String.java | 39 ++++++++++ .../gettopic/SyncGetTopic_Topicname.java | 39 ++++++++++ .../listtopics/AsyncListTopics.java | 50 ++++++++++++ .../listtopics/AsyncListTopics_Paged.java | 58 ++++++++++++++ .../listtopics/SyncListTopics.java | 47 ++++++++++++ .../SyncListTopics_Projectname.java | 41 ++++++++++ .../listtopics/SyncListTopics_String.java | 41 ++++++++++ .../AsyncListTopicSnapshots.java | 50 ++++++++++++ .../AsyncListTopicSnapshots_Paged.java | 58 ++++++++++++++ .../SyncListTopicSnapshots.java | 46 +++++++++++ .../SyncListTopicSnapshots_String.java | 40 ++++++++++ .../SyncListTopicSnapshots_Topicname.java | 40 ++++++++++ .../AsyncListTopicSubscriptions.java | 50 ++++++++++++ .../AsyncListTopicSubscriptions_Paged.java | 58 ++++++++++++++ .../SyncListTopicSubscriptions.java | 46 +++++++++++ .../SyncListTopicSubscriptions_String.java | 40 ++++++++++ .../SyncListTopicSubscriptions_Topicname.java | 40 ++++++++++ .../publish/AsyncPublish.java | 49 ++++++++++++ .../topicadminclient/publish/SyncPublish.java | 46 +++++++++++ .../SyncPublish_StringListpubsubmessage.java | 43 +++++++++++ ...yncPublish_TopicnameListpubsubmessage.java | 43 +++++++++++ .../setiampolicy/AsyncSetIamPolicy.java | 47 ++++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 44 +++++++++++ .../AsyncTestIamPermissions.java | 49 ++++++++++++ .../SyncTestIamPermissions.java | 45 +++++++++++ .../updatetopic/AsyncUpdateTopic.java | 47 ++++++++++++ .../updatetopic/SyncUpdateTopic.java | 44 +++++++++++ .../createtopic/SyncCreateTopic.java | 45 +++++++++++ .../google/cloud/pubsub/v1/MockIAMPolicy.java | 0 .../cloud/pubsub/v1/MockIAMPolicyImpl.java | 0 .../google/cloud/pubsub/v1/MockPublisher.java | 0 .../cloud/pubsub/v1/MockPublisherImpl.java | 0 .../cloud/pubsub/v1/MockSchemaService.java | 0 .../pubsub/v1/MockSchemaServiceImpl.java | 0 .../cloud/pubsub/v1/MockSubscriber.java | 0 .../cloud/pubsub/v1/MockSubscriberImpl.java | 0 .../cloud/pubsub/v1/SchemaServiceClient.java | 0 .../pubsub/v1/SchemaServiceClientTest.java | 0 .../pubsub/v1/SchemaServiceSettings.java | 0 .../pubsub/v1/SubscriptionAdminClient.java | 0 .../v1/SubscriptionAdminClientTest.java | 0 .../pubsub/v1/SubscriptionAdminSettings.java | 0 .../cloud/pubsub/v1/TopicAdminClient.java | 0 .../cloud/pubsub/v1/TopicAdminClientTest.java | 0 .../cloud/pubsub/v1/TopicAdminSettings.java | 0 .../cloud/pubsub/v1/gapic_metadata.json | 0 .../google/cloud/pubsub/v1/package-info.java | 0 .../v1/stub/GrpcPublisherCallableFactory.java | 0 .../pubsub/v1/stub/GrpcPublisherStub.java | 0 .../GrpcSchemaServiceCallableFactory.java | 0 .../pubsub/v1/stub/GrpcSchemaServiceStub.java | 0 .../stub/GrpcSubscriberCallableFactory.java | 0 .../pubsub/v1/stub/GrpcSubscriberStub.java | 0 .../cloud/pubsub/v1/stub/PublisherStub.java | 0 .../pubsub/v1/stub/PublisherStubSettings.java | 0 .../pubsub/v1/stub/SchemaServiceStub.java | 0 .../v1/stub/SchemaServiceStubSettings.java | 0 .../cloud/pubsub/v1/stub/SubscriberStub.java | 0 .../v1/stub/SubscriberStubSettings.java | 0 .../com/google/pubsub/v1/ProjectName.java | 0 .../com/google/pubsub/v1/SchemaName.java | 0 .../com/google/pubsub/v1/SnapshotName.java | 0 .../google/pubsub/v1/SubscriptionName.java | 0 .../com/google/pubsub/v1/TopicName.java | 0 .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 38 ++++++++++ .../createinstance/AsyncCreateInstance.java | 49 ++++++++++++ .../AsyncCreateInstance_LRO.java | 50 ++++++++++++ .../createinstance/SyncCreateInstance.java | 45 +++++++++++ ...teInstance_LocationnameStringInstance.java | 41 ++++++++++ ...ncCreateInstance_StringStringInstance.java | 41 ++++++++++ .../deleteinstance/AsyncDeleteInstance.java | 46 +++++++++++ .../AsyncDeleteInstance_LRO.java | 48 ++++++++++++ .../deleteinstance/SyncDeleteInstance.java | 43 +++++++++++ .../SyncDeleteInstance_Instancename.java | 39 ++++++++++ .../SyncDeleteInstance_String.java | 39 ++++++++++ .../exportinstance/AsyncExportInstance.java | 47 ++++++++++++ .../AsyncExportInstance_LRO.java | 49 ++++++++++++ .../exportinstance/SyncExportInstance.java | 44 +++++++++++ ...SyncExportInstance_StringOutputconfig.java | 40 ++++++++++ .../AsyncFailoverInstance.java | 46 +++++++++++ .../AsyncFailoverInstance_LRO.java | 48 ++++++++++++ .../SyncFailoverInstance.java | 43 +++++++++++ ...overinstancerequestdataprotectionmode.java | 43 +++++++++++ ...overinstancerequestdataprotectionmode.java | 43 +++++++++++ .../getinstance/AsyncGetInstance.java | 46 +++++++++++ .../getinstance/SyncGetInstance.java | 43 +++++++++++ .../SyncGetInstance_Instancename.java | 39 ++++++++++ .../getinstance/SyncGetInstance_String.java | 39 ++++++++++ .../AsyncGetInstanceAuthString.java | 47 ++++++++++++ .../SyncGetInstanceAuthString.java | 43 +++++++++++ ...yncGetInstanceAuthString_Instancename.java | 39 ++++++++++ .../SyncGetInstanceAuthString_String.java | 39 ++++++++++ .../importinstance/AsyncImportInstance.java | 47 ++++++++++++ .../AsyncImportInstance_LRO.java | 49 ++++++++++++ .../importinstance/SyncImportInstance.java | 44 +++++++++++ .../SyncImportInstance_StringInputconfig.java | 40 ++++++++++ .../listinstances/AsyncListInstances.java | 51 +++++++++++++ .../AsyncListInstances_Paged.java | 58 ++++++++++++++ .../listinstances/SyncListInstances.java | 47 ++++++++++++ .../SyncListInstances_Locationname.java | 41 ++++++++++ .../SyncListInstances_String.java | 41 ++++++++++ .../AsyncRescheduleMaintenance.java | 49 ++++++++++++ .../AsyncRescheduleMaintenance_LRO.java | 50 ++++++++++++ .../SyncRescheduleMaintenance.java | 45 +++++++++++ ...tenancerequestrescheduletypeTimestamp.java | 48 ++++++++++++ ...tenancerequestrescheduletypeTimestamp.java | 47 ++++++++++++ .../updateinstance/AsyncUpdateInstance.java | 48 ++++++++++++ .../AsyncUpdateInstance_LRO.java | 49 ++++++++++++ .../updateinstance/SyncUpdateInstance.java | 44 +++++++++++ .../SyncUpdateInstance_FieldmaskInstance.java | 40 ++++++++++ .../upgradeinstance/AsyncUpgradeInstance.java | 47 ++++++++++++ .../AsyncUpgradeInstance_LRO.java | 49 ++++++++++++ .../upgradeinstance/SyncUpgradeInstance.java | 44 +++++++++++ ...yncUpgradeInstance_InstancenameString.java | 40 ++++++++++ .../SyncUpgradeInstance_StringString.java | 40 ++++++++++ .../getinstance/SyncGetInstance.java | 45 +++++++++++ .../getinstance/SyncGetInstance.java | 45 +++++++++++ .../cloud/redis/v1beta1/CloudRedisClient.java | 0 .../redis/v1beta1/CloudRedisClientTest.java | 0 .../redis/v1beta1/CloudRedisSettings.java | 0 .../cloud/redis/v1beta1/InstanceName.java | 0 .../cloud/redis/v1beta1/LocationName.java | 0 .../cloud/redis/v1beta1/MockCloudRedis.java | 0 .../redis/v1beta1/MockCloudRedisImpl.java | 0 .../cloud/redis/v1beta1/gapic_metadata.json | 0 .../cloud/redis/v1beta1/package-info.java | 0 .../redis/v1beta1/stub/CloudRedisStub.java | 0 .../v1beta1/stub/CloudRedisStubSettings.java | 0 .../stub/GrpcCloudRedisCallableFactory.java | 0 .../v1beta1/stub/GrpcCloudRedisStub.java | 0 .../composeobject/AsyncComposeObject.java | 59 ++++++++++++++ .../composeobject/SyncComposeObject.java | 56 ++++++++++++++ .../SyncCreate_SetCredentialsProvider.java | 41 ++++++++++ .../create/SyncCreate_SetEndpoint.java | 37 +++++++++ .../createbucket/AsyncCreateBucket.java | 52 +++++++++++++ .../createbucket/SyncCreateBucket.java | 49 ++++++++++++ ...cCreateBucket_ProjectnameBucketString.java | 41 ++++++++++ .../SyncCreateBucket_StringBucketString.java | 41 ++++++++++ .../createhmackey/AsyncCreateHmacKey.java | 50 ++++++++++++ .../createhmackey/SyncCreateHmacKey.java | 46 +++++++++++ .../SyncCreateHmacKey_ProjectnameString.java | 40 ++++++++++ .../SyncCreateHmacKey_StringString.java | 40 ++++++++++ .../AsyncCreateNotification.java | 48 ++++++++++++ .../SyncCreateNotification.java | 44 +++++++++++ ...eNotification_ProjectnameNotification.java | 40 ++++++++++ ...CreateNotification_StringNotification.java | 40 ++++++++++ .../deletebucket/AsyncDeleteBucket.java | 50 ++++++++++++ .../deletebucket/SyncDeleteBucket.java | 47 ++++++++++++ .../SyncDeleteBucket_Bucketname.java | 39 ++++++++++ .../deletebucket/SyncDeleteBucket_String.java | 39 ++++++++++ .../deletehmackey/AsyncDeleteHmacKey.java | 49 ++++++++++++ .../deletehmackey/SyncDeleteHmacKey.java | 46 +++++++++++ .../SyncDeleteHmacKey_StringProjectname.java | 40 ++++++++++ .../SyncDeleteHmacKey_StringString.java | 40 ++++++++++ .../AsyncDeleteNotification.java | 46 +++++++++++ .../SyncDeleteNotification.java | 43 +++++++++++ ...ncDeleteNotification_Notificationname.java | 39 ++++++++++ .../SyncDeleteNotification_String.java | 39 ++++++++++ .../deleteobject/AsyncDeleteObject.java | 56 ++++++++++++++ .../deleteobject/SyncDeleteObject.java | 53 +++++++++++++ .../SyncDeleteObject_StringString.java | 39 ++++++++++ .../SyncDeleteObject_StringStringLong.java | 40 ++++++++++ .../getbucket/AsyncGetBucket.java | 52 +++++++++++++ .../getbucket/SyncGetBucket.java | 49 ++++++++++++ .../getbucket/SyncGetBucket_Bucketname.java | 39 ++++++++++ .../getbucket/SyncGetBucket_String.java | 39 ++++++++++ .../gethmackey/AsyncGetHmacKey.java | 49 ++++++++++++ .../gethmackey/SyncGetHmacKey.java | 46 +++++++++++ .../SyncGetHmacKey_StringProjectname.java | 40 ++++++++++ .../SyncGetHmacKey_StringString.java | 40 ++++++++++ .../getiampolicy/AsyncGetIamPolicy.java | 50 ++++++++++++ .../getiampolicy/SyncGetIamPolicy.java | 47 ++++++++++++ .../SyncGetIamPolicy_Resourcename.java | 41 ++++++++++ .../getiampolicy/SyncGetIamPolicy_String.java | 40 ++++++++++ .../getnotification/AsyncGetNotification.java | 46 +++++++++++ .../getnotification/SyncGetNotification.java | 43 +++++++++++ .../SyncGetNotification_Bucketname.java | 39 ++++++++++ .../SyncGetNotification_String.java | 39 ++++++++++ .../getobject/AsyncGetObject.java | 57 ++++++++++++++ .../getobject/SyncGetObject.java | 54 +++++++++++++ .../getobject/SyncGetObject_StringString.java | 39 ++++++++++ .../SyncGetObject_StringStringLong.java | 40 ++++++++++ .../AsyncGetServiceAccount.java | 49 ++++++++++++ .../SyncGetServiceAccount.java | 45 +++++++++++ .../SyncGetServiceAccount_Projectname.java | 39 ++++++++++ .../SyncGetServiceAccount_String.java | 39 ++++++++++ .../listbuckets/AsyncListBuckets.java | 55 ++++++++++++++ .../listbuckets/AsyncListBuckets_Paged.java | 63 +++++++++++++++ .../listbuckets/SyncListBuckets.java | 52 +++++++++++++ .../SyncListBuckets_Projectname.java | 41 ++++++++++ .../listbuckets/SyncListBuckets_String.java | 41 ++++++++++ .../listhmackeys/AsyncListHmacKeys.java | 55 ++++++++++++++ .../listhmackeys/AsyncListHmacKeys_Paged.java | 62 +++++++++++++++ .../listhmackeys/SyncListHmacKeys.java | 51 +++++++++++++ .../SyncListHmacKeys_Projectname.java | 41 ++++++++++ .../listhmackeys/SyncListHmacKeys_String.java | 41 ++++++++++ .../AsyncListNotifications.java | 51 +++++++++++++ .../AsyncListNotifications_Paged.java | 59 ++++++++++++++ .../SyncListNotifications.java | 47 ++++++++++++ .../SyncListNotifications_Projectname.java | 41 ++++++++++ .../SyncListNotifications_String.java | 41 ++++++++++ .../listobjects/AsyncListObjects.java | 60 +++++++++++++++ .../listobjects/AsyncListObjects_Paged.java | 68 +++++++++++++++++ .../listobjects/SyncListObjects.java | 57 ++++++++++++++ .../SyncListObjects_Projectname.java | 41 ++++++++++ .../listobjects/SyncListObjects_String.java | 41 ++++++++++ .../AsyncLockBucketRetentionPolicy.java | 50 ++++++++++++ .../SyncLockBucketRetentionPolicy.java | 46 +++++++++++ ...cLockBucketRetentionPolicy_Bucketname.java | 39 ++++++++++ .../SyncLockBucketRetentionPolicy_String.java | 39 ++++++++++ .../AsyncQueryWriteStatus.java | 50 ++++++++++++ .../SyncQueryWriteStatus.java | 46 +++++++++++ .../SyncQueryWriteStatus_String.java | 38 ++++++++++ .../readobject/AsyncReadObject.java | 60 +++++++++++++++ .../rewriteobject/AsyncRewriteObject.java | 76 +++++++++++++++++++ .../rewriteobject/SyncRewriteObject.java | 73 ++++++++++++++++++ .../setiampolicy/AsyncSetIamPolicy.java | 49 ++++++++++++ .../setiampolicy/SyncSetIamPolicy.java | 46 +++++++++++ .../SyncSetIamPolicy_ResourcenamePolicy.java | 42 ++++++++++ .../SyncSetIamPolicy_StringPolicy.java | 41 ++++++++++ .../AsyncStartResumableWrite.java | 51 +++++++++++++ .../SyncStartResumableWrite.java | 47 ++++++++++++ .../AsyncTestIamPermissions.java | 51 +++++++++++++ .../SyncTestIamPermissions.java | 47 ++++++++++++ ...IamPermissions_ResourcenameListstring.java | 44 +++++++++++ ...ncTestIamPermissions_StringListstring.java | 43 +++++++++++ .../updatebucket/AsyncUpdateBucket.java | 55 ++++++++++++++ .../updatebucket/SyncUpdateBucket.java | 52 +++++++++++++ .../SyncUpdateBucket_BucketFieldmask.java | 40 ++++++++++ .../updatehmackey/AsyncUpdateHmacKey.java | 49 ++++++++++++ .../updatehmackey/SyncUpdateHmacKey.java | 46 +++++++++++ ...pdateHmacKey_HmackeymetadataFieldmask.java | 40 ++++++++++ .../updateobject/AsyncUpdateObject.java | 57 ++++++++++++++ .../updateobject/SyncUpdateObject.java | 54 +++++++++++++ .../SyncUpdateObject_ObjectFieldmask.java | 40 ++++++++++ .../writeobject/AsyncWriteObject.java | 69 +++++++++++++++++ .../deletebucket/SyncDeleteBucket.java | 45 +++++++++++ .../deletebucket/SyncDeleteBucket.java | 45 +++++++++++ .../com/google/storage/v2/BucketName.java | 0 .../com/google/storage/v2/CryptoKeyName.java | 0 .../com/google/storage/v2/MockStorage.java | 0 .../google/storage/v2/MockStorageImpl.java | 0 .../google/storage/v2/NotificationName.java | 0 .../com/google/storage/v2/ProjectName.java | 0 .../com/google/storage/v2/StorageClient.java | 0 .../google/storage/v2/StorageClientTest.java | 0 .../google/storage/v2/StorageSettings.java | 0 .../com/google/storage/v2/gapic_metadata.json | 0 .../com/google/storage/v2/package-info.java | 0 .../v2/stub/GrpcStorageCallableFactory.java | 0 .../storage/v2/stub/GrpcStorageStub.java | 0 .../google/storage/v2/stub/StorageStub.java | 0 .../storage/v2/stub/StorageStubSettings.java | 0 950 files changed, 34121 insertions(+) create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/AsyncAnalyzeIamPolicy.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/SyncAnalyzeIamPolicy.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/AsyncAnalyzeMove.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/SyncAnalyzeMove.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/AsyncBatchGetAssetsHistory.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/SyncBatchGetAssetsHistory.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/AsyncCreateFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/AsyncDeleteFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/SyncExportAssets.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/AsyncGetFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/AsyncListFeeds.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/AsyncUpdateFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java create mode 100644 test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/AssetServiceClient.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/AssetServiceClientTest.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/AssetServiceSettings.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/FeedName.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/MockAssetService.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/MockAssetServiceImpl.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/gapic_metadata.json (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/package-info.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/stub/AssetServiceStub.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java (100%) rename test/integration/goldens/asset/{ => src}/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java (100%) create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/AsyncCheckAndMutateRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/AsyncMutateRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterows/AsyncMutateRows.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/AsyncReadModifyWriteRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readrows/AsyncReadRows.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/samplerowkeys/AsyncSampleRowKeys.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java create mode 100644 test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java rename test/integration/goldens/bigtable/{ => src}/com/google/bigtable/v2/TableName.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/MockBigtable.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/gapic_metadata.json (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/package-info.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java (100%) rename test/integration/goldens/bigtable/{ => src}/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java (100%) create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/AsyncGet.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/AsyncWait.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java create mode 100644 test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/AddressesClient.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/AddressesClientTest.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/AddressesSettings.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/RegionOperationsClient.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/RegionOperationsClientTest.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/RegionOperationsSettings.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/gapic_metadata.json (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/package-info.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/AddressesStub.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java (100%) rename test/integration/goldens/compute/{ => src}/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java (100%) create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/AsyncGenerateAccessToken.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/AsyncGenerateIdToken.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/AsyncSignBlob.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/AsyncSignJwt.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java create mode 100644 test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/ServiceAccountName.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/gapic_metadata.json (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/package-info.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java (100%) rename test/integration/goldens/credentials/{ => src}/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java (100%) create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/IAMPolicyClient.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/IAMPolicyClientTest.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/IAMPolicySettings.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/MockIAMPolicy.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/MockIAMPolicyImpl.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/gapic_metadata.json (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/package-info.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/stub/GrpcIAMPolicyStub.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/stub/IAMPolicyStub.java (100%) rename test/integration/goldens/iam/{ => src}/com/google/iam/v1/stub/IAMPolicyStubSettings.java (100%) create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/AsyncAsymmetricDecrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/AsyncAsymmetricSign.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/AsyncCreateCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/AsyncCreateCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/AsyncCreateImportJob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/AsyncCreateKeyRing.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/AsyncDecrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/AsyncDestroyCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/AsyncEncrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/AsyncGetCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/AsyncGetCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/AsyncGetImportJob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/AsyncGetKeyRing.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/AsyncGetLocation.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/SyncGetLocation.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/AsyncGetPublicKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/AsyncImportCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/SyncImportCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/SyncListLocations.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/AsyncRestoreCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/AsyncUpdateCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/AsyncUpdateCryptoKeyPrimaryVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/AsyncUpdateCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java create mode 100644 test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/CryptoKeyName.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/CryptoKeyVersionName.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/ImportJobName.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/KeyManagementServiceClient.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/KeyManagementServiceSettings.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/KeyRingName.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/LocationName.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/MockKeyManagementService.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/gapic_metadata.json (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/package-info.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/location/MockLocations.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/cloud/location/MockLocationsImpl.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/iam/v1/MockIAMPolicy.java (100%) rename test/integration/goldens/kms/{ => src}/com/google/iam/v1/MockIAMPolicyImpl.java (100%) create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/AsyncCreateBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/AsyncCreateShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/AsyncDeleteBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/AsyncDeleteShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/AsyncGetBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/AsyncGetShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/SyncListShelves.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/AsyncMergeShelves.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/AsyncMoveBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/AsyncUpdateBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java create mode 100644 test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/LibraryServiceClient.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/LibraryServiceClientTest.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/LibraryServiceSettings.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/MockLibraryService.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/gapic_metadata.json (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/package-info.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java (100%) rename test/integration/goldens/library/{ => src}/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java (100%) rename test/integration/goldens/library/{ => src}/com/google/example/library/v1/BookName.java (100%) rename test/integration/goldens/library/{ => src}/com/google/example/library/v1/ShelfName.java (100%) create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/AsyncCreateBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/SyncCreateBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/AsyncCreateExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/AsyncCreateSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/AsyncCreateView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/SyncCreateView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/AsyncDeleteBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/SyncDeleteBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/AsyncDeleteExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/AsyncDeleteSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/AsyncDeleteView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/SyncDeleteView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/AsyncGetBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/SyncGetBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/AsyncGetCmekSettings.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/SyncGetCmekSettings.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/AsyncGetExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/AsyncGetSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/AsyncGetView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/SyncGetView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/AsyncUndeleteBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/SyncUndeleteBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/AsyncUpdateBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/SyncUpdateBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/AsyncUpdateCmekSettings.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/SyncUpdateCmekSettings.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/AsyncUpdateExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/AsyncUpdateSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/AsyncUpdateView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/SyncUpdateView.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/AsyncDeleteLog.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/taillogentries/AsyncTailLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/AsyncWriteLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/AsyncCreateLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/AsyncDeleteLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/AsyncGetLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/AsyncUpdateLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java create mode 100644 test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/ConfigClient.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/ConfigClientTest.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/ConfigSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/LoggingClient.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/LoggingClientTest.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/LoggingSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MetricsClient.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MetricsClientTest.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MetricsSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockConfigServiceV2.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockLoggingServiceV2.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockMetricsServiceV2.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/gapic_metadata.json (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/package-info.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/BillingAccountLocationName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/BillingAccountName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/CmekSettingsName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/FolderLocationName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/FolderName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LocationName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogBucketName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogExclusionName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogMetricName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogSinkName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/LogViewName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/OrganizationLocationName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/OrganizationName.java (100%) rename test/integration/goldens/logging/{ => src}/com/google/logging/v2/ProjectName.java (100%) create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/AsyncCreateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/AsyncDeleteSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/AsyncGetSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/AsyncValidateMessage.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/SyncValidateMessage.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/AsyncValidateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/AsyncAcknowledge.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/AsyncCreateSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/AsyncCreateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/AsyncDeleteSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/AsyncDeleteSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/AsyncGetSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/AsyncGetSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/AsyncModifyAckDeadline.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/AsyncModifyPushConfig.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/AsyncPull.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/AsyncSeek.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/SyncSeek.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/streamingpull/AsyncStreamingPull.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/AsyncUpdateSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/SyncUpdateSnapshot.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/AsyncUpdateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/SyncUpdateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/AsyncCreateTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/AsyncDeleteTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/AsyncDetachSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/SyncDetachSubscription.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/AsyncGetTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/AsyncPublish.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/AsyncUpdateTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/SyncUpdateTopic.java create mode 100644 test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockIAMPolicy.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockPublisher.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockPublisherImpl.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockSchemaService.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockSubscriber.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/MockSubscriberImpl.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SchemaServiceClient.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SchemaServiceSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/TopicAdminClient.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/TopicAdminClientTest.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/TopicAdminSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/gapic_metadata.json (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/package-info.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/PublisherStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/SubscriberStub.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/pubsub/v1/ProjectName.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/pubsub/v1/SchemaName.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/pubsub/v1/SnapshotName.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/pubsub/v1/SubscriptionName.java (100%) rename test/integration/goldens/pubsub/{ => src}/com/google/pubsub/v1/TopicName.java (100%) create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/AsyncGetInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/AsyncGetInstanceAuthString.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java create mode 100644 test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/CloudRedisClient.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/CloudRedisSettings.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/InstanceName.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/LocationName.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/MockCloudRedis.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/gapic_metadata.json (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/package-info.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java (100%) rename test/integration/goldens/redis/{ => src}/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java (100%) create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/AsyncComposeObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/SyncComposeObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/AsyncCreateBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/AsyncCreateHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/AsyncCreateNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/AsyncDeleteBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/AsyncDeleteHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/AsyncDeleteNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/AsyncDeleteObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/AsyncGetBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/AsyncGetHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/AsyncGetIamPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/AsyncGetNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/AsyncGetObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/AsyncGetServiceAccount.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/AsyncQueryWriteStatus.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/readobject/AsyncReadObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/AsyncRewriteObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/SyncRewriteObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/AsyncSetIamPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/AsyncStartResumableWrite.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/SyncStartResumableWrite.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/AsyncTestIamPermissions.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/AsyncUpdateBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/AsyncUpdateHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/AsyncUpdateObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/writeobject/AsyncWriteObject.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java create mode 100644 test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/BucketName.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/CryptoKeyName.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/MockStorage.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/MockStorageImpl.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/NotificationName.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/ProjectName.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/StorageClient.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/StorageClientTest.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/StorageSettings.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/gapic_metadata.json (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/package-info.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/stub/GrpcStorageCallableFactory.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/stub/GrpcStorageStub.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/stub/StorageStub.java (100%) rename test/integration/goldens/storage/{ => src}/com/google/storage/v2/stub/StorageStubSettings.java (100%) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/AsyncAnalyzeIamPolicy.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/AsyncAnalyzeIamPolicy.java new file mode 100644 index 0000000000..7fb350edfb --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/AsyncAnalyzeIamPolicy.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzeiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicyAnalysisQuery; +import com.google.protobuf.Duration; + +public class AsyncAnalyzeIamPolicy { + + public static void main(String[] args) throws Exception { + asyncAnalyzeIamPolicy(); + } + + public static void asyncAnalyzeIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); + ApiFuture future = + assetServiceClient.analyzeIamPolicyCallable().futureCall(request); + // Do something. + AnalyzeIamPolicyResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzeiampolicy_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/SyncAnalyzeIamPolicy.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/SyncAnalyzeIamPolicy.java new file mode 100644 index 0000000000..a157a49163 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicy/SyncAnalyzeIamPolicy.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzeiampolicy_sync] +import com.google.cloud.asset.v1.AnalyzeIamPolicyRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyResponse; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicyAnalysisQuery; +import com.google.protobuf.Duration; + +public class SyncAnalyzeIamPolicy { + + public static void main(String[] args) throws Exception { + syncAnalyzeIamPolicy(); + } + + public static void syncAnalyzeIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeIamPolicyRequest request = + AnalyzeIamPolicyRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setExecutionTimeout(Duration.newBuilder().build()) + .build(); + AnalyzeIamPolicyResponse response = assetServiceClient.analyzeIamPolicy(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzeiampolicy_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.java new file mode 100644 index 0000000000..d3b7143ebc --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; +import com.google.cloud.asset.v1.IamPolicyAnalysisQuery; +import com.google.longrunning.Operation; + +public class AsyncAnalyzeIamPolicyLongrunning { + + public static void main(String[] args) throws Exception { + asyncAnalyzeIamPolicyLongrunning(); + } + + public static void asyncAnalyzeIamPolicyLongrunning() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeIamPolicyLongrunningRequest request = + AnalyzeIamPolicyLongrunningRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + ApiFuture future = + assetServiceClient.analyzeIamPolicyLongrunningCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.java new file mode 100644 index 0000000000..fc6d179624 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; +import com.google.cloud.asset.v1.IamPolicyAnalysisQuery; + +public class AsyncAnalyzeIamPolicyLongrunningLRO { + + public static void main(String[] args) throws Exception { + asyncAnalyzeIamPolicyLongrunningLRO(); + } + + public static void asyncAnalyzeIamPolicyLongrunningLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeIamPolicyLongrunningRequest request = + AnalyzeIamPolicyLongrunningRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + OperationFuture + future = + assetServiceClient.analyzeIamPolicyLongrunningOperationCallable().futureCall(request); + // Do something. + AnalyzeIamPolicyLongrunningResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_lro_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.java new file mode 100644 index 0000000000..7b0aa38840 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/SyncAnalyzeIamPolicyLongrunning.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_sync] +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; +import com.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; +import com.google.cloud.asset.v1.IamPolicyAnalysisQuery; + +public class SyncAnalyzeIamPolicyLongrunning { + + public static void main(String[] args) throws Exception { + syncAnalyzeIamPolicyLongrunning(); + } + + public static void syncAnalyzeIamPolicyLongrunning() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeIamPolicyLongrunningRequest request = + AnalyzeIamPolicyLongrunningRequest.newBuilder() + .setAnalysisQuery(IamPolicyAnalysisQuery.newBuilder().build()) + .setOutputConfig(IamPolicyAnalysisOutputConfig.newBuilder().build()) + .build(); + AnalyzeIamPolicyLongrunningResponse response = + assetServiceClient.analyzeIamPolicyLongrunningAsync(request).get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzeiampolicylongrunning_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/AsyncAnalyzeMove.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/AsyncAnalyzeMove.java new file mode 100644 index 0000000000..5ff6e4af46 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/AsyncAnalyzeMove.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzemove_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AnalyzeMoveRequest; +import com.google.cloud.asset.v1.AnalyzeMoveResponse; +import com.google.cloud.asset.v1.AssetServiceClient; + +public class AsyncAnalyzeMove { + + public static void main(String[] args) throws Exception { + asyncAnalyzeMove(); + } + + public static void asyncAnalyzeMove() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-341064690") + .setDestinationParent("destinationParent-1733659048") + .build(); + ApiFuture future = + assetServiceClient.analyzeMoveCallable().futureCall(request); + // Do something. + AnalyzeMoveResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzemove_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/SyncAnalyzeMove.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/SyncAnalyzeMove.java new file mode 100644 index 0000000000..ee4c6de6a3 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzemove/SyncAnalyzeMove.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_analyzemove_sync] +import com.google.cloud.asset.v1.AnalyzeMoveRequest; +import com.google.cloud.asset.v1.AnalyzeMoveResponse; +import com.google.cloud.asset.v1.AssetServiceClient; + +public class SyncAnalyzeMove { + + public static void main(String[] args) throws Exception { + syncAnalyzeMove(); + } + + public static void syncAnalyzeMove() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + AnalyzeMoveRequest request = + AnalyzeMoveRequest.newBuilder() + .setResource("resource-341064690") + .setDestinationParent("destinationParent-1733659048") + .build(); + AnalyzeMoveResponse response = assetServiceClient.analyzeMove(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_analyzemove_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/AsyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/AsyncBatchGetAssetsHistory.java new file mode 100644 index 0000000000..2686566215 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/AsyncBatchGetAssetsHistory.java @@ -0,0 +1,54 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_batchgetassetshistory_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.TimeWindow; +import java.util.ArrayList; + +public class AsyncBatchGetAssetsHistory { + + public static void main(String[] args) throws Exception { + asyncBatchGetAssetsHistory(); + } + + public static void asyncBatchGetAssetsHistory() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + BatchGetAssetsHistoryRequest request = + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + ApiFuture future = + assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request); + // Do something. + BatchGetAssetsHistoryResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_batchgetassetshistory_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/SyncBatchGetAssetsHistory.java new file mode 100644 index 0000000000..95939b8ef9 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/batchgetassetshistory/SyncBatchGetAssetsHistory.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_batchgetassetshistory_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.TimeWindow; +import java.util.ArrayList; + +public class SyncBatchGetAssetsHistory { + + public static void main(String[] args) throws Exception { + syncBatchGetAssetsHistory(); + } + + public static void syncBatchGetAssetsHistory() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + BatchGetAssetsHistoryRequest request = + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .addAllAssetNames(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setReadTimeWindow(TimeWindow.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_batchgetassetshistory_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..70b2503fb4 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.AssetServiceSettings; +import com.google.cloud.asset.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. + AssetServiceSettings assetServiceSettings = + AssetServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + } +} +// [END asset_v1_generated_assetserviceclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..73e93fda06 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_create_setendpoint_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.AssetServiceSettings; +import com.google.cloud.asset.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. + AssetServiceSettings assetServiceSettings = + AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + } +} +// [END asset_v1_generated_assetserviceclient_create_setendpoint_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/AsyncCreateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/AsyncCreateFeed.java new file mode 100644 index 0000000000..d9c447036d --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/AsyncCreateFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_createfeed_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.Feed; + +public class AsyncCreateFeed { + + public static void main(String[] args) throws Exception { + asyncCreateFeed(); + } + + public static void asyncCreateFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + CreateFeedRequest request = + CreateFeedRequest.newBuilder() + .setParent("parent-995424086") + .setFeedId("feedId-1278410919") + .setFeed(Feed.newBuilder().build()) + .build(); + ApiFuture future = assetServiceClient.createFeedCallable().futureCall(request); + // Do something. + Feed response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_createfeed_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed.java new file mode 100644 index 0000000000..1325bacda8 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_createfeed_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.CreateFeedRequest; +import com.google.cloud.asset.v1.Feed; + +public class SyncCreateFeed { + + public static void main(String[] args) throws Exception { + syncCreateFeed(); + } + + public static void syncCreateFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + CreateFeedRequest request = + CreateFeedRequest.newBuilder() + .setParent("parent-995424086") + .setFeedId("feedId-1278410919") + .setFeed(Feed.newBuilder().build()) + .build(); + Feed response = assetServiceClient.createFeed(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_createfeed_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.java new file mode 100644 index 0000000000..e02c8fa458 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_createfeed_string_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; + +public class SyncCreateFeedString { + + public static void main(String[] args) throws Exception { + syncCreateFeedString(); + } + + public static void syncCreateFeedString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String parent = "parent-995424086"; + Feed response = assetServiceClient.createFeed(parent); + } + } +} +// [END asset_v1_generated_assetserviceclient_createfeed_string_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/AsyncDeleteFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/AsyncDeleteFeed.java new file mode 100644 index 0000000000..e279683025 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/AsyncDeleteFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_deletefeed_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.FeedName; +import com.google.protobuf.Empty; + +public class AsyncDeleteFeed { + + public static void main(String[] args) throws Exception { + asyncDeleteFeed(); + } + + public static void asyncDeleteFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + DeleteFeedRequest request = + DeleteFeedRequest.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .build(); + ApiFuture future = assetServiceClient.deleteFeedCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_deletefeed_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed.java new file mode 100644 index 0000000000..a9ec6bfe46 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_deletefeed_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.DeleteFeedRequest; +import com.google.cloud.asset.v1.FeedName; +import com.google.protobuf.Empty; + +public class SyncDeleteFeed { + + public static void main(String[] args) throws Exception { + syncDeleteFeed(); + } + + public static void syncDeleteFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + DeleteFeedRequest request = + DeleteFeedRequest.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .build(); + assetServiceClient.deleteFeed(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_deletefeed_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.java new file mode 100644 index 0000000000..11d453448e --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_deletefeed_feedname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FeedName; +import com.google.protobuf.Empty; + +public class SyncDeleteFeedFeedname { + + public static void main(String[] args) throws Exception { + syncDeleteFeedFeedname(); + } + + public static void syncDeleteFeedFeedname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + assetServiceClient.deleteFeed(name); + } + } +} +// [END asset_v1_generated_assetserviceclient_deletefeed_feedname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.java new file mode 100644 index 0000000000..2477cd5548 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_deletefeed_string_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FeedName; +import com.google.protobuf.Empty; + +public class SyncDeleteFeedString { + + public static void main(String[] args) throws Exception { + syncDeleteFeedString(); + } + + public static void syncDeleteFeedString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString(); + assetServiceClient.deleteFeed(name); + } + } +} +// [END asset_v1_generated_assetserviceclient_deletefeed_string_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets.java new file mode 100644 index 0000000000..1e360ad76e --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets.java @@ -0,0 +1,55 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_exportassets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.ExportAssetsRequest; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.OutputConfig; +import com.google.longrunning.Operation; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class AsyncExportAssets { + + public static void main(String[] args) throws Exception { + asyncExportAssets(); + } + + public static void asyncExportAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + ApiFuture future = assetServiceClient.exportAssetsCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_exportassets_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java new file mode 100644 index 0000000000..8c61111f0e --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java @@ -0,0 +1,56 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_exportassets_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.ExportAssetsRequest; +import com.google.cloud.asset.v1.ExportAssetsResponse; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.OutputConfig; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class AsyncExportAssetsLRO { + + public static void main(String[] args) throws Exception { + asyncExportAssetsLRO(); + } + + public static void asyncExportAssetsLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + OperationFuture future = + assetServiceClient.exportAssetsOperationCallable().futureCall(request); + // Do something. + ExportAssetsResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_exportassets_lro_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/SyncExportAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/SyncExportAssets.java new file mode 100644 index 0000000000..9e6a761656 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/SyncExportAssets.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_exportassets_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.ExportAssetsRequest; +import com.google.cloud.asset.v1.ExportAssetsResponse; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.OutputConfig; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class SyncExportAssets { + + public static void main(String[] args) throws Exception { + syncExportAssets(); + } + + public static void syncExportAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_exportassets_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/AsyncGetFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/AsyncGetFeed.java new file mode 100644 index 0000000000..d4599664a9 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/AsyncGetFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_getfeed_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.GetFeedRequest; + +public class AsyncGetFeed { + + public static void main(String[] args) throws Exception { + asyncGetFeed(); + } + + public static void asyncGetFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + GetFeedRequest request = + GetFeedRequest.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .build(); + ApiFuture future = assetServiceClient.getFeedCallable().futureCall(request); + // Do something. + Feed response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_getfeed_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed.java new file mode 100644 index 0000000000..528af4aecb --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_getfeed_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.GetFeedRequest; + +public class SyncGetFeed { + + public static void main(String[] args) throws Exception { + syncGetFeed(); + } + + public static void syncGetFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + GetFeedRequest request = + GetFeedRequest.newBuilder() + .setName(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .build(); + Feed response = assetServiceClient.getFeed(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_getfeed_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.java new file mode 100644 index 0000000000..1a690bf442 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_getfeed_feedname_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.FeedName; + +public class SyncGetFeedFeedname { + + public static void main(String[] args) throws Exception { + syncGetFeedFeedname(); + } + + public static void syncGetFeedFeedname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + Feed response = assetServiceClient.getFeed(name); + } + } +} +// [END asset_v1_generated_assetserviceclient_getfeed_feedname_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.java new file mode 100644 index 0000000000..5a9974201f --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_getfeed_string_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.FeedName; + +public class SyncGetFeedString { + + public static void main(String[] args) throws Exception { + syncGetFeedString(); + } + + public static void syncGetFeedString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString(); + Feed response = assetServiceClient.getFeed(name); + } + } +} +// [END asset_v1_generated_assetserviceclient_getfeed_string_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets.java new file mode 100644 index 0000000000..fd9e49d725 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets.java @@ -0,0 +1,57 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listassets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.Asset; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.ListAssetsRequest; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class AsyncListAssets { + + public static void main(String[] args) throws Exception { + asyncListAssets(); + } + + public static void asyncListAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllRelationshipTypes(new ArrayList()) + .build(); + ApiFuture future = assetServiceClient.listAssetsPagedCallable().futureCall(request); + // Do something. + for (Asset element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_listassets_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java new file mode 100644 index 0000000000..45b9ec9187 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java @@ -0,0 +1,65 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listassets_paged_async] +import com.google.cloud.asset.v1.Asset; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.ListAssetsRequest; +import com.google.cloud.asset.v1.ListAssetsResponse; +import com.google.common.base.Strings; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class AsyncListAssetsPaged { + + public static void main(String[] args) throws Exception { + asyncListAssetsPaged(); + } + + public static void asyncListAssetsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllRelationshipTypes(new ArrayList()) + .build(); + while (true) { + ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request); + for (Asset element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END asset_v1_generated_assetserviceclient_listassets_paged_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets.java new file mode 100644 index 0000000000..32b5dbbe32 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets.java @@ -0,0 +1,54 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listassets_sync] +import com.google.cloud.asset.v1.Asset; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ContentType; +import com.google.cloud.asset.v1.FeedName; +import com.google.cloud.asset.v1.ListAssetsRequest; +import com.google.protobuf.Timestamp; +import java.util.ArrayList; + +public class SyncListAssets { + + public static void main(String[] args) throws Exception { + syncListAssets(); + } + + public static void syncListAssets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllRelationshipTypes(new ArrayList()) + .build(); + for (Asset element : assetServiceClient.listAssets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_listassets_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java new file mode 100644 index 0000000000..49a04678a1 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java @@ -0,0 +1,42 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listassets_resourcename_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.asset.v1.Asset; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FeedName; + +public class SyncListAssetsResourcename { + + public static void main(String[] args) throws Exception { + syncListAssetsResourcename(); + } + + public static void syncListAssetsResourcename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ResourceName parent = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]"); + for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_listassets_resourcename_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.java new file mode 100644 index 0000000000..b8ef3a25f7 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listassets_string_sync] +import com.google.cloud.asset.v1.Asset; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.FeedName; + +public class SyncListAssetsString { + + public static void main(String[] args) throws Exception { + syncListAssetsString(); + } + + public static void syncListAssetsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String parent = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]").toString(); + for (Asset element : assetServiceClient.listAssets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_listassets_string_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/AsyncListFeeds.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/AsyncListFeeds.java new file mode 100644 index 0000000000..572fd6c164 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/AsyncListFeeds.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listfeeds_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListFeedsRequest; +import com.google.cloud.asset.v1.ListFeedsResponse; + +public class AsyncListFeeds { + + public static void main(String[] args) throws Exception { + asyncListFeeds(); + } + + public static void asyncListFeeds() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListFeedsRequest request = + ListFeedsRequest.newBuilder().setParent("parent-995424086").build(); + ApiFuture future = + assetServiceClient.listFeedsCallable().futureCall(request); + // Do something. + ListFeedsResponse response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_listfeeds_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds.java new file mode 100644 index 0000000000..a53be62fe1 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listfeeds_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListFeedsRequest; +import com.google.cloud.asset.v1.ListFeedsResponse; + +public class SyncListFeeds { + + public static void main(String[] args) throws Exception { + syncListFeeds(); + } + + public static void syncListFeeds() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + ListFeedsRequest request = + ListFeedsRequest.newBuilder().setParent("parent-995424086").build(); + ListFeedsResponse response = assetServiceClient.listFeeds(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_listfeeds_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.java new file mode 100644 index 0000000000..a5f1a7afd0 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_listfeeds_string_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ListFeedsResponse; + +public class SyncListFeedsString { + + public static void main(String[] args) throws Exception { + syncListFeedsString(); + } + + public static void syncListFeedsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String parent = "parent-995424086"; + ListFeedsResponse response = assetServiceClient.listFeeds(parent); + } + } +} +// [END asset_v1_generated_assetserviceclient_listfeeds_string_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies.java new file mode 100644 index 0000000000..d45ededa0f --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies.java @@ -0,0 +1,54 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchalliampolicies_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicySearchResult; +import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; +import java.util.ArrayList; + +public class AsyncSearchAllIamPolicies { + + public static void main(String[] args) throws Exception { + asyncSearchAllIamPolicies(); + } + + public static void asyncSearchAllIamPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllIamPoliciesRequest request = + SearchAllIamPoliciesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllAssetTypes(new ArrayList()) + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + assetServiceClient.searchAllIamPoliciesPagedCallable().futureCall(request); + // Do something. + for (IamPolicySearchResult element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchalliampolicies_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java new file mode 100644 index 0000000000..117fc663cd --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java @@ -0,0 +1,62 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchalliampolicies_paged_async] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicySearchResult; +import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; +import com.google.cloud.asset.v1.SearchAllIamPoliciesResponse; +import com.google.common.base.Strings; +import java.util.ArrayList; + +public class AsyncSearchAllIamPoliciesPaged { + + public static void main(String[] args) throws Exception { + asyncSearchAllIamPoliciesPaged(); + } + + public static void asyncSearchAllIamPoliciesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllIamPoliciesRequest request = + SearchAllIamPoliciesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllAssetTypes(new ArrayList()) + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + SearchAllIamPoliciesResponse response = + assetServiceClient.searchAllIamPoliciesCallable().call(request); + for (IamPolicySearchResult element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchalliampolicies_paged_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies.java new file mode 100644 index 0000000000..e2435d6d3a --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchalliampolicies_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicySearchResult; +import com.google.cloud.asset.v1.SearchAllIamPoliciesRequest; +import java.util.ArrayList; + +public class SyncSearchAllIamPolicies { + + public static void main(String[] args) throws Exception { + syncSearchAllIamPolicies(); + } + + public static void syncSearchAllIamPolicies() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllIamPoliciesRequest request = + SearchAllIamPoliciesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllAssetTypes(new ArrayList()) + .setOrderBy("orderBy-1207110587") + .build(); + for (IamPolicySearchResult element : + assetServiceClient.searchAllIamPolicies(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchalliampolicies_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java new file mode 100644 index 0000000000..0cccfb6e15 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java @@ -0,0 +1,42 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchalliampolicies_stringstring_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.IamPolicySearchResult; + +public class SyncSearchAllIamPoliciesStringString { + + public static void main(String[] args) throws Exception { + syncSearchAllIamPoliciesStringString(); + } + + public static void syncSearchAllIamPoliciesStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String scope = "scope109264468"; + String query = "query107944136"; + for (IamPolicySearchResult element : + assetServiceClient.searchAllIamPolicies(scope, query).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchalliampolicies_stringstring_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources.java new file mode 100644 index 0000000000..9f0cec76cd --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources.java @@ -0,0 +1,56 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchallresources_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ResourceSearchResult; +import com.google.cloud.asset.v1.SearchAllResourcesRequest; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class AsyncSearchAllResources { + + public static void main(String[] args) throws Exception { + asyncSearchAllResources(); + } + + public static void asyncSearchAllResources() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllResourcesRequest request = + SearchAllResourcesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .addAllAssetTypes(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setReadMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + assetServiceClient.searchAllResourcesPagedCallable().futureCall(request); + // Do something. + for (ResourceSearchResult element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchallresources_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java new file mode 100644 index 0000000000..b3758e5abb --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java @@ -0,0 +1,64 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchallresources_paged_async] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ResourceSearchResult; +import com.google.cloud.asset.v1.SearchAllResourcesRequest; +import com.google.cloud.asset.v1.SearchAllResourcesResponse; +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class AsyncSearchAllResourcesPaged { + + public static void main(String[] args) throws Exception { + asyncSearchAllResourcesPaged(); + } + + public static void asyncSearchAllResourcesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllResourcesRequest request = + SearchAllResourcesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .addAllAssetTypes(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setReadMask(FieldMask.newBuilder().build()) + .build(); + while (true) { + SearchAllResourcesResponse response = + assetServiceClient.searchAllResourcesCallable().call(request); + for (ResourceSearchResult element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchallresources_paged_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources.java new file mode 100644 index 0000000000..cff5d56c66 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources.java @@ -0,0 +1,53 @@ +/* + * 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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchallresources_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ResourceSearchResult; +import com.google.cloud.asset.v1.SearchAllResourcesRequest; +import com.google.protobuf.FieldMask; +import java.util.ArrayList; + +public class SyncSearchAllResources { + + public static void main(String[] args) throws Exception { + syncSearchAllResources(); + } + + public static void syncSearchAllResources() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + SearchAllResourcesRequest request = + SearchAllResourcesRequest.newBuilder() + .setScope("scope109264468") + .setQuery("query107944136") + .addAllAssetTypes(new ArrayList()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setOrderBy("orderBy-1207110587") + .setReadMask(FieldMask.newBuilder().build()) + .build(); + for (ResourceSearchResult element : + assetServiceClient.searchAllResources(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchallresources_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.java new file mode 100644 index 0000000000..aa23171f38 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_searchallresources_stringstringliststring_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.ResourceSearchResult; +import java.util.ArrayList; +import java.util.List; + +public class SyncSearchAllResourcesStringStringListstring { + + public static void main(String[] args) throws Exception { + syncSearchAllResourcesStringStringListstring(); + } + + public static void syncSearchAllResourcesStringStringListstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + String scope = "scope109264468"; + String query = "query107944136"; + List assetTypes = new ArrayList<>(); + for (ResourceSearchResult element : + assetServiceClient.searchAllResources(scope, query, assetTypes).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END asset_v1_generated_assetserviceclient_searchallresources_stringstringliststring_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/AsyncUpdateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/AsyncUpdateFeed.java new file mode 100644 index 0000000000..b114d7831b --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/AsyncUpdateFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_updatefeed_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.UpdateFeedRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateFeed { + + public static void main(String[] args) throws Exception { + asyncUpdateFeed(); + } + + public static void asyncUpdateFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + UpdateFeedRequest request = + UpdateFeedRequest.newBuilder() + .setFeed(Feed.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = assetServiceClient.updateFeedCallable().futureCall(request); + // Do something. + Feed response = future.get(); + } + } +} +// [END asset_v1_generated_assetserviceclient_updatefeed_async] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed.java new file mode 100644 index 0000000000..76211f58e9 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_updatefeed_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; +import com.google.cloud.asset.v1.UpdateFeedRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateFeed { + + public static void main(String[] args) throws Exception { + syncUpdateFeed(); + } + + public static void syncUpdateFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + UpdateFeedRequest request = + UpdateFeedRequest.newBuilder() + .setFeed(Feed.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Feed response = assetServiceClient.updateFeed(request); + } + } +} +// [END asset_v1_generated_assetserviceclient_updatefeed_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.java new file mode 100644 index 0000000000..a3b8464116 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.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.asset.v1.samples; + +// [START asset_v1_generated_assetserviceclient_updatefeed_feed_sync] +import com.google.cloud.asset.v1.AssetServiceClient; +import com.google.cloud.asset.v1.Feed; + +public class SyncUpdateFeedFeed { + + public static void main(String[] args) throws Exception { + syncUpdateFeedFeed(); + } + + public static void syncUpdateFeedFeed() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + Feed feed = Feed.newBuilder().build(); + Feed response = assetServiceClient.updateFeed(feed); + } + } +} +// [END asset_v1_generated_assetserviceclient_updatefeed_feed_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java new file mode 100644 index 0000000000..b405d726e7 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetservicesettings/batchgetassetshistory/SyncBatchGetAssetsHistory.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.asset.v1.samples; + +// [START asset_v1_generated_assetservicesettings_batchgetassetshistory_sync] +import com.google.cloud.asset.v1.AssetServiceSettings; +import java.time.Duration; + +public class SyncBatchGetAssetsHistory { + + public static void main(String[] args) throws Exception { + syncBatchGetAssetsHistory(); + } + + public static void syncBatchGetAssetsHistory() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder(); + assetServiceSettingsBuilder + .batchGetAssetsHistorySettings() + .setRetrySettings( + assetServiceSettingsBuilder + .batchGetAssetsHistorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); + } +} +// [END asset_v1_generated_assetservicesettings_batchgetassetshistory_sync] diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.java new file mode 100644 index 0000000000..f6e4d0f476 --- /dev/null +++ b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/stub/assetservicestubsettings/batchgetassetshistory/SyncBatchGetAssetsHistory.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.asset.v1.stub.samples; + +// [START asset_v1_generated_assetservicestubsettings_batchgetassetshistory_sync] +import com.google.cloud.asset.v1.stub.AssetServiceStubSettings; +import java.time.Duration; + +public class SyncBatchGetAssetsHistory { + + public static void main(String[] args) throws Exception { + syncBatchGetAssetsHistory(); + } + + public static void syncBatchGetAssetsHistory() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AssetServiceStubSettings.Builder assetServiceSettingsBuilder = + AssetServiceStubSettings.newBuilder(); + assetServiceSettingsBuilder + .batchGetAssetsHistorySettings() + .setRetrySettings( + assetServiceSettingsBuilder + .batchGetAssetsHistorySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); + } +} +// [END asset_v1_generated_assetservicestubsettings_batchgetassetshistory_sync] diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClient.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClient.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceClientTest.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceClientTest.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/AssetServiceSettings.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/AssetServiceSettings.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/FeedName.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/FeedName.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/FeedName.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetService.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetService.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetService.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/MockAssetServiceImpl.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/MockAssetServiceImpl.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/gapic_metadata.json rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/gapic_metadata.json diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/package-info.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/package-info.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStub.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStub.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java diff --git a/test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java b/test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java similarity index 100% rename from test/integration/goldens/asset/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java rename to test/integration/goldens/asset/src/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/AsyncCheckAndMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/AsyncCheckAndMutateRow.java new file mode 100644 index 0000000000..bd73f4cd89 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/AsyncCheckAndMutateRow.java @@ -0,0 +1,56 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_async] +import com.google.api.core.ApiFuture; +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncCheckAndMutateRow { + + public static void main(String[] args) throws Exception { + asyncCheckAndMutateRow(); + } + + public static void asyncCheckAndMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + CheckAndMutateRowRequest request = + CheckAndMutateRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .setPredicateFilter(RowFilter.newBuilder().build()) + .addAllTrueMutations(new ArrayList()) + .addAllFalseMutations(new ArrayList()) + .build(); + ApiFuture future = + baseBigtableDataClient.checkAndMutateRowCallable().futureCall(request); + // Do something. + CheckAndMutateRowResponse response = future.get(); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow.java new file mode 100644 index 0000000000..0033ec5489 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_sync] +import com.google.bigtable.v2.CheckAndMutateRowRequest; +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncCheckAndMutateRow { + + public static void main(String[] args) throws Exception { + syncCheckAndMutateRow(); + } + + public static void syncCheckAndMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + CheckAndMutateRowRequest request = + CheckAndMutateRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .setPredicateFilter(RowFilter.newBuilder().build()) + .addAllTrueMutations(new ArrayList()) + .addAllFalseMutations(new ArrayList()) + .build(); + CheckAndMutateRowResponse response = baseBigtableDataClient.checkAndMutateRow(request); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java new file mode 100644 index 0000000000..3a2de693b6 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_stringbytestringrowfilterlistmutationlistmutation_sync] +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation { + + public static void main(String[] args) throws Exception { + syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation(); + } + + public static void syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + RowFilter predicateFilter = RowFilter.newBuilder().build(); + List trueMutations = new ArrayList<>(); + List falseMutations = new ArrayList<>(); + CheckAndMutateRowResponse response = + baseBigtableDataClient.checkAndMutateRow( + tableName, rowKey, predicateFilter, trueMutations, falseMutations); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_stringbytestringrowfilterlistmutationlistmutation_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java new file mode 100644 index 0000000000..c1990c3ce7 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_stringbytestringrowfilterlistmutationlistmutationstring_sync] +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString { + + public static void main(String[] args) throws Exception { + syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString(); + } + + public static void syncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + RowFilter predicateFilter = RowFilter.newBuilder().build(); + List trueMutations = new ArrayList<>(); + List falseMutations = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + CheckAndMutateRowResponse response = + baseBigtableDataClient.checkAndMutateRow( + tableName, rowKey, predicateFilter, trueMutations, falseMutations, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_stringbytestringrowfilterlistmutationlistmutationstring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java new file mode 100644 index 0000000000..bc744a3d4a --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_tablenamebytestringrowfilterlistmutationlistmutation_sync] +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation { + + public static void main(String[] args) throws Exception { + syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation(); + } + + public static void syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + RowFilter predicateFilter = RowFilter.newBuilder().build(); + List trueMutations = new ArrayList<>(); + List falseMutations = new ArrayList<>(); + CheckAndMutateRowResponse response = + baseBigtableDataClient.checkAndMutateRow( + tableName, rowKey, predicateFilter, trueMutations, falseMutations); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_tablenamebytestringrowfilterlistmutationlistmutation_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java new file mode 100644 index 0000000000..b2566676db --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java @@ -0,0 +1,53 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_tablenamebytestringrowfilterlistmutationlistmutationstring_sync] +import com.google.bigtable.v2.CheckAndMutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString { + + public static void main(String[] args) throws Exception { + syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString(); + } + + public static void + syncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + RowFilter predicateFilter = RowFilter.newBuilder().build(); + List trueMutations = new ArrayList<>(); + List falseMutations = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + CheckAndMutateRowResponse response = + baseBigtableDataClient.checkAndMutateRow( + tableName, rowKey, predicateFilter, trueMutations, falseMutations, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_checkandmutaterow_tablenamebytestringrowfilterlistmutationlistmutationstring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..c33d76d8c9 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataSettings; +import com.google.cloud.bigtable.data.v2.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. + BaseBigtableDataSettings baseBigtableDataSettings = + BaseBigtableDataSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + BaseBigtableDataClient baseBigtableDataClient = + BaseBigtableDataClient.create(baseBigtableDataSettings); + } +} +// [END bigtable_v2_generated_basebigtabledataclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..63377caba5 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_create_setendpoint_sync] +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataSettings; +import com.google.cloud.bigtable.data.v2.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. + BaseBigtableDataSettings baseBigtableDataSettings = + BaseBigtableDataSettings.newBuilder().setEndpoint(myEndpoint).build(); + BaseBigtableDataClient baseBigtableDataClient = + BaseBigtableDataClient.create(baseBigtableDataSettings); + } +} +// [END bigtable_v2_generated_basebigtabledataclient_create_setendpoint_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/AsyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/AsyncMutateRow.java new file mode 100644 index 0000000000..3b28ceabdc --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/AsyncMutateRow.java @@ -0,0 +1,53 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_async] +import com.google.api.core.ApiFuture; +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncMutateRow { + + public static void main(String[] args) throws Exception { + asyncMutateRow(); + } + + public static void asyncMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + MutateRowRequest request = + MutateRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .addAllMutations(new ArrayList()) + .build(); + ApiFuture future = + baseBigtableDataClient.mutateRowCallable().futureCall(request); + // Do something. + MutateRowResponse response = future.get(); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow.java new file mode 100644 index 0000000000..2fd3a4aa7a --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_sync] +import com.google.bigtable.v2.MutateRowRequest; +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncMutateRow { + + public static void main(String[] args) throws Exception { + syncMutateRow(); + } + + public static void syncMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + MutateRowRequest request = + MutateRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .addAllMutations(new ArrayList()) + .build(); + MutateRowResponse response = baseBigtableDataClient.mutateRow(request); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.java new file mode 100644 index 0000000000..3c620270ef --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_stringbytestringlistmutation_sync] +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncMutateRowStringBytestringListmutation { + + public static void main(String[] args) throws Exception { + syncMutateRowStringBytestringListmutation(); + } + + public static void syncMutateRowStringBytestringListmutation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + List mutations = new ArrayList<>(); + MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_stringbytestringlistmutation_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.java new file mode 100644 index 0000000000..2af6ce2f6a --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_stringbytestringlistmutationstring_sync] +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncMutateRowStringBytestringListmutationString { + + public static void main(String[] args) throws Exception { + syncMutateRowStringBytestringListmutationString(); + } + + public static void syncMutateRowStringBytestringListmutationString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + List mutations = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + MutateRowResponse response = + baseBigtableDataClient.mutateRow(tableName, rowKey, mutations, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_stringbytestringlistmutationstring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.java new file mode 100644 index 0000000000..3aa593d98e --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_tablenamebytestringlistmutation_sync] +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncMutateRowTablenameBytestringListmutation { + + public static void main(String[] args) throws Exception { + syncMutateRowTablenameBytestringListmutation(); + } + + public static void syncMutateRowTablenameBytestringListmutation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + List mutations = new ArrayList<>(); + MutateRowResponse response = baseBigtableDataClient.mutateRow(tableName, rowKey, mutations); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_tablenamebytestringlistmutation_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.java new file mode 100644 index 0000000000..e3e2cce304 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterow_tablenamebytestringlistmutationstring_sync] +import com.google.bigtable.v2.MutateRowResponse; +import com.google.bigtable.v2.Mutation; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncMutateRowTablenameBytestringListmutationString { + + public static void main(String[] args) throws Exception { + syncMutateRowTablenameBytestringListmutationString(); + } + + public static void syncMutateRowTablenameBytestringListmutationString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + List mutations = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + MutateRowResponse response = + baseBigtableDataClient.mutateRow(tableName, rowKey, mutations, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterow_tablenamebytestringlistmutationstring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterows/AsyncMutateRows.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterows/AsyncMutateRows.java new file mode 100644 index 0000000000..2210241324 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterows/AsyncMutateRows.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_mutaterows_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.MutateRowsRequest; +import com.google.bigtable.v2.MutateRowsResponse; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import java.util.ArrayList; + +public class AsyncMutateRows { + + public static void main(String[] args) throws Exception { + asyncMutateRows(); + } + + public static void asyncMutateRows() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + MutateRowsRequest request = + MutateRowsRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .addAllEntries(new ArrayList()) + .build(); + ServerStream stream = + baseBigtableDataClient.mutateRowsCallable().call(request); + for (MutateRowsResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_mutaterows_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/AsyncReadModifyWriteRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/AsyncReadModifyWriteRow.java new file mode 100644 index 0000000000..8355d646e3 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/AsyncReadModifyWriteRow.java @@ -0,0 +1,53 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_async] +import com.google.api.core.ApiFuture; +import com.google.bigtable.v2.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncReadModifyWriteRow { + + public static void main(String[] args) throws Exception { + asyncReadModifyWriteRow(); + } + + public static void asyncReadModifyWriteRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + ReadModifyWriteRowRequest request = + ReadModifyWriteRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .addAllRules(new ArrayList()) + .build(); + ApiFuture future = + baseBigtableDataClient.readModifyWriteRowCallable().futureCall(request); + // Do something. + ReadModifyWriteRowResponse response = future.get(); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow.java new file mode 100644 index 0000000000..fe5e913e45 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_sync] +import com.google.bigtable.v2.ReadModifyWriteRowRequest; +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncReadModifyWriteRow { + + public static void main(String[] args) throws Exception { + syncReadModifyWriteRow(); + } + + public static void syncReadModifyWriteRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + ReadModifyWriteRowRequest request = + ReadModifyWriteRowRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRowKey(ByteString.EMPTY) + .addAllRules(new ArrayList()) + .build(); + ReadModifyWriteRowResponse response = baseBigtableDataClient.readModifyWriteRow(request); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java new file mode 100644 index 0000000000..95adbd24bd --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_stringbytestringlistreadmodifywriterule_sync] +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncReadModifyWriteRowStringBytestringListreadmodifywriterule { + + public static void main(String[] args) throws Exception { + syncReadModifyWriteRowStringBytestringListreadmodifywriterule(); + } + + public static void syncReadModifyWriteRowStringBytestringListreadmodifywriterule() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + List rules = new ArrayList<>(); + ReadModifyWriteRowResponse response = + baseBigtableDataClient.readModifyWriteRow(tableName, rowKey, rules); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_stringbytestringlistreadmodifywriterule_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java new file mode 100644 index 0000000000..c485ef5dbe --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_stringbytestringlistreadmodifywriterulestring_sync] +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString { + + public static void main(String[] args) throws Exception { + syncReadModifyWriteRowStringBytestringListreadmodifywriteruleString(); + } + + public static void syncReadModifyWriteRowStringBytestringListreadmodifywriteruleString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + String tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString(); + ByteString rowKey = ByteString.EMPTY; + List rules = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + ReadModifyWriteRowResponse response = + baseBigtableDataClient.readModifyWriteRow(tableName, rowKey, rules, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_stringbytestringlistreadmodifywriterulestring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java new file mode 100644 index 0000000000..50134a685c --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_tablenamebytestringlistreadmodifywriterule_sync] +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule { + + public static void main(String[] args) throws Exception { + syncReadModifyWriteRowTablenameBytestringListreadmodifywriterule(); + } + + public static void syncReadModifyWriteRowTablenameBytestringListreadmodifywriterule() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + List rules = new ArrayList<>(); + ReadModifyWriteRowResponse response = + baseBigtableDataClient.readModifyWriteRow(tableName, rowKey, rules); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_tablenamebytestringlistreadmodifywriterule_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java new file mode 100644 index 0000000000..76bfc82d37 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_tablenamebytestringlistreadmodifywriterulestring_sync] +import com.google.bigtable.v2.ReadModifyWriteRowResponse; +import com.google.bigtable.v2.ReadModifyWriteRule; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString { + + public static void main(String[] args) throws Exception { + syncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString(); + } + + public static void syncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + TableName tableName = TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]"); + ByteString rowKey = ByteString.EMPTY; + List rules = new ArrayList<>(); + String appProfileId = "appProfileId704923523"; + ReadModifyWriteRowResponse response = + baseBigtableDataClient.readModifyWriteRow(tableName, rowKey, rules, appProfileId); + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readmodifywriterow_tablenamebytestringlistreadmodifywriterulestring_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readrows/AsyncReadRows.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readrows/AsyncReadRows.java new file mode 100644 index 0000000000..1f77f4271a --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readrows/AsyncReadRows.java @@ -0,0 +1,54 @@ +/* + * 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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_readrows_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.ReadRowsRequest; +import com.google.bigtable.v2.ReadRowsResponse; +import com.google.bigtable.v2.RowFilter; +import com.google.bigtable.v2.RowSet; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class AsyncReadRows { + + public static void main(String[] args) throws Exception { + asyncReadRows(); + } + + public static void asyncReadRows() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + ReadRowsRequest request = + ReadRowsRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .setRows(RowSet.newBuilder().build()) + .setFilter(RowFilter.newBuilder().build()) + .setRowsLimit(-944199211) + .build(); + ServerStream stream = + baseBigtableDataClient.readRowsCallable().call(request); + for (ReadRowsResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_readrows_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/samplerowkeys/AsyncSampleRowKeys.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/samplerowkeys/AsyncSampleRowKeys.java new file mode 100644 index 0000000000..450c6c0672 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/samplerowkeys/AsyncSampleRowKeys.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledataclient_samplerowkeys_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.bigtable.v2.SampleRowKeysRequest; +import com.google.bigtable.v2.SampleRowKeysResponse; +import com.google.bigtable.v2.TableName; +import com.google.cloud.bigtable.data.v2.BaseBigtableDataClient; + +public class AsyncSampleRowKeys { + + public static void main(String[] args) throws Exception { + asyncSampleRowKeys(); + } + + public static void asyncSampleRowKeys() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (BaseBigtableDataClient baseBigtableDataClient = BaseBigtableDataClient.create()) { + SampleRowKeysRequest request = + SampleRowKeysRequest.newBuilder() + .setTableName(TableName.of("[PROJECT]", "[INSTANCE]", "[TABLE]").toString()) + .setAppProfileId("appProfileId704923523") + .build(); + ServerStream stream = + baseBigtableDataClient.sampleRowKeysCallable().call(request); + for (SampleRowKeysResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END bigtable_v2_generated_basebigtabledataclient_samplerowkeys_async] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.java new file mode 100644 index 0000000000..5d44d6b656 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledatasettings/mutaterow/SyncMutateRow.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.bigtable.data.v2.samples; + +// [START bigtable_v2_generated_basebigtabledatasettings_mutaterow_sync] +import com.google.cloud.bigtable.data.v2.BaseBigtableDataSettings; +import java.time.Duration; + +public class SyncMutateRow { + + public static void main(String[] args) throws Exception { + syncMutateRow(); + } + + public static void syncMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BaseBigtableDataSettings.Builder baseBigtableDataSettingsBuilder = + BaseBigtableDataSettings.newBuilder(); + baseBigtableDataSettingsBuilder + .mutateRowSettings() + .setRetrySettings( + baseBigtableDataSettingsBuilder + .mutateRowSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BaseBigtableDataSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); + } +} +// [END bigtable_v2_generated_basebigtabledatasettings_mutaterow_sync] diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.java new file mode 100644 index 0000000000..bfa678d2d4 --- /dev/null +++ b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/stub/bigtablestubsettings/mutaterow/SyncMutateRow.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.bigtable.data.v2.stub.samples; + +// [START bigtable_v2_generated_bigtablestubsettings_mutaterow_sync] +import com.google.cloud.bigtable.data.v2.stub.BigtableStubSettings; +import java.time.Duration; + +public class SyncMutateRow { + + public static void main(String[] args) throws Exception { + syncMutateRow(); + } + + public static void syncMutateRow() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + BigtableStubSettings.Builder baseBigtableDataSettingsBuilder = + BigtableStubSettings.newBuilder(); + baseBigtableDataSettingsBuilder + .mutateRowSettings() + .setRetrySettings( + baseBigtableDataSettingsBuilder + .mutateRowSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + BigtableStubSettings baseBigtableDataSettings = baseBigtableDataSettingsBuilder.build(); + } +} +// [END bigtable_v2_generated_bigtablestubsettings_mutaterow_sync] diff --git a/test/integration/goldens/bigtable/com/google/bigtable/v2/TableName.java b/test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/bigtable/v2/TableName.java rename to test/integration/goldens/bigtable/src/com/google/bigtable/v2/TableName.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClient.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataClientTest.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/BaseBigtableDataSettings.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/MockBigtable.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/MockBigtable.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtable.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/MockBigtableImpl.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/gapic_metadata.json rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/gapic_metadata.json diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/package-info.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/package-info.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/package-info.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java diff --git a/test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java similarity index 100% rename from test/integration/goldens/bigtable/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java rename to test/integration/goldens/bigtable/src/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList.java new file mode 100644 index 0000000000..b3cc073310 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList.java @@ -0,0 +1,54 @@ +/* + * 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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_aggregatedlist_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesScopedList; +import com.google.cloud.compute.v1small.AggregatedListAddressesRequest; +import java.util.Map; + +public class AsyncAggregatedList { + + public static void main(String[] args) throws Exception { + asyncAggregatedList(); + } + + public static void asyncAggregatedList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + AggregatedListAddressesRequest request = + AggregatedListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setIncludeAllScopes(true) + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + ApiFuture> future = + addressesClient.aggregatedListPagedCallable().futureCall(request); + // Do something. + for (Map.Entry element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_aggregatedlist_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java new file mode 100644 index 0000000000..c681cef09d --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java @@ -0,0 +1,61 @@ +/* + * 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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_aggregatedlist_paged_async] +import com.google.cloud.compute.v1small.AddressAggregatedList; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesScopedList; +import com.google.cloud.compute.v1small.AggregatedListAddressesRequest; +import com.google.common.base.Strings; +import java.util.Map; + +public class AsyncAggregatedListPaged { + + public static void main(String[] args) throws Exception { + asyncAggregatedListPaged(); + } + + public static void asyncAggregatedListPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + AggregatedListAddressesRequest request = + AggregatedListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setIncludeAllScopes(true) + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + while (true) { + AddressAggregatedList response = addressesClient.aggregatedListCallable().call(request); + for (Map.Entry element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END compute_v1small_generated_addressesclient_aggregatedlist_paged_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList.java new file mode 100644 index 0000000000..cacfc4a3d3 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_aggregatedlist_sync] +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesScopedList; +import com.google.cloud.compute.v1small.AggregatedListAddressesRequest; +import java.util.Map; + +public class SyncAggregatedList { + + public static void main(String[] args) throws Exception { + syncAggregatedList(); + } + + public static void syncAggregatedList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + AggregatedListAddressesRequest request = + AggregatedListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setIncludeAllScopes(true) + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .build(); + for (Map.Entry element : + addressesClient.aggregatedList(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_aggregatedlist_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java new file mode 100644 index 0000000000..1be23cc870 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java @@ -0,0 +1,42 @@ +/* + * 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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_aggregatedlist_string_sync] +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesScopedList; +import java.util.Map; + +public class SyncAggregatedListString { + + public static void main(String[] args) throws Exception { + syncAggregatedListString(); + } + + public static void syncAggregatedListString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + String project = "project-309310695"; + for (Map.Entry element : + addressesClient.aggregatedList(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_aggregatedlist_string_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..84dd3cbf6a --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesSettings; +import com.google.cloud.compute.v1small.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. + AddressesSettings addressesSettings = + AddressesSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + AddressesClient addressesClient = AddressesClient.create(addressesSettings); + } +} +// [END compute_v1small_generated_addressesclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..3a90b53196 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_create_setendpoint_sync] +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.AddressesSettings; +import com.google.cloud.compute.v1small.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. + AddressesSettings addressesSettings = + AddressesSettings.newBuilder().setEndpoint(myEndpoint).build(); + AddressesClient addressesClient = AddressesClient.create(addressesSettings); + } +} +// [END compute_v1small_generated_addressesclient_create_setendpoint_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete.java new file mode 100644 index 0000000000..0fff28559e --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_delete_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.DeleteAddressRequest; +import com.google.longrunning.Operation; + +public class AsyncDelete { + + public static void main(String[] args) throws Exception { + asyncDelete(); + } + + public static void asyncDelete() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + DeleteAddressRequest request = + DeleteAddressRequest.newBuilder() + .setAddress("address-1147692044") + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = addressesClient.deleteCallable().futureCall(request); + // Do something. + com.google.cloud.compute.v1small.Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_addressesclient_delete_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.java new file mode 100644 index 0000000000..a9d8d15528 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_delete_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.DeleteAddressRequest; +import com.google.cloud.compute.v1small.Operation; + +public class AsyncDeleteLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteLRO(); + } + + public static void asyncDeleteLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + DeleteAddressRequest request = + DeleteAddressRequest.newBuilder() + .setAddress("address-1147692044") + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + addressesClient.deleteOperationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_addressesclient_delete_lro_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete.java new file mode 100644 index 0000000000..4ade7c59a7 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_delete_sync] +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.DeleteAddressRequest; +import com.google.cloud.compute.v1small.Operation; + +public class SyncDelete { + + public static void main(String[] args) throws Exception { + syncDelete(); + } + + public static void syncDelete() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + DeleteAddressRequest request = + DeleteAddressRequest.newBuilder() + .setAddress("address-1147692044") + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + Operation response = addressesClient.deleteAsync(request).get(); + } + } +} +// [END compute_v1small_generated_addressesclient_delete_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.java new file mode 100644 index 0000000000..217f67cfad --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_delete_stringstringstring_sync] +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.Operation; + +public class SyncDeleteStringStringString { + + public static void main(String[] args) throws Exception { + syncDeleteStringStringString(); + } + + public static void syncDeleteStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + String project = "project-309310695"; + String region = "region-934795532"; + String address = "address-1147692044"; + Operation response = addressesClient.deleteAsync(project, region, address).get(); + } + } +} +// [END compute_v1small_generated_addressesclient_delete_stringstringstring_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert.java new file mode 100644 index 0000000000..ad2c94e004 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_insert_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.InsertAddressRequest; +import com.google.longrunning.Operation; + +public class AsyncInsert { + + public static void main(String[] args) throws Exception { + asyncInsert(); + } + + public static void asyncInsert() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + InsertAddressRequest request = + InsertAddressRequest.newBuilder() + .setAddressResource(Address.newBuilder().build()) + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + ApiFuture future = addressesClient.insertCallable().futureCall(request); + // Do something. + com.google.cloud.compute.v1small.Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_addressesclient_insert_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.java new file mode 100644 index 0000000000..65cc52a4ca --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_insert_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.InsertAddressRequest; +import com.google.cloud.compute.v1small.Operation; + +public class AsyncInsertLRO { + + public static void main(String[] args) throws Exception { + asyncInsertLRO(); + } + + public static void asyncInsertLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + InsertAddressRequest request = + InsertAddressRequest.newBuilder() + .setAddressResource(Address.newBuilder().build()) + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + addressesClient.insertOperationCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_addressesclient_insert_lro_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert.java new file mode 100644 index 0000000000..74373292ce --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_insert_sync] +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.InsertAddressRequest; +import com.google.cloud.compute.v1small.Operation; + +public class SyncInsert { + + public static void main(String[] args) throws Exception { + syncInsert(); + } + + public static void syncInsert() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + InsertAddressRequest request = + InsertAddressRequest.newBuilder() + .setAddressResource(Address.newBuilder().build()) + .setProject("project-309310695") + .setRegion("region-934795532") + .setRequestId("requestId693933066") + .build(); + Operation response = addressesClient.insertAsync(request).get(); + } + } +} +// [END compute_v1small_generated_addressesclient_insert_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.java new file mode 100644 index 0000000000..496430e9e5 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_insert_stringstringaddress_sync] +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.Operation; + +public class SyncInsertStringStringAddress { + + public static void main(String[] args) throws Exception { + syncInsertStringStringAddress(); + } + + public static void syncInsertStringStringAddress() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + String project = "project-309310695"; + String region = "region-934795532"; + Address addressResource = Address.newBuilder().build(); + Operation response = addressesClient.insertAsync(project, region, addressResource).get(); + } + } +} +// [END compute_v1small_generated_addressesclient_insert_stringstringaddress_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList.java new file mode 100644 index 0000000000..921e5d7855 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_list_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.ListAddressesRequest; + +public class AsyncList { + + public static void main(String[] args) throws Exception { + asyncList(); + } + + public static void asyncList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + ListAddressesRequest request = + ListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + ApiFuture
future = addressesClient.listPagedCallable().futureCall(request); + // Do something. + for (Address element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_list_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.java new file mode 100644 index 0000000000..8f0864a41b --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_list_paged_async] +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressList; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.ListAddressesRequest; +import com.google.common.base.Strings; + +public class AsyncListPaged { + + public static void main(String[] args) throws Exception { + asyncListPaged(); + } + + public static void asyncListPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + ListAddressesRequest request = + ListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + while (true) { + AddressList response = addressesClient.listCallable().call(request); + for (Address element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END compute_v1small_generated_addressesclient_list_paged_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList.java new file mode 100644 index 0000000000..5f90b3cb91 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_list_sync] +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; +import com.google.cloud.compute.v1small.ListAddressesRequest; + +public class SyncList { + + public static void main(String[] args) throws Exception { + syncList(); + } + + public static void syncList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + ListAddressesRequest request = + ListAddressesRequest.newBuilder() + .setFilter("filter-1274492040") + .setMaxResults(1128457243) + .setOrderBy("orderBy-1207110587") + .setPageToken("pageToken873572522") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + for (Address element : addressesClient.list(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_list_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java new file mode 100644 index 0000000000..cc91612660 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java @@ -0,0 +1,42 @@ +/* + * 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.compute.v1small.samples; + +// [START compute_v1small_generated_addressesclient_list_stringstringstring_sync] +import com.google.cloud.compute.v1small.Address; +import com.google.cloud.compute.v1small.AddressesClient; + +public class SyncListStringStringString { + + public static void main(String[] args) throws Exception { + syncListStringStringString(); + } + + public static void syncListStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (AddressesClient addressesClient = AddressesClient.create()) { + String project = "project-309310695"; + String region = "region-934795532"; + String orderBy = "orderBy-1207110587"; + for (Address element : addressesClient.list(project, region, orderBy).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END compute_v1small_generated_addressesclient_list_stringstringstring_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.java new file mode 100644 index 0000000000..7753347900 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressessettings/aggregatedlist/SyncAggregatedList.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.compute.v1small.samples; + +// [START compute_v1small_generated_addressessettings_aggregatedlist_sync] +import com.google.cloud.compute.v1small.AddressesSettings; +import java.time.Duration; + +public class SyncAggregatedList { + + public static void main(String[] args) throws Exception { + syncAggregatedList(); + } + + public static void syncAggregatedList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AddressesSettings.Builder addressesSettingsBuilder = AddressesSettings.newBuilder(); + addressesSettingsBuilder + .aggregatedListSettings() + .setRetrySettings( + addressesSettingsBuilder + .aggregatedListSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AddressesSettings addressesSettings = addressesSettingsBuilder.build(); + } +} +// [END compute_v1small_generated_addressessettings_aggregatedlist_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..95d8a07ac3 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * 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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.compute.v1small.RegionOperationsClient; +import com.google.cloud.compute.v1small.RegionOperationsSettings; +import com.google.cloud.compute.v1small.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. + RegionOperationsSettings regionOperationsSettings = + RegionOperationsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + RegionOperationsClient regionOperationsClient = + RegionOperationsClient.create(regionOperationsSettings); + } +} +// [END compute_v1small_generated_regionoperationsclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..eb624b3f88 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_create_setendpoint_sync] +import com.google.cloud.compute.v1small.RegionOperationsClient; +import com.google.cloud.compute.v1small.RegionOperationsSettings; +import com.google.cloud.compute.v1small.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. + RegionOperationsSettings regionOperationsSettings = + RegionOperationsSettings.newBuilder().setEndpoint(myEndpoint).build(); + RegionOperationsClient regionOperationsClient = + RegionOperationsClient.create(regionOperationsSettings); + } +} +// [END compute_v1small_generated_regionoperationsclient_create_setendpoint_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/AsyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/AsyncGet.java new file mode 100644 index 0000000000..32423ccae7 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/AsyncGet.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_get_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.GetRegionOperationRequest; +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; + +public class AsyncGet { + + public static void main(String[] args) throws Exception { + asyncGet(); + } + + public static void asyncGet() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + GetRegionOperationRequest request = + GetRegionOperationRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + ApiFuture future = regionOperationsClient.getCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_get_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet.java new file mode 100644 index 0000000000..3a29facce9 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_get_sync] +import com.google.cloud.compute.v1small.GetRegionOperationRequest; +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + GetRegionOperationRequest request = + GetRegionOperationRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + Operation response = regionOperationsClient.get(request); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_get_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.java new file mode 100644 index 0000000000..5789da4f49 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_get_stringstringstring_sync] +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; + +public class SyncGetStringStringString { + + public static void main(String[] args) throws Exception { + syncGetStringStringString(); + } + + public static void syncGetStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + String project = "project-309310695"; + String region = "region-934795532"; + String operation = "operation1662702951"; + Operation response = regionOperationsClient.get(project, region, operation); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_get_stringstringstring_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/AsyncWait.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/AsyncWait.java new file mode 100644 index 0000000000..330dda902a --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/AsyncWait.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_wait_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; +import com.google.cloud.compute.v1small.WaitRegionOperationRequest; + +public class AsyncWait { + + public static void main(String[] args) throws Exception { + asyncWait(); + } + + public static void asyncWait() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + WaitRegionOperationRequest request = + WaitRegionOperationRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + ApiFuture future = regionOperationsClient.waitCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_wait_async] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait.java new file mode 100644 index 0000000000..2fdc002e8b --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_wait_sync] +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; +import com.google.cloud.compute.v1small.WaitRegionOperationRequest; + +public class SyncWait { + + public static void main(String[] args) throws Exception { + syncWait(); + } + + public static void syncWait() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + WaitRegionOperationRequest request = + WaitRegionOperationRequest.newBuilder() + .setOperation("operation1662702951") + .setProject("project-309310695") + .setRegion("region-934795532") + .build(); + Operation response = regionOperationsClient.wait(request); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_wait_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.java new file mode 100644 index 0000000000..a82868b75c --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationsclient_wait_stringstringstring_sync] +import com.google.cloud.compute.v1small.Operation; +import com.google.cloud.compute.v1small.RegionOperationsClient; + +public class SyncWaitStringStringString { + + public static void main(String[] args) throws Exception { + syncWaitStringStringString(); + } + + public static void syncWaitStringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (RegionOperationsClient regionOperationsClient = RegionOperationsClient.create()) { + String project = "project-309310695"; + String region = "region-934795532"; + String operation = "operation1662702951"; + Operation response = regionOperationsClient.wait(project, region, operation); + } + } +} +// [END compute_v1small_generated_regionoperationsclient_wait_stringstringstring_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.java new file mode 100644 index 0000000000..e18716b267 --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationssettings/get/SyncGet.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.compute.v1small.samples; + +// [START compute_v1small_generated_regionoperationssettings_get_sync] +import com.google.cloud.compute.v1small.RegionOperationsSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + RegionOperationsSettings.Builder regionOperationsSettingsBuilder = + RegionOperationsSettings.newBuilder(); + regionOperationsSettingsBuilder + .getSettings() + .setRetrySettings( + regionOperationsSettingsBuilder + .getSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RegionOperationsSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); + } +} +// [END compute_v1small_generated_regionoperationssettings_get_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.java new file mode 100644 index 0000000000..1194c3b42a --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/addressesstubsettings/aggregatedlist/SyncAggregatedList.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.compute.v1small.stub.samples; + +// [START compute_v1small_generated_addressesstubsettings_aggregatedlist_sync] +import com.google.cloud.compute.v1small.stub.AddressesStubSettings; +import java.time.Duration; + +public class SyncAggregatedList { + + public static void main(String[] args) throws Exception { + syncAggregatedList(); + } + + public static void syncAggregatedList() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + AddressesStubSettings.Builder addressesSettingsBuilder = AddressesStubSettings.newBuilder(); + addressesSettingsBuilder + .aggregatedListSettings() + .setRetrySettings( + addressesSettingsBuilder + .aggregatedListSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + AddressesStubSettings addressesSettings = addressesSettingsBuilder.build(); + } +} +// [END compute_v1small_generated_addressesstubsettings_aggregatedlist_sync] diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.java new file mode 100644 index 0000000000..ccb16e77cb --- /dev/null +++ b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/stub/regionoperationsstubsettings/get/SyncGet.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.compute.v1small.stub.samples; + +// [START compute_v1small_generated_regionoperationsstubsettings_get_sync] +import com.google.cloud.compute.v1small.stub.RegionOperationsStubSettings; +import java.time.Duration; + +public class SyncGet { + + public static void main(String[] args) throws Exception { + syncGet(); + } + + public static void syncGet() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + RegionOperationsStubSettings.Builder regionOperationsSettingsBuilder = + RegionOperationsStubSettings.newBuilder(); + regionOperationsSettingsBuilder + .getSettings() + .setRetrySettings( + regionOperationsSettingsBuilder + .getSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + RegionOperationsStubSettings regionOperationsSettings = regionOperationsSettingsBuilder.build(); + } +} +// [END compute_v1small_generated_regionoperationsstubsettings_get_sync] diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesClient.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesClient.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClient.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesClientTest.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesClientTest.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesClientTest.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/AddressesSettings.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/AddressesSettings.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsClient.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsClient.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClient.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsClientTest.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsClientTest.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsClientTest.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/RegionOperationsSettings.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/RegionOperationsSettings.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/gapic_metadata.json b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/gapic_metadata.json similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/gapic_metadata.json rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/gapic_metadata.json diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/package-info.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/package-info.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/package-info.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/AddressesStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/AddressesStub.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStub.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/AddressesStubSettings.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesCallableFactory.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonAddressesStub.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsCallableFactory.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/HttpJsonRegionOperationsStub.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStub.java diff --git a/test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java b/test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java similarity index 100% rename from test/integration/goldens/compute/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java rename to test/integration/goldens/compute/src/com/google/cloud/compute/v1small/stub/RegionOperationsStubSettings.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..3417df5a97 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.IamCredentialsSettings; +import com.google.cloud.iam.credentials.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. + IamCredentialsSettings iamCredentialsSettings = + IamCredentialsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create(iamCredentialsSettings); + } +} +// [END credentials_v1_generated_iamcredentialsclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..74549be5b7 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_create_setendpoint_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.IamCredentialsSettings; +import com.google.cloud.iam.credentials.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. + IamCredentialsSettings iamCredentialsSettings = + IamCredentialsSettings.newBuilder().setEndpoint(myEndpoint).build(); + IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create(iamCredentialsSettings); + } +} +// [END credentials_v1_generated_iamcredentialsclient_create_setendpoint_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/AsyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/AsyncGenerateAccessToken.java new file mode 100644 index 0000000000..00650e2b2d --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/AsyncGenerateAccessToken.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateaccesstoken_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class AsyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + asyncGenerateAccessToken(); + } + + public static void asyncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .addAllScope(new ArrayList()) + .setLifetime(Duration.newBuilder().build()) + .build(); + ApiFuture future = + iamCredentialsClient.generateAccessTokenCallable().futureCall(request); + // Do something. + GenerateAccessTokenResponse response = future.get(); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateaccesstoken_async] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken.java new file mode 100644 index 0000000000..093b6b9060 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateaccesstoken_sync] +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class SyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + syncGenerateAccessToken(); + } + + public static void syncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + GenerateAccessTokenRequest request = + GenerateAccessTokenRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .addAllScope(new ArrayList()) + .setLifetime(Duration.newBuilder().build()) + .build(); + GenerateAccessTokenResponse response = iamCredentialsClient.generateAccessToken(request); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateaccesstoken_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java new file mode 100644 index 0000000000..3d5089db5b --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateaccesstoken_serviceaccountnameliststringliststringduration_sync] +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.protobuf.Duration; +import java.util.ArrayList; +import java.util.List; + +public class SyncGenerateAccessTokenServiceaccountnameListstringListstringDuration { + + public static void main(String[] args) throws Exception { + syncGenerateAccessTokenServiceaccountnameListstringListstringDuration(); + } + + public static void syncGenerateAccessTokenServiceaccountnameListstringListstringDuration() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + GenerateAccessTokenResponse response = + iamCredentialsClient.generateAccessToken(name, delegates, scope, lifetime); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateaccesstoken_serviceaccountnameliststringliststringduration_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.java new file mode 100644 index 0000000000..72d86179d3 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateaccesstoken_stringliststringliststringduration_sync] +import com.google.cloud.iam.credentials.v1.GenerateAccessTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.protobuf.Duration; +import java.util.ArrayList; +import java.util.List; + +public class SyncGenerateAccessTokenStringListstringListstringDuration { + + public static void main(String[] args) throws Exception { + syncGenerateAccessTokenStringListstringListstringDuration(); + } + + public static void syncGenerateAccessTokenStringListstringListstringDuration() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + String name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString(); + List delegates = new ArrayList<>(); + List scope = new ArrayList<>(); + Duration lifetime = Duration.newBuilder().build(); + GenerateAccessTokenResponse response = + iamCredentialsClient.generateAccessToken(name, delegates, scope, lifetime); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateaccesstoken_stringliststringliststringduration_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/AsyncGenerateIdToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/AsyncGenerateIdToken.java new file mode 100644 index 0000000000..64a1821b61 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/AsyncGenerateIdToken.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateidtoken_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import java.util.ArrayList; + +public class AsyncGenerateIdToken { + + public static void main(String[] args) throws Exception { + asyncGenerateIdToken(); + } + + public static void asyncGenerateIdToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + GenerateIdTokenRequest request = + GenerateIdTokenRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setAudience("audience975628804") + .setIncludeEmail(true) + .build(); + ApiFuture future = + iamCredentialsClient.generateIdTokenCallable().futureCall(request); + // Do something. + GenerateIdTokenResponse response = future.get(); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateidtoken_async] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken.java new file mode 100644 index 0000000000..5c10d0227a --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateidtoken_sync] +import com.google.cloud.iam.credentials.v1.GenerateIdTokenRequest; +import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import java.util.ArrayList; + +public class SyncGenerateIdToken { + + public static void main(String[] args) throws Exception { + syncGenerateIdToken(); + } + + public static void syncGenerateIdToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + GenerateIdTokenRequest request = + GenerateIdTokenRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setAudience("audience975628804") + .setIncludeEmail(true) + .build(); + GenerateIdTokenResponse response = iamCredentialsClient.generateIdToken(request); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateidtoken_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java new file mode 100644 index 0000000000..f34fc96e7d --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateidtoken_serviceaccountnameliststringstringboolean_sync] +import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import java.util.ArrayList; +import java.util.List; + +public class SyncGenerateIdTokenServiceaccountnameListstringStringBoolean { + + public static void main(String[] args) throws Exception { + syncGenerateIdTokenServiceaccountnameListstringStringBoolean(); + } + + public static void syncGenerateIdTokenServiceaccountnameListstringStringBoolean() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + GenerateIdTokenResponse response = + iamCredentialsClient.generateIdToken(name, delegates, audience, includeEmail); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateidtoken_serviceaccountnameliststringstringboolean_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.java new file mode 100644 index 0000000000..78a035114c --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_generateidtoken_stringliststringstringboolean_sync] +import com.google.cloud.iam.credentials.v1.GenerateIdTokenResponse; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import java.util.ArrayList; +import java.util.List; + +public class SyncGenerateIdTokenStringListstringStringBoolean { + + public static void main(String[] args) throws Exception { + syncGenerateIdTokenStringListstringStringBoolean(); + } + + public static void syncGenerateIdTokenStringListstringStringBoolean() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + String name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString(); + List delegates = new ArrayList<>(); + String audience = "audience975628804"; + boolean includeEmail = true; + GenerateIdTokenResponse response = + iamCredentialsClient.generateIdToken(name, delegates, audience, includeEmail); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_generateidtoken_stringliststringstringboolean_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/AsyncSignBlob.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/AsyncSignBlob.java new file mode 100644 index 0000000000..57372a99fd --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/AsyncSignBlob.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signblob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignBlobRequest; +import com.google.cloud.iam.credentials.v1.SignBlobResponse; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class AsyncSignBlob { + + public static void main(String[] args) throws Exception { + asyncSignBlob(); + } + + public static void asyncSignBlob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + SignBlobRequest request = + SignBlobRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setPayload(ByteString.EMPTY) + .build(); + ApiFuture future = + iamCredentialsClient.signBlobCallable().futureCall(request); + // Do something. + SignBlobResponse response = future.get(); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signblob_async] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob.java new file mode 100644 index 0000000000..e78b4aa337 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signblob_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignBlobRequest; +import com.google.cloud.iam.credentials.v1.SignBlobResponse; +import com.google.protobuf.ByteString; +import java.util.ArrayList; + +public class SyncSignBlob { + + public static void main(String[] args) throws Exception { + syncSignBlob(); + } + + public static void syncSignBlob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + SignBlobRequest request = + SignBlobRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setPayload(ByteString.EMPTY) + .build(); + SignBlobResponse response = iamCredentialsClient.signBlob(request); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signblob_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.java new file mode 100644 index 0000000000..91fc918d75 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signblob_serviceaccountnameliststringbytestring_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignBlobResponse; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncSignBlobServiceaccountnameListstringBytestring { + + public static void main(String[] args) throws Exception { + syncSignBlobServiceaccountnameListstringBytestring(); + } + + public static void syncSignBlobServiceaccountnameListstringBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + SignBlobResponse response = iamCredentialsClient.signBlob(name, delegates, payload); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signblob_serviceaccountnameliststringbytestring_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.java new file mode 100644 index 0000000000..935744eaf8 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signblob_stringliststringbytestring_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignBlobResponse; +import com.google.protobuf.ByteString; +import java.util.ArrayList; +import java.util.List; + +public class SyncSignBlobStringListstringBytestring { + + public static void main(String[] args) throws Exception { + syncSignBlobStringListstringBytestring(); + } + + public static void syncSignBlobStringListstringBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + String name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString(); + List delegates = new ArrayList<>(); + ByteString payload = ByteString.EMPTY; + SignBlobResponse response = iamCredentialsClient.signBlob(name, delegates, payload); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signblob_stringliststringbytestring_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/AsyncSignJwt.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/AsyncSignJwt.java new file mode 100644 index 0000000000..3cf757ce7c --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/AsyncSignJwt.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signjwt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignJwtRequest; +import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import java.util.ArrayList; + +public class AsyncSignJwt { + + public static void main(String[] args) throws Exception { + asyncSignJwt(); + } + + public static void asyncSignJwt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + SignJwtRequest request = + SignJwtRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setPayload("payload-786701938") + .build(); + ApiFuture future = + iamCredentialsClient.signJwtCallable().futureCall(request); + // Do something. + SignJwtResponse response = future.get(); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signjwt_async] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt.java new file mode 100644 index 0000000000..bc9f5cf168 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signjwt_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignJwtRequest; +import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import java.util.ArrayList; + +public class SyncSignJwt { + + public static void main(String[] args) throws Exception { + syncSignJwt(); + } + + public static void syncSignJwt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + SignJwtRequest request = + SignJwtRequest.newBuilder() + .setName(ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString()) + .addAllDelegates(new ArrayList()) + .setPayload("payload-786701938") + .build(); + SignJwtResponse response = iamCredentialsClient.signJwt(request); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signjwt_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.java new file mode 100644 index 0000000000..28f73bb95c --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signjwt_serviceaccountnameliststringstring_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import java.util.ArrayList; +import java.util.List; + +public class SyncSignJwtServiceaccountnameListstringString { + + public static void main(String[] args) throws Exception { + syncSignJwtServiceaccountnameListstringString(); + } + + public static void syncSignJwtServiceaccountnameListstringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + ServiceAccountName name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]"); + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + SignJwtResponse response = iamCredentialsClient.signJwt(name, delegates, payload); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signjwt_serviceaccountnameliststringstring_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.java new file mode 100644 index 0000000000..5caddb6f72 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialsclient_signjwt_stringliststringstring_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsClient; +import com.google.cloud.iam.credentials.v1.ServiceAccountName; +import com.google.cloud.iam.credentials.v1.SignJwtResponse; +import java.util.ArrayList; +import java.util.List; + +public class SyncSignJwtStringListstringString { + + public static void main(String[] args) throws Exception { + syncSignJwtStringListstringString(); + } + + public static void syncSignJwtStringListstringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IamCredentialsClient iamCredentialsClient = IamCredentialsClient.create()) { + String name = ServiceAccountName.of("[PROJECT]", "[SERVICE_ACCOUNT]").toString(); + List delegates = new ArrayList<>(); + String payload = "payload-786701938"; + SignJwtResponse response = iamCredentialsClient.signJwt(name, delegates, payload); + } + } +} +// [END credentials_v1_generated_iamcredentialsclient_signjwt_stringliststringstring_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.java new file mode 100644 index 0000000000..3360cd50c9 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialssettings/generateaccesstoken/SyncGenerateAccessToken.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.iam.credentials.v1.samples; + +// [START credentials_v1_generated_iamcredentialssettings_generateaccesstoken_sync] +import com.google.cloud.iam.credentials.v1.IamCredentialsSettings; +import java.time.Duration; + +public class SyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + syncGenerateAccessToken(); + } + + public static void syncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + IamCredentialsSettings.Builder iamCredentialsSettingsBuilder = + IamCredentialsSettings.newBuilder(); + iamCredentialsSettingsBuilder + .generateAccessTokenSettings() + .setRetrySettings( + iamCredentialsSettingsBuilder + .generateAccessTokenSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IamCredentialsSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); + } +} +// [END credentials_v1_generated_iamcredentialssettings_generateaccesstoken_sync] diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.java new file mode 100644 index 0000000000..0891aa0550 --- /dev/null +++ b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/stub/iamcredentialsstubsettings/generateaccesstoken/SyncGenerateAccessToken.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.iam.credentials.v1.stub.samples; + +// [START credentials_v1_generated_iamcredentialsstubsettings_generateaccesstoken_sync] +import com.google.cloud.iam.credentials.v1.stub.IamCredentialsStubSettings; +import java.time.Duration; + +public class SyncGenerateAccessToken { + + public static void main(String[] args) throws Exception { + syncGenerateAccessToken(); + } + + public static void syncGenerateAccessToken() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + IamCredentialsStubSettings.Builder iamCredentialsSettingsBuilder = + IamCredentialsStubSettings.newBuilder(); + iamCredentialsSettingsBuilder + .generateAccessTokenSettings() + .setRetrySettings( + iamCredentialsSettingsBuilder + .generateAccessTokenSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IamCredentialsStubSettings iamCredentialsSettings = iamCredentialsSettingsBuilder.build(); + } +} +// [END credentials_v1_generated_iamcredentialsstubsettings_generateaccesstoken_sync] diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IAMCredentialsClientTest.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsClient.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/IamCredentialsSettings.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentials.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/MockIAMCredentialsImpl.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/ServiceAccountName.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/ServiceAccountName.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/ServiceAccountName.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/gapic_metadata.json b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/gapic_metadata.json rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/gapic_metadata.json diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/package-info.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/package-info.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/package-info.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsCallableFactory.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStub.java diff --git a/test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java b/test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java similarity index 100% rename from test/integration/goldens/credentials/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java rename to test/integration/goldens/credentials/src/com/google/cloud/iam/credentials/v1/stub/IamCredentialsStubSettings.java diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..8c2748947d --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.IAMPolicySettings; +import com.google.iam.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. + IAMPolicySettings iAMPolicySettings = + IAMPolicySettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create(iAMPolicySettings); + } +} +// [END iam_v1_generated_iampolicyclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..34ab770360 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_create_setendpoint_sync] +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.IAMPolicySettings; +import com.google.iam.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. + IAMPolicySettings iAMPolicySettings = + IAMPolicySettings.newBuilder().setEndpoint(myEndpoint).build(); + IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create(iAMPolicySettings); + } +} +// [END iam_v1_generated_iampolicyclient_create_setendpoint_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..ce611b870a --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/AsyncGetIamPolicy.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = iAMPolicyClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END iam_v1_generated_iampolicyclient_getiampolicy_async] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..620f8e8f07 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/getiampolicy/SyncGetIamPolicy.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_getiampolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource("GetIamPolicyRequest-1527610370".toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = iAMPolicyClient.getIamPolicy(request); + } + } +} +// [END iam_v1_generated_iampolicyclient_getiampolicy_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..99e62e3d90 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/AsyncSetIamPolicy.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + ApiFuture future = iAMPolicyClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END iam_v1_generated_iampolicyclient_setiampolicy_async] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..866c9fc1a3 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/setiampolicy/SyncSetIamPolicy.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_setiampolicy_sync] +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource("SetIamPolicyRequest1223629066".toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + Policy response = iAMPolicyClient.setIamPolicy(request); + } + } +} +// [END iam_v1_generated_iampolicyclient_setiampolicy_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..aef6002de7 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/AsyncTestIamPermissions.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + iAMPolicyClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END iam_v1_generated_iampolicyclient_testiampermissions_async] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..30ea800cd3 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/testiampermissions/SyncTestIamPermissions.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicyclient_testiampermissions_sync] +import com.google.iam.v1.IAMPolicyClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (IAMPolicyClient iAMPolicyClient = IAMPolicyClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource("TestIamPermissionsRequest942398222".toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = iAMPolicyClient.testIamPermissions(request); + } + } +} +// [END iam_v1_generated_iampolicyclient_testiampermissions_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..97a3125aa9 --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicysettings/setiampolicy/SyncSetIamPolicy.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.iam.v1.samples; + +// [START iam_v1_generated_iampolicysettings_setiampolicy_sync] +import com.google.iam.v1.IAMPolicySettings; +import java.time.Duration; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + IAMPolicySettings.Builder iAMPolicySettingsBuilder = IAMPolicySettings.newBuilder(); + iAMPolicySettingsBuilder + .setIamPolicySettings() + .setRetrySettings( + iAMPolicySettingsBuilder + .setIamPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IAMPolicySettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); + } +} +// [END iam_v1_generated_iampolicysettings_setiampolicy_sync] diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..080c2c8a7b --- /dev/null +++ b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/stub/iampolicystubsettings/setiampolicy/SyncSetIamPolicy.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.iam.v1.stub.samples; + +// [START iam_v1_generated_iampolicystubsettings_setiampolicy_sync] +import com.google.iam.v1.stub.IAMPolicyStubSettings; +import java.time.Duration; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + IAMPolicyStubSettings.Builder iAMPolicySettingsBuilder = IAMPolicyStubSettings.newBuilder(); + iAMPolicySettingsBuilder + .setIamPolicySettings() + .setRetrySettings( + iAMPolicySettingsBuilder + .setIamPolicySettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + IAMPolicyStubSettings iAMPolicySettings = iAMPolicySettingsBuilder.build(); + } +} +// [END iam_v1_generated_iampolicystubsettings_setiampolicy_sync] diff --git a/test/integration/goldens/iam/com/google/iam/v1/IAMPolicyClient.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/IAMPolicyClient.java rename to test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClient.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/IAMPolicyClientTest.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/IAMPolicyClientTest.java rename to test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicyClientTest.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/IAMPolicySettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/IAMPolicySettings.java rename to test/integration/goldens/iam/src/com/google/iam/v1/IAMPolicySettings.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/MockIAMPolicy.java b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/MockIAMPolicy.java rename to test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicy.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/MockIAMPolicyImpl.java b/test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/MockIAMPolicyImpl.java rename to test/integration/goldens/iam/src/com/google/iam/v1/MockIAMPolicyImpl.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/gapic_metadata.json b/test/integration/goldens/iam/src/com/google/iam/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/gapic_metadata.json rename to test/integration/goldens/iam/src/com/google/iam/v1/gapic_metadata.json diff --git a/test/integration/goldens/iam/com/google/iam/v1/package-info.java b/test/integration/goldens/iam/src/com/google/iam/v1/package-info.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/package-info.java rename to test/integration/goldens/iam/src/com/google/iam/v1/package-info.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java rename to test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyCallableFactory.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/stub/GrpcIAMPolicyStub.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/stub/GrpcIAMPolicyStub.java rename to test/integration/goldens/iam/src/com/google/iam/v1/stub/GrpcIAMPolicyStub.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStub.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStub.java rename to test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStub.java diff --git a/test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java b/test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java similarity index 100% rename from test/integration/goldens/iam/com/google/iam/v1/stub/IAMPolicyStubSettings.java rename to test/integration/goldens/iam/src/com/google/iam/v1/stub/IAMPolicyStubSettings.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/AsyncAsymmetricDecrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/AsyncAsymmetricDecrypt.java new file mode 100644 index 0000000000..d2d323b4fd --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/AsyncAsymmetricDecrypt.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.AsymmetricDecryptRequest; +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class AsyncAsymmetricDecrypt { + + public static void main(String[] args) throws Exception { + asyncAsymmetricDecrypt(); + } + + public static void asyncAsymmetricDecrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + AsymmetricDecryptRequest request = + AsymmetricDecryptRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .setCiphertext(ByteString.EMPTY) + .setCiphertextCrc32C(Int64Value.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.asymmetricDecryptCallable().futureCall(request); + // Do something. + AsymmetricDecryptResponse response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt.java new file mode 100644 index 0000000000..efda2ce9f8 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_sync] +import com.google.cloud.kms.v1.AsymmetricDecryptRequest; +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class SyncAsymmetricDecrypt { + + public static void main(String[] args) throws Exception { + syncAsymmetricDecrypt(); + } + + public static void syncAsymmetricDecrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + AsymmetricDecryptRequest request = + AsymmetricDecryptRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .setCiphertext(ByteString.EMPTY) + .setCiphertextCrc32C(Int64Value.newBuilder().build()) + .build(); + AsymmetricDecryptResponse response = keyManagementServiceClient.asymmetricDecrypt(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java new file mode 100644 index 0000000000..5737897324 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_cryptokeyversionnamebytestring_sync] +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncAsymmetricDecryptCryptokeyversionnameBytestring { + + public static void main(String[] args) throws Exception { + syncAsymmetricDecryptCryptokeyversionnameBytestring(); + } + + public static void syncAsymmetricDecryptCryptokeyversionnameBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + ByteString ciphertext = ByteString.EMPTY; + AsymmetricDecryptResponse response = + keyManagementServiceClient.asymmetricDecrypt(name, ciphertext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_cryptokeyversionnamebytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.java new file mode 100644 index 0000000000..7aac61a879 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_stringbytestring_sync] +import com.google.cloud.kms.v1.AsymmetricDecryptResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncAsymmetricDecryptStringBytestring { + + public static void main(String[] args) throws Exception { + syncAsymmetricDecryptStringBytestring(); + } + + public static void syncAsymmetricDecryptStringBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + ByteString ciphertext = ByteString.EMPTY; + AsymmetricDecryptResponse response = + keyManagementServiceClient.asymmetricDecrypt(name, ciphertext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricdecrypt_stringbytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/AsyncAsymmetricSign.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/AsyncAsymmetricSign.java new file mode 100644 index 0000000000..ec6c21328a --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/AsyncAsymmetricSign.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricsign_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.AsymmetricSignRequest; +import com.google.cloud.kms.v1.AsymmetricSignResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.Digest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.Int64Value; + +public class AsyncAsymmetricSign { + + public static void main(String[] args) throws Exception { + asyncAsymmetricSign(); + } + + public static void asyncAsymmetricSign() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + AsymmetricSignRequest request = + AsymmetricSignRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .setDigest(Digest.newBuilder().build()) + .setDigestCrc32C(Int64Value.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.asymmetricSignCallable().futureCall(request); + // Do something. + AsymmetricSignResponse response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricsign_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign.java new file mode 100644 index 0000000000..b9710e7ee6 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricsign_sync] +import com.google.cloud.kms.v1.AsymmetricSignRequest; +import com.google.cloud.kms.v1.AsymmetricSignResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.Digest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.Int64Value; + +public class SyncAsymmetricSign { + + public static void main(String[] args) throws Exception { + syncAsymmetricSign(); + } + + public static void syncAsymmetricSign() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + AsymmetricSignRequest request = + AsymmetricSignRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .setDigest(Digest.newBuilder().build()) + .setDigestCrc32C(Int64Value.newBuilder().build()) + .build(); + AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricsign_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.java new file mode 100644 index 0000000000..ffb27fb3f2 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricsign_cryptokeyversionnamedigest_sync] +import com.google.cloud.kms.v1.AsymmetricSignResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.Digest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncAsymmetricSignCryptokeyversionnameDigest { + + public static void main(String[] args) throws Exception { + syncAsymmetricSignCryptokeyversionnameDigest(); + } + + public static void syncAsymmetricSignCryptokeyversionnameDigest() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + Digest digest = Digest.newBuilder().build(); + AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(name, digest); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricsign_cryptokeyversionnamedigest_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.java new file mode 100644 index 0000000000..51c506b210 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_asymmetricsign_stringdigest_sync] +import com.google.cloud.kms.v1.AsymmetricSignResponse; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.Digest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncAsymmetricSignStringDigest { + + public static void main(String[] args) throws Exception { + syncAsymmetricSignStringDigest(); + } + + public static void syncAsymmetricSignStringDigest() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + Digest digest = Digest.newBuilder().build(); + AsymmetricSignResponse response = keyManagementServiceClient.asymmetricSign(name, digest); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_asymmetricsign_stringdigest_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..a3b313fc57 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyManagementServiceSettings; +import com.google.cloud.kms.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. + KeyManagementServiceSettings keyManagementServiceSettings = + KeyManagementServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create(keyManagementServiceSettings); + } +} +// [END kms_v1_generated_keymanagementserviceclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..a3f0de93c2 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_create_setendpoint_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyManagementServiceSettings; +import com.google.cloud.kms.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. + KeyManagementServiceSettings keyManagementServiceSettings = + KeyManagementServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create(keyManagementServiceSettings); + } +} +// [END kms_v1_generated_keymanagementserviceclient_create_setendpoint_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/AsyncCreateCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/AsyncCreateCryptoKey.java new file mode 100644 index 0000000000..219a4e0bcd --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/AsyncCreateCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokey_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CreateCryptoKeyRequest; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class AsyncCreateCryptoKey { + + public static void main(String[] args) throws Exception { + asyncCreateCryptoKey(); + } + + public static void asyncCreateCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateCryptoKeyRequest request = + CreateCryptoKeyRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setCryptoKeyId("cryptoKeyId-1643185255") + .setCryptoKey(CryptoKey.newBuilder().build()) + .setSkipInitialVersionCreation(true) + .build(); + ApiFuture future = + keyManagementServiceClient.createCryptoKeyCallable().futureCall(request); + // Do something. + CryptoKey response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokey_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey.java new file mode 100644 index 0000000000..0fd2282f0d --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokey_sync] +import com.google.cloud.kms.v1.CreateCryptoKeyRequest; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateCryptoKey { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKey(); + } + + public static void syncCreateCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateCryptoKeyRequest request = + CreateCryptoKeyRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setCryptoKeyId("cryptoKeyId-1643185255") + .setCryptoKey(CryptoKey.newBuilder().build()) + .setSkipInitialVersionCreation(true) + .build(); + CryptoKey response = keyManagementServiceClient.createCryptoKey(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.java new file mode 100644 index 0000000000..9719174a49 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokey_keyringnamestringcryptokey_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateCryptoKeyKeyringnameStringCryptokey { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKeyKeyringnameStringCryptokey(); + } + + public static void syncCreateCryptoKeyKeyringnameStringCryptokey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + KeyRingName parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); + String cryptoKeyId = "cryptoKeyId-1643185255"; + CryptoKey cryptoKey = CryptoKey.newBuilder().build(); + CryptoKey response = + keyManagementServiceClient.createCryptoKey(parent, cryptoKeyId, cryptoKey); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokey_keyringnamestringcryptokey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.java new file mode 100644 index 0000000000..064c0938ed --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokey_stringstringcryptokey_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateCryptoKeyStringStringCryptokey { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKeyStringStringCryptokey(); + } + + public static void syncCreateCryptoKeyStringStringCryptokey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString(); + String cryptoKeyId = "cryptoKeyId-1643185255"; + CryptoKey cryptoKey = CryptoKey.newBuilder().build(); + CryptoKey response = + keyManagementServiceClient.createCryptoKey(parent, cryptoKeyId, cryptoKey); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokey_stringstringcryptokey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/AsyncCreateCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/AsyncCreateCryptoKeyVersion.java new file mode 100644 index 0000000000..154d4cbd6b --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/AsyncCreateCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncCreateCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncCreateCryptoKeyVersion(); + } + + public static void asyncCreateCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateCryptoKeyVersionRequest request = + CreateCryptoKeyVersionRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.createCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion.java new file mode 100644 index 0000000000..0d6d7e8cb7 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_sync] +import com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncCreateCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKeyVersion(); + } + + public static void syncCreateCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateCryptoKeyVersionRequest request = + CreateCryptoKeyVersionRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()) + .build(); + CryptoKeyVersion response = keyManagementServiceClient.createCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java new file mode 100644 index 0000000000..bd08598303 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_cryptokeynamecryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncCreateCryptoKeyVersionCryptokeynameCryptokeyversion { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKeyVersionCryptokeynameCryptokeyversion(); + } + + public static void syncCreateCryptoKeyVersionCryptokeynameCryptokeyversion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyName parent = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + CryptoKeyVersion cryptoKeyVersion = CryptoKeyVersion.newBuilder().build(); + CryptoKeyVersion response = + keyManagementServiceClient.createCryptoKeyVersion(parent, cryptoKeyVersion); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_cryptokeynamecryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.java new file mode 100644 index 0000000000..6991e442ad --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_stringcryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncCreateCryptoKeyVersionStringCryptokeyversion { + + public static void main(String[] args) throws Exception { + syncCreateCryptoKeyVersionStringCryptokeyversion(); + } + + public static void syncCreateCryptoKeyVersionStringCryptokeyversion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + CryptoKeyVersion cryptoKeyVersion = CryptoKeyVersion.newBuilder().build(); + CryptoKeyVersion response = + keyManagementServiceClient.createCryptoKeyVersion(parent, cryptoKeyVersion); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createcryptokeyversion_stringcryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/AsyncCreateImportJob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/AsyncCreateImportJob.java new file mode 100644 index 0000000000..2358cca240 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/AsyncCreateImportJob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createimportjob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CreateImportJobRequest; +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class AsyncCreateImportJob { + + public static void main(String[] args) throws Exception { + asyncCreateImportJob(); + } + + public static void asyncCreateImportJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateImportJobRequest request = + CreateImportJobRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setImportJobId("importJobId1449444627") + .setImportJob(ImportJob.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.createImportJobCallable().futureCall(request); + // Do something. + ImportJob response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createimportjob_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob.java new file mode 100644 index 0000000000..576caadd29 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createimportjob_sync] +import com.google.cloud.kms.v1.CreateImportJobRequest; +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateImportJob { + + public static void main(String[] args) throws Exception { + syncCreateImportJob(); + } + + public static void syncCreateImportJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateImportJobRequest request = + CreateImportJobRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setImportJobId("importJobId1449444627") + .setImportJob(ImportJob.newBuilder().build()) + .build(); + ImportJob response = keyManagementServiceClient.createImportJob(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createimportjob_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.java new file mode 100644 index 0000000000..ceddcf404a --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createimportjob_keyringnamestringimportjob_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateImportJobKeyringnameStringImportjob { + + public static void main(String[] args) throws Exception { + syncCreateImportJobKeyringnameStringImportjob(); + } + + public static void syncCreateImportJobKeyringnameStringImportjob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + KeyRingName parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); + String importJobId = "importJobId1449444627"; + ImportJob importJob = ImportJob.newBuilder().build(); + ImportJob response = + keyManagementServiceClient.createImportJob(parent, importJobId, importJob); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createimportjob_keyringnamestringimportjob_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.java new file mode 100644 index 0000000000..2ecd330cef --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createimportjob_stringstringimportjob_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncCreateImportJobStringStringImportjob { + + public static void main(String[] args) throws Exception { + syncCreateImportJobStringStringImportjob(); + } + + public static void syncCreateImportJobStringStringImportjob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString(); + String importJobId = "importJobId1449444627"; + ImportJob importJob = ImportJob.newBuilder().build(); + ImportJob response = + keyManagementServiceClient.createImportJob(parent, importJobId, importJob); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createimportjob_stringstringimportjob_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/AsyncCreateKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/AsyncCreateKeyRing.java new file mode 100644 index 0000000000..b36032047e --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/AsyncCreateKeyRing.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createkeyring_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CreateKeyRingRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class AsyncCreateKeyRing { + + public static void main(String[] args) throws Exception { + asyncCreateKeyRing(); + } + + public static void asyncCreateKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateKeyRingRequest request = + CreateKeyRingRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKeyRingId("keyRingId-2027180374") + .setKeyRing(KeyRing.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.createKeyRingCallable().futureCall(request); + // Do something. + KeyRing response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createkeyring_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing.java new file mode 100644 index 0000000000..72e5346542 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createkeyring_sync] +import com.google.cloud.kms.v1.CreateKeyRingRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class SyncCreateKeyRing { + + public static void main(String[] args) throws Exception { + syncCreateKeyRing(); + } + + public static void syncCreateKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CreateKeyRingRequest request = + CreateKeyRingRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setKeyRingId("keyRingId-2027180374") + .setKeyRing(KeyRing.newBuilder().build()) + .build(); + KeyRing response = keyManagementServiceClient.createKeyRing(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createkeyring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java new file mode 100644 index 0000000000..22e239058e --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createkeyring_locationnamestringkeyring_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class SyncCreateKeyRingLocationnameStringKeyring { + + public static void main(String[] args) throws Exception { + syncCreateKeyRingLocationnameStringKeyring(); + } + + public static void syncCreateKeyRingLocationnameStringKeyring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String keyRingId = "keyRingId-2027180374"; + KeyRing keyRing = KeyRing.newBuilder().build(); + KeyRing response = keyManagementServiceClient.createKeyRing(parent, keyRingId, keyRing); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createkeyring_locationnamestringkeyring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java new file mode 100644 index 0000000000..f1b4a3fa90 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_createkeyring_stringstringkeyring_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class SyncCreateKeyRingStringStringKeyring { + + public static void main(String[] args) throws Exception { + syncCreateKeyRingStringStringKeyring(); + } + + public static void syncCreateKeyRingStringStringKeyring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + String keyRingId = "keyRingId-2027180374"; + KeyRing keyRing = KeyRing.newBuilder().build(); + KeyRing response = keyManagementServiceClient.createKeyRing(parent, keyRingId, keyRing); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_createkeyring_stringstringkeyring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/AsyncDecrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/AsyncDecrypt.java new file mode 100644 index 0000000000..9e58b15613 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/AsyncDecrypt.java @@ -0,0 +1,56 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_decrypt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.DecryptRequest; +import com.google.cloud.kms.v1.DecryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class AsyncDecrypt { + + public static void main(String[] args) throws Exception { + asyncDecrypt(); + } + + public static void asyncDecrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + DecryptRequest request = + DecryptRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCiphertext(ByteString.EMPTY) + .setAdditionalAuthenticatedData(ByteString.EMPTY) + .setCiphertextCrc32C(Int64Value.newBuilder().build()) + .setAdditionalAuthenticatedDataCrc32C(Int64Value.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.decryptCallable().futureCall(request); + // Do something. + DecryptResponse response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_decrypt_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt.java new file mode 100644 index 0000000000..ede2128825 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_decrypt_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.DecryptRequest; +import com.google.cloud.kms.v1.DecryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class SyncDecrypt { + + public static void main(String[] args) throws Exception { + syncDecrypt(); + } + + public static void syncDecrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + DecryptRequest request = + DecryptRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCiphertext(ByteString.EMPTY) + .setAdditionalAuthenticatedData(ByteString.EMPTY) + .setCiphertextCrc32C(Int64Value.newBuilder().build()) + .setAdditionalAuthenticatedDataCrc32C(Int64Value.newBuilder().build()) + .build(); + DecryptResponse response = keyManagementServiceClient.decrypt(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_decrypt_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.java new file mode 100644 index 0000000000..c086ea55d0 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_decrypt_cryptokeynamebytestring_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.DecryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncDecryptCryptokeynameBytestring { + + public static void main(String[] args) throws Exception { + syncDecryptCryptokeynameBytestring(); + } + + public static void syncDecryptCryptokeynameBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyName name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + ByteString ciphertext = ByteString.EMPTY; + DecryptResponse response = keyManagementServiceClient.decrypt(name, ciphertext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_decrypt_cryptokeynamebytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.java new file mode 100644 index 0000000000..8b3f1525d9 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_decrypt_stringbytestring_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.DecryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncDecryptStringBytestring { + + public static void main(String[] args) throws Exception { + syncDecryptStringBytestring(); + } + + public static void syncDecryptStringBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + ByteString ciphertext = ByteString.EMPTY; + DecryptResponse response = keyManagementServiceClient.decrypt(name, ciphertext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_decrypt_stringbytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/AsyncDestroyCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/AsyncDestroyCryptoKeyVersion.java new file mode 100644 index 0000000000..8b39340a1b --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/AsyncDestroyCryptoKeyVersion.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncDestroyCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncDestroyCryptoKeyVersion(); + } + + public static void asyncDestroyCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + DestroyCryptoKeyVersionRequest request = + DestroyCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.destroyCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion.java new file mode 100644 index 0000000000..cb7195ef60 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncDestroyCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncDestroyCryptoKeyVersion(); + } + + public static void syncDestroyCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + DestroyCryptoKeyVersionRequest request = + DestroyCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java new file mode 100644 index 0000000000..8833061674 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_cryptokeyversionname_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncDestroyCryptoKeyVersionCryptokeyversionname { + + public static void main(String[] args) throws Exception { + syncDestroyCryptoKeyVersionCryptokeyversionname(); + } + + public static void syncDestroyCryptoKeyVersionCryptokeyversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_cryptokeyversionname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.java new file mode 100644 index 0000000000..d1e2099276 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_string_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncDestroyCryptoKeyVersionString { + + public static void main(String[] args) throws Exception { + syncDestroyCryptoKeyVersionString(); + } + + public static void syncDestroyCryptoKeyVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + CryptoKeyVersion response = keyManagementServiceClient.destroyCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_destroycryptokeyversion_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/AsyncEncrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/AsyncEncrypt.java new file mode 100644 index 0000000000..d102ca32c2 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/AsyncEncrypt.java @@ -0,0 +1,56 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_encrypt_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.EncryptRequest; +import com.google.cloud.kms.v1.EncryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class AsyncEncrypt { + + public static void main(String[] args) throws Exception { + asyncEncrypt(); + } + + public static void asyncEncrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + EncryptRequest request = + EncryptRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPlaintext(ByteString.EMPTY) + .setAdditionalAuthenticatedData(ByteString.EMPTY) + .setPlaintextCrc32C(Int64Value.newBuilder().build()) + .setAdditionalAuthenticatedDataCrc32C(Int64Value.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.encryptCallable().futureCall(request); + // Do something. + EncryptResponse response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_encrypt_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt.java new file mode 100644 index 0000000000..06cfbee231 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_encrypt_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.EncryptRequest; +import com.google.cloud.kms.v1.EncryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; +import com.google.protobuf.Int64Value; + +public class SyncEncrypt { + + public static void main(String[] args) throws Exception { + syncEncrypt(); + } + + public static void syncEncrypt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + EncryptRequest request = + EncryptRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPlaintext(ByteString.EMPTY) + .setAdditionalAuthenticatedData(ByteString.EMPTY) + .setPlaintextCrc32C(Int64Value.newBuilder().build()) + .setAdditionalAuthenticatedDataCrc32C(Int64Value.newBuilder().build()) + .build(); + EncryptResponse response = keyManagementServiceClient.encrypt(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_encrypt_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.java new file mode 100644 index 0000000000..d2903ac55a --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_encrypt_resourcenamebytestring_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.EncryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncEncryptResourcenameBytestring { + + public static void main(String[] args) throws Exception { + syncEncryptResourcenameBytestring(); + } + + public static void syncEncryptResourcenameBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ResourceName name = CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + ByteString plaintext = ByteString.EMPTY; + EncryptResponse response = keyManagementServiceClient.encrypt(name, plaintext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_encrypt_resourcenamebytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.java new file mode 100644 index 0000000000..f2f271f833 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_encrypt_stringbytestring_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.EncryptResponse; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.ByteString; + +public class SyncEncryptStringBytestring { + + public static void main(String[] args) throws Exception { + syncEncryptStringBytestring(); + } + + public static void syncEncryptStringBytestring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + ByteString plaintext = ByteString.EMPTY; + EncryptResponse response = keyManagementServiceClient.encrypt(name, plaintext); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_encrypt_stringbytestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/AsyncGetCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/AsyncGetCryptoKey.java new file mode 100644 index 0000000000..afb9247e9e --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/AsyncGetCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokey_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.GetCryptoKeyRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncGetCryptoKey { + + public static void main(String[] args) throws Exception { + asyncGetCryptoKey(); + } + + public static void asyncGetCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetCryptoKeyRequest request = + GetCryptoKeyRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.getCryptoKeyCallable().futureCall(request); + // Do something. + CryptoKey response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokey_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey.java new file mode 100644 index 0000000000..7171b932e5 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokey_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.GetCryptoKeyRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKey { + + public static void main(String[] args) throws Exception { + syncGetCryptoKey(); + } + + public static void syncGetCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetCryptoKeyRequest request = + GetCryptoKeyRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .build(); + CryptoKey response = keyManagementServiceClient.getCryptoKey(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.java new file mode 100644 index 0000000000..502e82a317 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokey_cryptokeyname_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKeyCryptokeyname { + + public static void main(String[] args) throws Exception { + syncGetCryptoKeyCryptokeyname(); + } + + public static void syncGetCryptoKeyCryptokeyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyName name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + CryptoKey response = keyManagementServiceClient.getCryptoKey(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokey_cryptokeyname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.java new file mode 100644 index 0000000000..29bc7ab985 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokey_string_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKeyString { + + public static void main(String[] args) throws Exception { + syncGetCryptoKeyString(); + } + + public static void syncGetCryptoKeyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + CryptoKey response = keyManagementServiceClient.getCryptoKey(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokey_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/AsyncGetCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/AsyncGetCryptoKeyVersion.java new file mode 100644 index 0000000000..65a78ad558 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/AsyncGetCryptoKeyVersion.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.GetCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncGetCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncGetCryptoKeyVersion(); + } + + public static void asyncGetCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetCryptoKeyVersionRequest request = + GetCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.getCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion.java new file mode 100644 index 0000000000..1262f13387 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.GetCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncGetCryptoKeyVersion(); + } + + public static void syncGetCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetCryptoKeyVersionRequest request = + GetCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + CryptoKeyVersion response = keyManagementServiceClient.getCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java new file mode 100644 index 0000000000..233349f476 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_cryptokeyversionname_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKeyVersionCryptokeyversionname { + + public static void main(String[] args) throws Exception { + syncGetCryptoKeyVersionCryptokeyversionname(); + } + + public static void syncGetCryptoKeyVersionCryptokeyversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + CryptoKeyVersion response = keyManagementServiceClient.getCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_cryptokeyversionname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.java new file mode 100644 index 0000000000..f0cce5d900 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_string_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetCryptoKeyVersionString { + + public static void main(String[] args) throws Exception { + syncGetCryptoKeyVersionString(); + } + + public static void syncGetCryptoKeyVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + CryptoKeyVersion response = keyManagementServiceClient.getCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getcryptokeyversion_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..b9de93dcf1 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/AsyncGetIamPolicy.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getiampolicy_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..3020b367b3 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getiampolicy/SyncGetIamPolicy.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getiampolicy_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = keyManagementServiceClient.getIamPolicy(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getiampolicy_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/AsyncGetImportJob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/AsyncGetImportJob.java new file mode 100644 index 0000000000..6d0981ad41 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/AsyncGetImportJob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getimportjob_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.GetImportJobRequest; +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.ImportJobName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncGetImportJob { + + public static void main(String[] args) throws Exception { + asyncGetImportJob(); + } + + public static void asyncGetImportJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetImportJobRequest request = + GetImportJobRequest.newBuilder() + .setName( + ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.getImportJobCallable().futureCall(request); + // Do something. + ImportJob response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getimportjob_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob.java new file mode 100644 index 0000000000..fab6e0d6d1 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getimportjob_sync] +import com.google.cloud.kms.v1.GetImportJobRequest; +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.ImportJobName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetImportJob { + + public static void main(String[] args) throws Exception { + syncGetImportJob(); + } + + public static void syncGetImportJob() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetImportJobRequest request = + GetImportJobRequest.newBuilder() + .setName( + ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]") + .toString()) + .build(); + ImportJob response = keyManagementServiceClient.getImportJob(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getimportjob_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.java new file mode 100644 index 0000000000..6da1c44cdd --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getimportjob_importjobname_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.ImportJobName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetImportJobImportjobname { + + public static void main(String[] args) throws Exception { + syncGetImportJobImportjobname(); + } + + public static void syncGetImportJobImportjobname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ImportJobName name = + ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]"); + ImportJob response = keyManagementServiceClient.getImportJob(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getimportjob_importjobname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.java new file mode 100644 index 0000000000..4b1abbc094 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getimportjob_string_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.ImportJobName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncGetImportJobString { + + public static void main(String[] args) throws Exception { + syncGetImportJobString(); + } + + public static void syncGetImportJobString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + ImportJobName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[IMPORT_JOB]").toString(); + ImportJob response = keyManagementServiceClient.getImportJob(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getimportjob_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/AsyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/AsyncGetKeyRing.java new file mode 100644 index 0000000000..d11013dd6f --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/AsyncGetKeyRing.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getkeyring_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.GetKeyRingRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.KeyRingName; + +public class AsyncGetKeyRing { + + public static void main(String[] args) throws Exception { + asyncGetKeyRing(); + } + + public static void asyncGetKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetKeyRingRequest request = + GetKeyRingRequest.newBuilder() + .setName(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.getKeyRingCallable().futureCall(request); + // Do something. + KeyRing response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getkeyring_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing.java new file mode 100644 index 0000000000..28470ae260 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getkeyring_sync] +import com.google.cloud.kms.v1.GetKeyRingRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncGetKeyRing { + + public static void main(String[] args) throws Exception { + syncGetKeyRing(); + } + + public static void syncGetKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetKeyRingRequest request = + GetKeyRingRequest.newBuilder() + .setName(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .build(); + KeyRing response = keyManagementServiceClient.getKeyRing(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getkeyring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.java new file mode 100644 index 0000000000..fa265fe9d4 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getkeyring_keyringname_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncGetKeyRingKeyringname { + + public static void main(String[] args) throws Exception { + syncGetKeyRingKeyringname(); + } + + public static void syncGetKeyRingKeyringname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + KeyRingName name = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); + KeyRing response = keyManagementServiceClient.getKeyRing(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getkeyring_keyringname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.java new file mode 100644 index 0000000000..b03662f8b9 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getkeyring_string_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncGetKeyRingString { + + public static void main(String[] args) throws Exception { + syncGetKeyRingString(); + } + + public static void syncGetKeyRingString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString(); + KeyRing response = keyManagementServiceClient.getKeyRing(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getkeyring_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/AsyncGetLocation.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/AsyncGetLocation.java new file mode 100644 index 0000000000..2973834483 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/AsyncGetLocation.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getlocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class AsyncGetLocation { + + public static void main(String[] args) throws Exception { + asyncGetLocation(); + } + + public static void asyncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + keyManagementServiceClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getlocation_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/SyncGetLocation.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/SyncGetLocation.java new file mode 100644 index 0000000000..537c3936a0 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getlocation/SyncGetLocation.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getlocation_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; + +public class SyncGetLocation { + + public static void main(String[] args) throws Exception { + syncGetLocation(); + } + + public static void syncGetLocation() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = keyManagementServiceClient.getLocation(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getlocation_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/AsyncGetPublicKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/AsyncGetPublicKey.java new file mode 100644 index 0000000000..397ebb1bb9 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/AsyncGetPublicKey.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getpublickey_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.GetPublicKeyRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.PublicKey; + +public class AsyncGetPublicKey { + + public static void main(String[] args) throws Exception { + asyncGetPublicKey(); + } + + public static void asyncGetPublicKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetPublicKeyRequest request = + GetPublicKeyRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.getPublicKeyCallable().futureCall(request); + // Do something. + PublicKey response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getpublickey_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey.java new file mode 100644 index 0000000000..4b6fa32989 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getpublickey_sync] +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.GetPublicKeyRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.PublicKey; + +public class SyncGetPublicKey { + + public static void main(String[] args) throws Exception { + syncGetPublicKey(); + } + + public static void syncGetPublicKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + GetPublicKeyRequest request = + GetPublicKeyRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + PublicKey response = keyManagementServiceClient.getPublicKey(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getpublickey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java new file mode 100644 index 0000000000..b519b55302 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getpublickey_cryptokeyversionname_sync] +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.PublicKey; + +public class SyncGetPublicKeyCryptokeyversionname { + + public static void main(String[] args) throws Exception { + syncGetPublicKeyCryptokeyversionname(); + } + + public static void syncGetPublicKeyCryptokeyversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + PublicKey response = keyManagementServiceClient.getPublicKey(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getpublickey_cryptokeyversionname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.java new file mode 100644 index 0000000000..b3f6a56f48 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_getpublickey_string_sync] +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.PublicKey; + +public class SyncGetPublicKeyString { + + public static void main(String[] args) throws Exception { + syncGetPublicKeyString(); + } + + public static void syncGetPublicKeyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + PublicKey response = keyManagementServiceClient.getPublicKey(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_getpublickey_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/AsyncImportCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/AsyncImportCryptoKeyVersion.java new file mode 100644 index 0000000000..3efb40a164 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/AsyncImportCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_importcryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.ImportCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class AsyncImportCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncImportCryptoKeyVersion(); + } + + public static void asyncImportCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ImportCryptoKeyVersionRequest request = + ImportCryptoKeyVersionRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setImportJob("importJob-208547368") + .build(); + ApiFuture future = + keyManagementServiceClient.importCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_importcryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/SyncImportCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/SyncImportCryptoKeyVersion.java new file mode 100644 index 0000000000..5034d89b69 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/importcryptokeyversion/SyncImportCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_importcryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.ImportCryptoKeyVersionRequest; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncImportCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncImportCryptoKeyVersion(); + } + + public static void syncImportCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ImportCryptoKeyVersionRequest request = + ImportCryptoKeyVersionRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setImportJob("importJob-208547368") + .build(); + CryptoKeyVersion response = keyManagementServiceClient.importCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_importcryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys.java new file mode 100644 index 0000000000..fe9030fc82 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys.java @@ -0,0 +1,54 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeys_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListCryptoKeysRequest; + +public class AsyncListCryptoKeys { + + public static void main(String[] args) throws Exception { + asyncListCryptoKeys(); + } + + public static void asyncListCryptoKeys() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeysRequest request = + ListCryptoKeysRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + keyManagementServiceClient.listCryptoKeysPagedCallable().futureCall(request); + // Do something. + for (CryptoKey element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeys_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java new file mode 100644 index 0000000000..dfd0c4752b --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java @@ -0,0 +1,62 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeys_paged_async] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListCryptoKeysRequest; +import com.google.cloud.kms.v1.ListCryptoKeysResponse; +import com.google.common.base.Strings; + +public class AsyncListCryptoKeysPaged { + + public static void main(String[] args) throws Exception { + asyncListCryptoKeysPaged(); + } + + public static void asyncListCryptoKeysPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeysRequest request = + ListCryptoKeysRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListCryptoKeysResponse response = + keyManagementServiceClient.listCryptoKeysCallable().call(request); + for (CryptoKey element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeys_paged_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys.java new file mode 100644 index 0000000000..b82a7ccdeb --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeys_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListCryptoKeysRequest; + +public class SyncListCryptoKeys { + + public static void main(String[] args) throws Exception { + syncListCryptoKeys(); + } + + public static void syncListCryptoKeys() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeysRequest request = + ListCryptoKeysRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (CryptoKey element : keyManagementServiceClient.listCryptoKeys(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeys_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java new file mode 100644 index 0000000000..a2111418f2 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeys_keyringname_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncListCryptoKeysKeyringname { + + public static void main(String[] args) throws Exception { + syncListCryptoKeysKeyringname(); + } + + public static void syncListCryptoKeysKeyringname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + KeyRingName parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); + for (CryptoKey element : keyManagementServiceClient.listCryptoKeys(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeys_keyringname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java new file mode 100644 index 0000000000..e220fe461d --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeys_string_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncListCryptoKeysString { + + public static void main(String[] args) throws Exception { + syncListCryptoKeysString(); + } + + public static void syncListCryptoKeysString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString(); + for (CryptoKey element : keyManagementServiceClient.listCryptoKeys(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeys_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions.java new file mode 100644 index 0000000000..97699e75e6 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions.java @@ -0,0 +1,56 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + +public class AsyncListCryptoKeyVersions { + + public static void main(String[] args) throws Exception { + asyncListCryptoKeyVersions(); + } + + public static void asyncListCryptoKeyVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeyVersionsRequest request = + ListCryptoKeyVersionsRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + keyManagementServiceClient.listCryptoKeyVersionsPagedCallable().futureCall(request); + // Do something. + for (CryptoKeyVersion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java new file mode 100644 index 0000000000..a115308ece --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java @@ -0,0 +1,64 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_paged_async] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; +import com.google.cloud.kms.v1.ListCryptoKeyVersionsResponse; +import com.google.common.base.Strings; + +public class AsyncListCryptoKeyVersionsPaged { + + public static void main(String[] args) throws Exception { + asyncListCryptoKeyVersionsPaged(); + } + + public static void asyncListCryptoKeyVersionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeyVersionsRequest request = + ListCryptoKeyVersionsRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListCryptoKeyVersionsResponse response = + keyManagementServiceClient.listCryptoKeyVersionsCallable().call(request); + for (CryptoKeyVersion element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_paged_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions.java new file mode 100644 index 0000000000..fee573a19e --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions.java @@ -0,0 +1,53 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest; + +public class SyncListCryptoKeyVersions { + + public static void main(String[] args) throws Exception { + syncListCryptoKeyVersions(); + } + + public static void syncListCryptoKeyVersions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListCryptoKeyVersionsRequest request = + ListCryptoKeyVersionsRequest.newBuilder() + .setParent( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (CryptoKeyVersion element : + keyManagementServiceClient.listCryptoKeyVersions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.java new file mode 100644 index 0000000000..3732a4bc2c --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_cryptokeyname_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncListCryptoKeyVersionsCryptokeyname { + + public static void main(String[] args) throws Exception { + syncListCryptoKeyVersionsCryptokeyname(); + } + + public static void syncListCryptoKeyVersionsCryptokeyname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyName parent = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + for (CryptoKeyVersion element : + keyManagementServiceClient.listCryptoKeyVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_cryptokeyname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.java new file mode 100644 index 0000000000..7eeb04ea63 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_string_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncListCryptoKeyVersionsString { + + public static void main(String[] args) throws Exception { + syncListCryptoKeyVersionsString(); + } + + public static void syncListCryptoKeyVersionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + for (CryptoKeyVersion element : + keyManagementServiceClient.listCryptoKeyVersions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listcryptokeyversions_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs.java new file mode 100644 index 0000000000..dcc282f6e7 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs.java @@ -0,0 +1,54 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listimportjobs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListImportJobsRequest; + +public class AsyncListImportJobs { + + public static void main(String[] args) throws Exception { + asyncListImportJobs(); + } + + public static void asyncListImportJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListImportJobsRequest request = + ListImportJobsRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + keyManagementServiceClient.listImportJobsPagedCallable().futureCall(request); + // Do something. + for (ImportJob element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listimportjobs_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java new file mode 100644 index 0000000000..7d24e9d1b4 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java @@ -0,0 +1,62 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listimportjobs_paged_async] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListImportJobsRequest; +import com.google.cloud.kms.v1.ListImportJobsResponse; +import com.google.common.base.Strings; + +public class AsyncListImportJobsPaged { + + public static void main(String[] args) throws Exception { + asyncListImportJobsPaged(); + } + + public static void asyncListImportJobsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListImportJobsRequest request = + ListImportJobsRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListImportJobsResponse response = + keyManagementServiceClient.listImportJobsCallable().call(request); + for (ImportJob element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listimportjobs_paged_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs.java new file mode 100644 index 0000000000..a448fc8d06 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listimportjobs_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; +import com.google.cloud.kms.v1.ListImportJobsRequest; + +public class SyncListImportJobs { + + public static void main(String[] args) throws Exception { + syncListImportJobs(); + } + + public static void syncListImportJobs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListImportJobsRequest request = + ListImportJobsRequest.newBuilder() + .setParent(KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (ImportJob element : keyManagementServiceClient.listImportJobs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listimportjobs_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java new file mode 100644 index 0000000000..c27b7ebb4b --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listimportjobs_keyringname_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncListImportJobsKeyringname { + + public static void main(String[] args) throws Exception { + syncListImportJobsKeyringname(); + } + + public static void syncListImportJobsKeyringname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + KeyRingName parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]"); + for (ImportJob element : keyManagementServiceClient.listImportJobs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listimportjobs_keyringname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java new file mode 100644 index 0000000000..16a7cf09fa --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listimportjobs_string_sync] +import com.google.cloud.kms.v1.ImportJob; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRingName; + +public class SyncListImportJobsString { + + public static void main(String[] args) throws Exception { + syncListImportJobsString(); + } + + public static void syncListImportJobsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = KeyRingName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]").toString(); + for (ImportJob element : keyManagementServiceClient.listImportJobs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listimportjobs_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings.java new file mode 100644 index 0000000000..c1aec87eb4 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings.java @@ -0,0 +1,54 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listkeyrings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.ListKeyRingsRequest; +import com.google.cloud.kms.v1.LocationName; + +public class AsyncListKeyRings { + + public static void main(String[] args) throws Exception { + asyncListKeyRings(); + } + + public static void asyncListKeyRings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListKeyRingsRequest request = + ListKeyRingsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + keyManagementServiceClient.listKeyRingsPagedCallable().futureCall(request); + // Do something. + for (KeyRing element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listkeyrings_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java new file mode 100644 index 0000000000..e25f43d528 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java @@ -0,0 +1,62 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listkeyrings_paged_async] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.ListKeyRingsRequest; +import com.google.cloud.kms.v1.ListKeyRingsResponse; +import com.google.cloud.kms.v1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListKeyRingsPaged { + + public static void main(String[] args) throws Exception { + asyncListKeyRingsPaged(); + } + + public static void asyncListKeyRingsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListKeyRingsRequest request = + ListKeyRingsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListKeyRingsResponse response = + keyManagementServiceClient.listKeyRingsCallable().call(request); + for (KeyRing element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listkeyrings_paged_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings.java new file mode 100644 index 0000000000..44a39dee7c --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listkeyrings_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.ListKeyRingsRequest; +import com.google.cloud.kms.v1.LocationName; + +public class SyncListKeyRings { + + public static void main(String[] args) throws Exception { + syncListKeyRings(); + } + + public static void syncListKeyRings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListKeyRingsRequest request = + ListKeyRingsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (KeyRing element : keyManagementServiceClient.listKeyRings(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listkeyrings_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java new file mode 100644 index 0000000000..02099fdcae --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listkeyrings_locationname_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class SyncListKeyRingsLocationname { + + public static void main(String[] args) throws Exception { + syncListKeyRingsLocationname(); + } + + public static void syncListKeyRingsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (KeyRing element : keyManagementServiceClient.listKeyRings(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listkeyrings_locationname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java new file mode 100644 index 0000000000..5dc2d3699a --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listkeyrings_string_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.KeyRing; +import com.google.cloud.kms.v1.LocationName; + +public class SyncListKeyRingsString { + + public static void main(String[] args) throws Exception { + syncListKeyRingsString(); + } + + public static void syncListKeyRingsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (KeyRing element : keyManagementServiceClient.listKeyRings(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listkeyrings_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations.java new file mode 100644 index 0000000000..a354b9b818 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listlocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class AsyncListLocations { + + public static void main(String[] args) throws Exception { + asyncListLocations(); + } + + public static void asyncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + keyManagementServiceClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listlocations_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.java new file mode 100644 index 0000000000..589208db57 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listlocations_paged_async] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; + +public class AsyncListLocationsPaged { + + public static void main(String[] args) throws Exception { + asyncListLocationsPaged(); + } + + public static void asyncListLocationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + keyManagementServiceClient.listLocationsCallable().call(request); + for (Location element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listlocations_paged_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/SyncListLocations.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/SyncListLocations.java new file mode 100644 index 0000000000..51d7a597a9 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/SyncListLocations.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_listlocations_sync] +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; + +public class SyncListLocations { + + public static void main(String[] args) throws Exception { + syncListLocations(); + } + + public static void syncListLocations() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : keyManagementServiceClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_listlocations_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/AsyncRestoreCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/AsyncRestoreCryptoKeyVersion.java new file mode 100644 index 0000000000..99c01083dd --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/AsyncRestoreCryptoKeyVersion.java @@ -0,0 +1,55 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + +public class AsyncRestoreCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncRestoreCryptoKeyVersion(); + } + + public static void asyncRestoreCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + RestoreCryptoKeyVersionRequest request = + RestoreCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + ApiFuture future = + keyManagementServiceClient.restoreCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion.java new file mode 100644 index 0000000000..db1b5f42ef --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest; + +public class SyncRestoreCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncRestoreCryptoKeyVersion(); + } + + public static void syncRestoreCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + RestoreCryptoKeyVersionRequest request = + RestoreCryptoKeyVersionRequest.newBuilder() + .setName( + CryptoKeyVersionName.of( + "[PROJECT]", + "[LOCATION]", + "[KEY_RING]", + "[CRYPTO_KEY]", + "[CRYPTO_KEY_VERSION]") + .toString()) + .build(); + CryptoKeyVersion response = keyManagementServiceClient.restoreCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java new file mode 100644 index 0000000000..e19636c91b --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_cryptokeyversionname_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncRestoreCryptoKeyVersionCryptokeyversionname { + + public static void main(String[] args) throws Exception { + syncRestoreCryptoKeyVersionCryptokeyversionname(); + } + + public static void syncRestoreCryptoKeyVersionCryptokeyversionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersionName name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]"); + CryptoKeyVersion response = keyManagementServiceClient.restoreCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_cryptokeyversionname_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.java new file mode 100644 index 0000000000..bf35052c9f --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_string_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.CryptoKeyVersionName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncRestoreCryptoKeyVersionString { + + public static void main(String[] args) throws Exception { + syncRestoreCryptoKeyVersionString(); + } + + public static void syncRestoreCryptoKeyVersionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyVersionName.of( + "[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]", "[CRYPTO_KEY_VERSION]") + .toString(); + CryptoKeyVersion response = keyManagementServiceClient.restoreCryptoKeyVersion(name); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_restorecryptokeyversion_string_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..cc00c4a773 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/AsyncTestIamPermissions.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + keyManagementServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_testiampermissions_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..b1db511b62 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/testiampermissions/SyncTestIamPermissions.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_testiampermissions_sync] +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = keyManagementServiceClient.testIamPermissions(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_testiampermissions_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/AsyncUpdateCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/AsyncUpdateCryptoKey.java new file mode 100644 index 0000000000..d6ffefaa14 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/AsyncUpdateCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokey_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCryptoKey { + + public static void main(String[] args) throws Exception { + asyncUpdateCryptoKey(); + } + + public static void asyncUpdateCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyRequest request = + UpdateCryptoKeyRequest.newBuilder() + .setCryptoKey(CryptoKey.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.updateCryptoKeyCallable().futureCall(request); + // Do something. + CryptoKey response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokey_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey.java new file mode 100644 index 0000000000..f9af1159d2 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokey_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCryptoKey { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKey(); + } + + public static void syncUpdateCryptoKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyRequest request = + UpdateCryptoKeyRequest.newBuilder() + .setCryptoKey(CryptoKey.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CryptoKey response = keyManagementServiceClient.updateCryptoKey(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokey_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.java new file mode 100644 index 0000000000..a908aaa8ef --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokey_cryptokeyfieldmask_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCryptoKeyCryptokeyFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyCryptokeyFieldmask(); + } + + public static void syncUpdateCryptoKeyCryptokeyFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKey cryptoKey = CryptoKey.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + CryptoKey response = keyManagementServiceClient.updateCryptoKey(cryptoKey, updateMask); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokey_cryptokeyfieldmask_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/AsyncUpdateCryptoKeyPrimaryVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/AsyncUpdateCryptoKeyPrimaryVersion.java new file mode 100644 index 0000000000..c60249a2fe --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/AsyncUpdateCryptoKeyPrimaryVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + +public class AsyncUpdateCryptoKeyPrimaryVersion { + + public static void main(String[] args) throws Exception { + asyncUpdateCryptoKeyPrimaryVersion(); + } + + public static void asyncUpdateCryptoKeyPrimaryVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyPrimaryVersionRequest request = + UpdateCryptoKeyPrimaryVersionRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCryptoKeyVersionId("cryptoKeyVersionId987674581") + .build(); + ApiFuture future = + keyManagementServiceClient.updateCryptoKeyPrimaryVersionCallable().futureCall(request); + // Do something. + CryptoKey response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion.java new file mode 100644 index 0000000000..9ffc5a1634 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest; + +public class SyncUpdateCryptoKeyPrimaryVersion { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyPrimaryVersion(); + } + + public static void syncUpdateCryptoKeyPrimaryVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyPrimaryVersionRequest request = + UpdateCryptoKeyPrimaryVersionRequest.newBuilder() + .setName( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCryptoKeyVersionId("cryptoKeyVersionId987674581") + .build(); + CryptoKey response = keyManagementServiceClient.updateCryptoKeyPrimaryVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java new file mode 100644 index 0000000000..2c51ac8a44 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_cryptokeynamestring_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncUpdateCryptoKeyPrimaryVersionCryptokeynameString { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyPrimaryVersionCryptokeynameString(); + } + + public static void syncUpdateCryptoKeyPrimaryVersionCryptokeynameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyName name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + String cryptoKeyVersionId = "cryptoKeyVersionId987674581"; + CryptoKey response = + keyManagementServiceClient.updateCryptoKeyPrimaryVersion(name, cryptoKeyVersionId); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_cryptokeynamestring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.java new file mode 100644 index 0000000000..7d8e67a671 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_stringstring_sync] +import com.google.cloud.kms.v1.CryptoKey; +import com.google.cloud.kms.v1.CryptoKeyName; +import com.google.cloud.kms.v1.KeyManagementServiceClient; + +public class SyncUpdateCryptoKeyPrimaryVersionStringString { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyPrimaryVersionStringString(); + } + + public static void syncUpdateCryptoKeyPrimaryVersionStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + String name = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + String cryptoKeyVersionId = "cryptoKeyVersionId987674581"; + CryptoKey response = + keyManagementServiceClient.updateCryptoKeyPrimaryVersion(name, cryptoKeyVersionId); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyprimaryversion_stringstring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/AsyncUpdateCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/AsyncUpdateCryptoKeyVersion.java new file mode 100644 index 0000000000..eb72033e50 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/AsyncUpdateCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + asyncUpdateCryptoKeyVersion(); + } + + public static void asyncUpdateCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyVersionRequest request = + UpdateCryptoKeyVersionRequest.newBuilder() + .setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + keyManagementServiceClient.updateCryptoKeyVersionCallable().futureCall(request); + // Do something. + CryptoKeyVersion response = future.get(); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_async] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion.java new file mode 100644 index 0000000000..84d39b0ea4 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCryptoKeyVersion { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyVersion(); + } + + public static void syncUpdateCryptoKeyVersion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + UpdateCryptoKeyVersionRequest request = + UpdateCryptoKeyVersionRequest.newBuilder() + .setCryptoKeyVersion(CryptoKeyVersion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CryptoKeyVersion response = keyManagementServiceClient.updateCryptoKeyVersion(request); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java new file mode 100644 index 0000000000..d6ddd7f871 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java @@ -0,0 +1,42 @@ +/* + * 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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_cryptokeyversionfieldmask_sync] +import com.google.cloud.kms.v1.CryptoKeyVersion; +import com.google.cloud.kms.v1.KeyManagementServiceClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCryptoKeyVersionCryptokeyversionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateCryptoKeyVersionCryptokeyversionFieldmask(); + } + + public static void syncUpdateCryptoKeyVersionCryptokeyversionFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (KeyManagementServiceClient keyManagementServiceClient = + KeyManagementServiceClient.create()) { + CryptoKeyVersion cryptoKeyVersion = CryptoKeyVersion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + CryptoKeyVersion response = + keyManagementServiceClient.updateCryptoKeyVersion(cryptoKeyVersion, updateMask); + } + } +} +// [END kms_v1_generated_keymanagementserviceclient_updatecryptokeyversion_cryptokeyversionfieldmask_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.java new file mode 100644 index 0000000000..65a3a77274 --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementservicesettings/getkeyring/SyncGetKeyRing.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.kms.v1.samples; + +// [START kms_v1_generated_keymanagementservicesettings_getkeyring_sync] +import com.google.cloud.kms.v1.KeyManagementServiceSettings; +import java.time.Duration; + +public class SyncGetKeyRing { + + public static void main(String[] args) throws Exception { + syncGetKeyRing(); + } + + public static void syncGetKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + KeyManagementServiceSettings.Builder keyManagementServiceSettingsBuilder = + KeyManagementServiceSettings.newBuilder(); + keyManagementServiceSettingsBuilder + .getKeyRingSettings() + .setRetrySettings( + keyManagementServiceSettingsBuilder + .getKeyRingSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + KeyManagementServiceSettings keyManagementServiceSettings = + keyManagementServiceSettingsBuilder.build(); + } +} +// [END kms_v1_generated_keymanagementservicesettings_getkeyring_sync] diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.java new file mode 100644 index 0000000000..511287cfbc --- /dev/null +++ b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/stub/keymanagementservicestubsettings/getkeyring/SyncGetKeyRing.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.kms.v1.stub.samples; + +// [START kms_v1_generated_keymanagementservicestubsettings_getkeyring_sync] +import com.google.cloud.kms.v1.stub.KeyManagementServiceStubSettings; +import java.time.Duration; + +public class SyncGetKeyRing { + + public static void main(String[] args) throws Exception { + syncGetKeyRing(); + } + + public static void syncGetKeyRing() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + KeyManagementServiceStubSettings.Builder keyManagementServiceSettingsBuilder = + KeyManagementServiceStubSettings.newBuilder(); + keyManagementServiceSettingsBuilder + .getKeyRingSettings() + .setRetrySettings( + keyManagementServiceSettingsBuilder + .getKeyRingSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + KeyManagementServiceStubSettings keyManagementServiceSettings = + keyManagementServiceSettingsBuilder.build(); + } +} +// [END kms_v1_generated_keymanagementservicestubsettings_getkeyring_sync] diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/CryptoKeyName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/CryptoKeyName.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyName.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/CryptoKeyVersionName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/CryptoKeyVersionName.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/CryptoKeyVersionName.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/ImportJobName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/ImportJobName.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/ImportJobName.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceClient.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceClient.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClient.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceClientTest.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/KeyManagementServiceSettings.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyManagementServiceSettings.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/KeyRingName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/KeyRingName.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/KeyRingName.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/LocationName.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/LocationName.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/LocationName.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/MockKeyManagementService.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/MockKeyManagementService.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementService.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/MockKeyManagementServiceImpl.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/gapic_metadata.json b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/gapic_metadata.json rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/gapic_metadata.json diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/package-info.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/package-info.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/package-info.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceCallableFactory.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/GrpcKeyManagementServiceStub.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStub.java diff --git a/test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java b/test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java rename to test/integration/goldens/kms/src/com/google/cloud/kms/v1/stub/KeyManagementServiceStubSettings.java diff --git a/test/integration/goldens/kms/com/google/cloud/location/MockLocations.java b/test/integration/goldens/kms/src/com/google/cloud/location/MockLocations.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/location/MockLocations.java rename to test/integration/goldens/kms/src/com/google/cloud/location/MockLocations.java diff --git a/test/integration/goldens/kms/com/google/cloud/location/MockLocationsImpl.java b/test/integration/goldens/kms/src/com/google/cloud/location/MockLocationsImpl.java similarity index 100% rename from test/integration/goldens/kms/com/google/cloud/location/MockLocationsImpl.java rename to test/integration/goldens/kms/src/com/google/cloud/location/MockLocationsImpl.java diff --git a/test/integration/goldens/kms/com/google/iam/v1/MockIAMPolicy.java b/test/integration/goldens/kms/src/com/google/iam/v1/MockIAMPolicy.java similarity index 100% rename from test/integration/goldens/kms/com/google/iam/v1/MockIAMPolicy.java rename to test/integration/goldens/kms/src/com/google/iam/v1/MockIAMPolicy.java diff --git a/test/integration/goldens/kms/com/google/iam/v1/MockIAMPolicyImpl.java b/test/integration/goldens/kms/src/com/google/iam/v1/MockIAMPolicyImpl.java similarity index 100% rename from test/integration/goldens/kms/com/google/iam/v1/MockIAMPolicyImpl.java rename to test/integration/goldens/kms/src/com/google/iam/v1/MockIAMPolicyImpl.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..cb1ae3c17d --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.cloud.example.library.v1.LibraryServiceSettings; +import com.google.cloud.example.library.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. + LibraryServiceSettings libraryServiceSettings = + LibraryServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings); + } +} +// [END library_v1_generated_libraryserviceclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..0635adf8c6 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_create_setendpoint_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.cloud.example.library.v1.LibraryServiceSettings; +import com.google.cloud.example.library.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. + LibraryServiceSettings libraryServiceSettings = + LibraryServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + LibraryServiceClient libraryServiceClient = LibraryServiceClient.create(libraryServiceSettings); + } +} +// [END library_v1_generated_libraryserviceclient_create_setendpoint_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/AsyncCreateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/AsyncCreateBook.java new file mode 100644 index 0000000000..f01d9f0121 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/AsyncCreateBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createbook_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.ShelfName; + +public class AsyncCreateBook { + + public static void main(String[] args) throws Exception { + asyncCreateBook(); + } + + public static void asyncCreateBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + CreateBookRequest request = + CreateBookRequest.newBuilder() + .setParent(ShelfName.of("[SHELF_ID]").toString()) + .setBook(Book.newBuilder().build()) + .build(); + ApiFuture future = libraryServiceClient.createBookCallable().futureCall(request); + // Do something. + Book response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_createbook_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook.java new file mode 100644 index 0000000000..6b593d4d58 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createbook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.CreateBookRequest; +import com.google.example.library.v1.ShelfName; + +public class SyncCreateBook { + + public static void main(String[] args) throws Exception { + syncCreateBook(); + } + + public static void syncCreateBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + CreateBookRequest request = + CreateBookRequest.newBuilder() + .setParent(ShelfName.of("[SHELF_ID]").toString()) + .setBook(Book.newBuilder().build()) + .build(); + Book response = libraryServiceClient.createBook(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_createbook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.java new file mode 100644 index 0000000000..da33aa07d9 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createbook_shelfnamebook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ShelfName; + +public class SyncCreateBookShelfnameBook { + + public static void main(String[] args) throws Exception { + syncCreateBookShelfnameBook(); + } + + public static void syncCreateBookShelfnameBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName parent = ShelfName.of("[SHELF_ID]"); + Book book = Book.newBuilder().build(); + Book response = libraryServiceClient.createBook(parent, book); + } + } +} +// [END library_v1_generated_libraryserviceclient_createbook_shelfnamebook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.java new file mode 100644 index 0000000000..0f6e1798be --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createbook_stringbook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ShelfName; + +public class SyncCreateBookStringBook { + + public static void main(String[] args) throws Exception { + syncCreateBookStringBook(); + } + + public static void syncCreateBookStringBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String parent = ShelfName.of("[SHELF_ID]").toString(); + Book book = Book.newBuilder().build(); + Book response = libraryServiceClient.createBook(parent, book); + } + } +} +// [END library_v1_generated_libraryserviceclient_createbook_stringbook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/AsyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/AsyncCreateShelf.java new file mode 100644 index 0000000000..0e2e7caead --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/AsyncCreateShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createshelf_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.Shelf; + +public class AsyncCreateShelf { + + public static void main(String[] args) throws Exception { + asyncCreateShelf(); + } + + public static void asyncCreateShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + CreateShelfRequest request = + CreateShelfRequest.newBuilder().setShelf(Shelf.newBuilder().build()).build(); + ApiFuture future = libraryServiceClient.createShelfCallable().futureCall(request); + // Do something. + Shelf response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_createshelf_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf.java new file mode 100644 index 0000000000..de9ecdb0c1 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createshelf_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.CreateShelfRequest; +import com.google.example.library.v1.Shelf; + +public class SyncCreateShelf { + + public static void main(String[] args) throws Exception { + syncCreateShelf(); + } + + public static void syncCreateShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + CreateShelfRequest request = + CreateShelfRequest.newBuilder().setShelf(Shelf.newBuilder().build()).build(); + Shelf response = libraryServiceClient.createShelf(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_createshelf_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.java new file mode 100644 index 0000000000..ebf578cbd1 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_createshelf_shelf_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; + +public class SyncCreateShelfShelf { + + public static void main(String[] args) throws Exception { + syncCreateShelfShelf(); + } + + public static void syncCreateShelfShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + Shelf shelf = Shelf.newBuilder().build(); + Shelf response = libraryServiceClient.createShelf(shelf); + } + } +} +// [END library_v1_generated_libraryserviceclient_createshelf_shelf_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/AsyncDeleteBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/AsyncDeleteBook.java new file mode 100644 index 0000000000..4f8c7cb482 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/AsyncDeleteBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deletebook_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.protobuf.Empty; + +public class AsyncDeleteBook { + + public static void main(String[] args) throws Exception { + asyncDeleteBook(); + } + + public static void asyncDeleteBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .build(); + ApiFuture future = libraryServiceClient.deleteBookCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_deletebook_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook.java new file mode 100644 index 0000000000..eb1d1783cc --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deletebook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.DeleteBookRequest; +import com.google.protobuf.Empty; + +public class SyncDeleteBook { + + public static void main(String[] args) throws Exception { + syncDeleteBook(); + } + + public static void syncDeleteBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + DeleteBookRequest request = + DeleteBookRequest.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .build(); + libraryServiceClient.deleteBook(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_deletebook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.java new file mode 100644 index 0000000000..195bb8beed --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deletebook_bookname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.BookName; +import com.google.protobuf.Empty; + +public class SyncDeleteBookBookname { + + public static void main(String[] args) throws Exception { + syncDeleteBookBookname(); + } + + public static void syncDeleteBookBookname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + libraryServiceClient.deleteBook(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_deletebook_bookname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.java new file mode 100644 index 0000000000..4500043b48 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deletebook_string_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.BookName; +import com.google.protobuf.Empty; + +public class SyncDeleteBookString { + + public static void main(String[] args) throws Exception { + syncDeleteBookString(); + } + + public static void syncDeleteBookString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = BookName.of("[SHELF]", "[BOOK]").toString(); + libraryServiceClient.deleteBook(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_deletebook_string_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/AsyncDeleteShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/AsyncDeleteShelf.java new file mode 100644 index 0000000000..420edb975f --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/AsyncDeleteShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deleteshelf_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.ShelfName; +import com.google.protobuf.Empty; + +public class AsyncDeleteShelf { + + public static void main(String[] args) throws Exception { + asyncDeleteShelf(); + } + + public static void asyncDeleteShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + DeleteShelfRequest request = + DeleteShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build(); + ApiFuture future = libraryServiceClient.deleteShelfCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_deleteshelf_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf.java new file mode 100644 index 0000000000..45bdccf0ff --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deleteshelf_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.DeleteShelfRequest; +import com.google.example.library.v1.ShelfName; +import com.google.protobuf.Empty; + +public class SyncDeleteShelf { + + public static void main(String[] args) throws Exception { + syncDeleteShelf(); + } + + public static void syncDeleteShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + DeleteShelfRequest request = + DeleteShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build(); + libraryServiceClient.deleteShelf(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_deleteshelf_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.java new file mode 100644 index 0000000000..703b210a31 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deleteshelf_shelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.ShelfName; +import com.google.protobuf.Empty; + +public class SyncDeleteShelfShelfname { + + public static void main(String[] args) throws Exception { + syncDeleteShelfShelfname(); + } + + public static void syncDeleteShelfShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName name = ShelfName.of("[SHELF_ID]"); + libraryServiceClient.deleteShelf(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_deleteshelf_shelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.java new file mode 100644 index 0000000000..9b13123cae --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_deleteshelf_string_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.ShelfName; +import com.google.protobuf.Empty; + +public class SyncDeleteShelfString { + + public static void main(String[] args) throws Exception { + syncDeleteShelfString(); + } + + public static void syncDeleteShelfString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = ShelfName.of("[SHELF_ID]").toString(); + libraryServiceClient.deleteShelf(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_deleteshelf_string_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/AsyncGetBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/AsyncGetBook.java new file mode 100644 index 0000000000..7d2e5d5923 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/AsyncGetBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getbook_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.GetBookRequest; + +public class AsyncGetBook { + + public static void main(String[] args) throws Exception { + asyncGetBook(); + } + + public static void asyncGetBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + GetBookRequest request = + GetBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).build(); + ApiFuture future = libraryServiceClient.getBookCallable().futureCall(request); + // Do something. + Book response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_getbook_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook.java new file mode 100644 index 0000000000..86ee72d85a --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getbook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.GetBookRequest; + +public class SyncGetBook { + + public static void main(String[] args) throws Exception { + syncGetBook(); + } + + public static void syncGetBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + GetBookRequest request = + GetBookRequest.newBuilder().setName(BookName.of("[SHELF]", "[BOOK]").toString()).build(); + Book response = libraryServiceClient.getBook(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_getbook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.java new file mode 100644 index 0000000000..616dd30c7a --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getbook_bookname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; + +public class SyncGetBookBookname { + + public static void main(String[] args) throws Exception { + syncGetBookBookname(); + } + + public static void syncGetBookBookname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + Book response = libraryServiceClient.getBook(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_getbook_bookname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.java new file mode 100644 index 0000000000..85bd33a6d1 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getbook_string_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; + +public class SyncGetBookString { + + public static void main(String[] args) throws Exception { + syncGetBookString(); + } + + public static void syncGetBookString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = BookName.of("[SHELF]", "[BOOK]").toString(); + Book response = libraryServiceClient.getBook(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_getbook_string_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/AsyncGetShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/AsyncGetShelf.java new file mode 100644 index 0000000000..64549e0341 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/AsyncGetShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getshelf_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.GetShelfRequest; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class AsyncGetShelf { + + public static void main(String[] args) throws Exception { + asyncGetShelf(); + } + + public static void asyncGetShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + GetShelfRequest request = + GetShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build(); + ApiFuture future = libraryServiceClient.getShelfCallable().futureCall(request); + // Do something. + Shelf response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_getshelf_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf.java new file mode 100644 index 0000000000..4b15cde43b --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getshelf_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.GetShelfRequest; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncGetShelf { + + public static void main(String[] args) throws Exception { + syncGetShelf(); + } + + public static void syncGetShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + GetShelfRequest request = + GetShelfRequest.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).build(); + Shelf response = libraryServiceClient.getShelf(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_getshelf_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.java new file mode 100644 index 0000000000..55fe6e60eb --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getshelf_shelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncGetShelfShelfname { + + public static void main(String[] args) throws Exception { + syncGetShelfShelfname(); + } + + public static void syncGetShelfShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName name = ShelfName.of("[SHELF_ID]"); + Shelf response = libraryServiceClient.getShelf(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_getshelf_shelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.java new file mode 100644 index 0000000000..4182d61edd --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_getshelf_string_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncGetShelfString { + + public static void main(String[] args) throws Exception { + syncGetShelfString(); + } + + public static void syncGetShelfString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = ShelfName.of("[SHELF_ID]").toString(); + Shelf response = libraryServiceClient.getShelf(name); + } + } +} +// [END library_v1_generated_libraryserviceclient_getshelf_string_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks.java new file mode 100644 index 0000000000..8e662c19f5 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listbooks_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ShelfName; + +public class AsyncListBooks { + + public static void main(String[] args) throws Exception { + asyncListBooks(); + } + + public static void asyncListBooks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setParent(ShelfName.of("[SHELF_ID]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = libraryServiceClient.listBooksPagedCallable().futureCall(request); + // Do something. + for (Book element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listbooks_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java new file mode 100644 index 0000000000..9335eee8fa --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listbooks_paged_async] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.common.base.Strings; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ListBooksResponse; +import com.google.example.library.v1.ShelfName; + +public class AsyncListBooksPaged { + + public static void main(String[] args) throws Exception { + asyncListBooksPaged(); + } + + public static void asyncListBooksPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setParent(ShelfName.of("[SHELF_ID]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListBooksResponse response = libraryServiceClient.listBooksCallable().call(request); + for (Book element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listbooks_paged_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks.java new file mode 100644 index 0000000000..90672f2a15 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listbooks_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ListBooksRequest; +import com.google.example.library.v1.ShelfName; + +public class SyncListBooks { + + public static void main(String[] args) throws Exception { + syncListBooks(); + } + + public static void syncListBooks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListBooksRequest request = + ListBooksRequest.newBuilder() + .setParent(ShelfName.of("[SHELF_ID]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Book element : libraryServiceClient.listBooks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listbooks_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.java new file mode 100644 index 0000000000..8669c72af0 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listbooks_shelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ShelfName; + +public class SyncListBooksShelfname { + + public static void main(String[] args) throws Exception { + syncListBooksShelfname(); + } + + public static void syncListBooksShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName parent = ShelfName.of("[SHELF_ID]"); + for (Book element : libraryServiceClient.listBooks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listbooks_shelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.java new file mode 100644 index 0000000000..ca888a75d3 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listbooks_string_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.ShelfName; + +public class SyncListBooksString { + + public static void main(String[] args) throws Exception { + syncListBooksString(); + } + + public static void syncListBooksString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String parent = ShelfName.of("[SHELF_ID]").toString(); + for (Book element : libraryServiceClient.listBooks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listbooks_string_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves.java new file mode 100644 index 0000000000..c3ec8afe8e --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listshelves_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.Shelf; + +public class AsyncListShelves { + + public static void main(String[] args) throws Exception { + asyncListShelves(); + } + + public static void asyncListShelves() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListShelvesRequest request = + ListShelvesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = libraryServiceClient.listShelvesPagedCallable().futureCall(request); + // Do something. + for (Shelf element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listshelves_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java new file mode 100644 index 0000000000..c37d79ce0f --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java @@ -0,0 +1,56 @@ +/* + * 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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listshelves_paged_async] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.common.base.Strings; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.ListShelvesResponse; +import com.google.example.library.v1.Shelf; + +public class AsyncListShelvesPaged { + + public static void main(String[] args) throws Exception { + asyncListShelvesPaged(); + } + + public static void asyncListShelvesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListShelvesRequest request = + ListShelvesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListShelvesResponse response = libraryServiceClient.listShelvesCallable().call(request); + for (Shelf element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listshelves_paged_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/SyncListShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/SyncListShelves.java new file mode 100644 index 0000000000..8c1126dbea --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/SyncListShelves.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_listshelves_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.ListShelvesRequest; +import com.google.example.library.v1.Shelf; + +public class SyncListShelves { + + public static void main(String[] args) throws Exception { + syncListShelves(); + } + + public static void syncListShelves() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ListShelvesRequest request = + ListShelvesRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Shelf element : libraryServiceClient.listShelves(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END library_v1_generated_libraryserviceclient_listshelves_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/AsyncMergeShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/AsyncMergeShelves.java new file mode 100644 index 0000000000..ceb7b3484b --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/AsyncMergeShelves.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class AsyncMergeShelves { + + public static void main(String[] args) throws Exception { + asyncMergeShelves(); + } + + public static void asyncMergeShelves() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + MergeShelvesRequest request = + MergeShelvesRequest.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setOtherShelf(ShelfName.of("[SHELF_ID]").toString()) + .build(); + ApiFuture future = libraryServiceClient.mergeShelvesCallable().futureCall(request); + // Do something. + Shelf response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves.java new file mode 100644 index 0000000000..cd4880bd6e --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.MergeShelvesRequest; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncMergeShelves { + + public static void main(String[] args) throws Exception { + syncMergeShelves(); + } + + public static void syncMergeShelves() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + MergeShelvesRequest request = + MergeShelvesRequest.newBuilder() + .setName(ShelfName.of("[SHELF_ID]").toString()) + .setOtherShelf(ShelfName.of("[SHELF_ID]").toString()) + .build(); + Shelf response = libraryServiceClient.mergeShelves(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.java new file mode 100644 index 0000000000..bdd3bbd9f3 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_shelfnameshelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncMergeShelvesShelfnameShelfname { + + public static void main(String[] args) throws Exception { + syncMergeShelvesShelfnameShelfname(); + } + + public static void syncMergeShelvesShelfnameShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName name = ShelfName.of("[SHELF_ID]"); + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + Shelf response = libraryServiceClient.mergeShelves(name, otherShelf); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_shelfnameshelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.java new file mode 100644 index 0000000000..30b07581e2 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_shelfnamestring_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncMergeShelvesShelfnameString { + + public static void main(String[] args) throws Exception { + syncMergeShelvesShelfnameString(); + } + + public static void syncMergeShelvesShelfnameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + ShelfName name = ShelfName.of("[SHELF_ID]"); + String otherShelf = ShelfName.of("[SHELF_ID]").toString(); + Shelf response = libraryServiceClient.mergeShelves(name, otherShelf); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_shelfnamestring_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.java new file mode 100644 index 0000000000..a35863f85c --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_stringshelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncMergeShelvesStringShelfname { + + public static void main(String[] args) throws Exception { + syncMergeShelvesStringShelfname(); + } + + public static void syncMergeShelvesStringShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = ShelfName.of("[SHELF_ID]").toString(); + ShelfName otherShelf = ShelfName.of("[SHELF_ID]"); + Shelf response = libraryServiceClient.mergeShelves(name, otherShelf); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_stringshelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.java new file mode 100644 index 0000000000..3e7b021146 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_mergeshelves_stringstring_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Shelf; +import com.google.example.library.v1.ShelfName; + +public class SyncMergeShelvesStringString { + + public static void main(String[] args) throws Exception { + syncMergeShelvesStringString(); + } + + public static void syncMergeShelvesStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = ShelfName.of("[SHELF_ID]").toString(); + String otherShelf = ShelfName.of("[SHELF_ID]").toString(); + Shelf response = libraryServiceClient.mergeShelves(name, otherShelf); + } + } +} +// [END library_v1_generated_libraryserviceclient_mergeshelves_stringstring_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/AsyncMoveBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/AsyncMoveBook.java new file mode 100644 index 0000000000..2269627946 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/AsyncMoveBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.ShelfName; + +public class AsyncMoveBook { + + public static void main(String[] args) throws Exception { + asyncMoveBook(); + } + + public static void asyncMoveBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + MoveBookRequest request = + MoveBookRequest.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setOtherShelfName(ShelfName.of("[SHELF_ID]").toString()) + .build(); + ApiFuture future = libraryServiceClient.moveBookCallable().futureCall(request); + // Do something. + Book response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook.java new file mode 100644 index 0000000000..cf9d52b768 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.MoveBookRequest; +import com.google.example.library.v1.ShelfName; + +public class SyncMoveBook { + + public static void main(String[] args) throws Exception { + syncMoveBook(); + } + + public static void syncMoveBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + MoveBookRequest request = + MoveBookRequest.newBuilder() + .setName(BookName.of("[SHELF]", "[BOOK]").toString()) + .setOtherShelfName(ShelfName.of("[SHELF_ID]").toString()) + .build(); + Book response = libraryServiceClient.moveBook(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.java new file mode 100644 index 0000000000..228696e512 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_booknameshelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.ShelfName; + +public class SyncMoveBookBooknameShelfname { + + public static void main(String[] args) throws Exception { + syncMoveBookBooknameShelfname(); + } + + public static void syncMoveBookBooknameShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + Book response = libraryServiceClient.moveBook(name, otherShelfName); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_booknameshelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.java new file mode 100644 index 0000000000..a85e71ca34 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_booknamestring_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.ShelfName; + +public class SyncMoveBookBooknameString { + + public static void main(String[] args) throws Exception { + syncMoveBookBooknameString(); + } + + public static void syncMoveBookBooknameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + BookName name = BookName.of("[SHELF]", "[BOOK]"); + String otherShelfName = ShelfName.of("[SHELF_ID]").toString(); + Book response = libraryServiceClient.moveBook(name, otherShelfName); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_booknamestring_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.java new file mode 100644 index 0000000000..3ab3f3b124 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_stringshelfname_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.ShelfName; + +public class SyncMoveBookStringShelfname { + + public static void main(String[] args) throws Exception { + syncMoveBookStringShelfname(); + } + + public static void syncMoveBookStringShelfname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = BookName.of("[SHELF]", "[BOOK]").toString(); + ShelfName otherShelfName = ShelfName.of("[SHELF_ID]"); + Book response = libraryServiceClient.moveBook(name, otherShelfName); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_stringshelfname_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.java new file mode 100644 index 0000000000..252ec2e0b0 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_movebook_stringstring_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.BookName; +import com.google.example.library.v1.ShelfName; + +public class SyncMoveBookStringString { + + public static void main(String[] args) throws Exception { + syncMoveBookStringString(); + } + + public static void syncMoveBookStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + String name = BookName.of("[SHELF]", "[BOOK]").toString(); + String otherShelfName = ShelfName.of("[SHELF_ID]").toString(); + Book response = libraryServiceClient.moveBook(name, otherShelfName); + } + } +} +// [END library_v1_generated_libraryserviceclient_movebook_stringstring_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/AsyncUpdateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/AsyncUpdateBook.java new file mode 100644 index 0000000000..d11b4c1c5a --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/AsyncUpdateBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_updatebook_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBook { + + public static void main(String[] args) throws Exception { + asyncUpdateBook(); + } + + public static void asyncUpdateBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setBook(Book.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = libraryServiceClient.updateBookCallable().futureCall(request); + // Do something. + Book response = future.get(); + } + } +} +// [END library_v1_generated_libraryserviceclient_updatebook_async] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook.java new file mode 100644 index 0000000000..5ac4ffd2ce --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_updatebook_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.example.library.v1.UpdateBookRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBook { + + public static void main(String[] args) throws Exception { + syncUpdateBook(); + } + + public static void syncUpdateBook() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + UpdateBookRequest request = + UpdateBookRequest.newBuilder() + .setBook(Book.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Book response = libraryServiceClient.updateBook(request); + } + } +} +// [END library_v1_generated_libraryserviceclient_updatebook_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.java new file mode 100644 index 0000000000..e8c6231b35 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.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.example.library.v1.samples; + +// [START library_v1_generated_libraryserviceclient_updatebook_bookfieldmask_sync] +import com.google.cloud.example.library.v1.LibraryServiceClient; +import com.google.example.library.v1.Book; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBookBookFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBookBookFieldmask(); + } + + public static void syncUpdateBookBookFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LibraryServiceClient libraryServiceClient = LibraryServiceClient.create()) { + Book book = Book.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Book response = libraryServiceClient.updateBook(book, updateMask); + } + } +} +// [END library_v1_generated_libraryserviceclient_updatebook_bookfieldmask_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.java new file mode 100644 index 0000000000..09c41fca35 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryservicesettings/createshelf/SyncCreateShelf.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.example.library.v1.samples; + +// [START library_v1_generated_libraryservicesettings_createshelf_sync] +import com.google.cloud.example.library.v1.LibraryServiceSettings; +import java.time.Duration; + +public class SyncCreateShelf { + + public static void main(String[] args) throws Exception { + syncCreateShelf(); + } + + public static void syncCreateShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + LibraryServiceSettings.Builder libraryServiceSettingsBuilder = + LibraryServiceSettings.newBuilder(); + libraryServiceSettingsBuilder + .createShelfSettings() + .setRetrySettings( + libraryServiceSettingsBuilder + .createShelfSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LibraryServiceSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); + } +} +// [END library_v1_generated_libraryservicesettings_createshelf_sync] diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.java new file mode 100644 index 0000000000..7875366841 --- /dev/null +++ b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/stub/libraryservicestubsettings/createshelf/SyncCreateShelf.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.example.library.v1.stub.samples; + +// [START library_v1_generated_libraryservicestubsettings_createshelf_sync] +import com.google.cloud.example.library.v1.stub.LibraryServiceStubSettings; +import java.time.Duration; + +public class SyncCreateShelf { + + public static void main(String[] args) throws Exception { + syncCreateShelf(); + } + + public static void syncCreateShelf() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + LibraryServiceStubSettings.Builder libraryServiceSettingsBuilder = + LibraryServiceStubSettings.newBuilder(); + libraryServiceSettingsBuilder + .createShelfSettings() + .setRetrySettings( + libraryServiceSettingsBuilder + .createShelfSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LibraryServiceStubSettings libraryServiceSettings = libraryServiceSettingsBuilder.build(); + } +} +// [END library_v1_generated_libraryservicestubsettings_createshelf_sync] diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceClient.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceClient.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClient.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceClientTest.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceClientTest.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceClientTest.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/LibraryServiceSettings.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/LibraryServiceSettings.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/MockLibraryService.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/MockLibraryService.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryService.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/MockLibraryServiceImpl.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/gapic_metadata.json b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/gapic_metadata.json rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/gapic_metadata.json diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/package-info.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/package-info.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/package-info.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceCallableFactory.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/GrpcLibraryServiceStub.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStub.java diff --git a/test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java b/test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java similarity index 100% rename from test/integration/goldens/library/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java rename to test/integration/goldens/library/src/com/google/cloud/example/library/v1/stub/LibraryServiceStubSettings.java diff --git a/test/integration/goldens/library/com/google/example/library/v1/BookName.java b/test/integration/goldens/library/src/com/google/example/library/v1/BookName.java similarity index 100% rename from test/integration/goldens/library/com/google/example/library/v1/BookName.java rename to test/integration/goldens/library/src/com/google/example/library/v1/BookName.java diff --git a/test/integration/goldens/library/com/google/example/library/v1/ShelfName.java b/test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java similarity index 100% rename from test/integration/goldens/library/com/google/example/library/v1/ShelfName.java rename to test/integration/goldens/library/src/com/google/example/library/v1/ShelfName.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..d8d41c4144 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.cloud.logging.v2.ConfigSettings; +import com.google.cloud.logging.v2.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. + ConfigSettings configSettings = + ConfigSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + ConfigClient configClient = ConfigClient.create(configSettings); + } +} +// [END logging_v2_generated_configclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..f87353a43e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java @@ -0,0 +1,37 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_create_setendpoint_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.cloud.logging.v2.ConfigSettings; +import com.google.cloud.logging.v2.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. + ConfigSettings configSettings = ConfigSettings.newBuilder().setEndpoint(myEndpoint).build(); + ConfigClient configClient = ConfigClient.create(configSettings); + } +} +// [END logging_v2_generated_configclient_create_setendpoint_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/AsyncCreateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/AsyncCreateBucket.java new file mode 100644 index 0000000000..75190b4528 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/AsyncCreateBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createbucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncCreateBucket { + + public static void main(String[] args) throws Exception { + asyncCreateBucket(); + } + + public static void asyncCreateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + ApiFuture future = configClient.createBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_createbucket_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/SyncCreateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/SyncCreateBucket.java new file mode 100644 index 0000000000..20e0d5b3a8 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createbucket/SyncCreateBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createbucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateBucketRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncCreateBucket { + + public static void main(String[] args) throws Exception { + syncCreateBucket(); + } + + public static void syncCreateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setBucketId("bucketId-1603305307") + .setBucket(LogBucket.newBuilder().build()) + .build(); + LogBucket response = configClient.createBucket(request); + } + } +} +// [END logging_v2_generated_configclient_createbucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/AsyncCreateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/AsyncCreateExclusion.java new file mode 100644 index 0000000000..c3331613d8 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/AsyncCreateExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateExclusion { + + public static void main(String[] args) throws Exception { + asyncCreateExclusion(); + } + + public static void asyncCreateExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .build(); + ApiFuture future = configClient.createExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion.java new file mode 100644 index 0000000000..448c2e5950 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusion(); + } + + public static void syncCreateExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateExclusionRequest request = + CreateExclusionRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .build(); + LogExclusion response = configClient.createExclusion(request); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.java new file mode 100644 index 0000000000..92bd2d2f08 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_billingaccountnamelogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogExclusion; + +public class SyncCreateExclusionBillingaccountnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionBillingaccountnameLogexclusion(); + } + + public static void syncCreateExclusionBillingaccountnameLogexclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_billingaccountnamelogexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.java new file mode 100644 index 0000000000..0720cc4d27 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_foldernamelogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogExclusion; + +public class SyncCreateExclusionFoldernameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionFoldernameLogexclusion(); + } + + public static void syncCreateExclusionFoldernameLogexclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_foldernamelogexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.java new file mode 100644 index 0000000000..1e542fce44 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_organizationnamelogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.OrganizationName; + +public class SyncCreateExclusionOrganizationnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionOrganizationnameLogexclusion(); + } + + public static void syncCreateExclusionOrganizationnameLogexclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_organizationnamelogexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.java new file mode 100644 index 0000000000..b741f57dca --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_projectnamelogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusionProjectnameLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionProjectnameLogexclusion(); + } + + public static void syncCreateExclusionProjectnameLogexclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_projectnamelogexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.java new file mode 100644 index 0000000000..78831b5331 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createexclusion_stringlogexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncCreateExclusionStringLogexclusion { + + public static void main(String[] args) throws Exception { + syncCreateExclusionStringLogexclusion(); + } + + public static void syncCreateExclusionStringLogexclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + LogExclusion response = configClient.createExclusion(parent, exclusion); + } + } +} +// [END logging_v2_generated_configclient_createexclusion_stringlogexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/AsyncCreateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/AsyncCreateSink.java new file mode 100644 index 0000000000..5feca6ac85 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/AsyncCreateSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateSink { + + public static void main(String[] args) throws Exception { + asyncCreateSink(); + } + + public static void asyncCreateSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .build(); + ApiFuture future = configClient.createSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_createsink_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink.java new file mode 100644 index 0000000000..6492525c50 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSink { + + public static void main(String[] args) throws Exception { + syncCreateSink(); + } + + public static void syncCreateSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateSinkRequest request = + CreateSinkRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .build(); + LogSink response = configClient.createSink(request); + } + } +} +// [END logging_v2_generated_configclient_createsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.java new file mode 100644 index 0000000000..9ea538c578 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_billingaccountnamelogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogSink; + +public class SyncCreateSinkBillingaccountnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkBillingaccountnameLogsink(); + } + + public static void syncCreateSinkBillingaccountnameLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_configclient_createsink_billingaccountnamelogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.java new file mode 100644 index 0000000000..199f21f815 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_foldernamelogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogSink; + +public class SyncCreateSinkFoldernameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkFoldernameLogsink(); + } + + public static void syncCreateSinkFoldernameLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_configclient_createsink_foldernamelogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.java new file mode 100644 index 0000000000..556c7ec71d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_organizationnamelogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.OrganizationName; + +public class SyncCreateSinkOrganizationnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkOrganizationnameLogsink(); + } + + public static void syncCreateSinkOrganizationnameLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_configclient_createsink_organizationnamelogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.java new file mode 100644 index 0000000000..16c09911a4 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_projectnamelogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSinkProjectnameLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkProjectnameLogsink(); + } + + public static void syncCreateSinkProjectnameLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_configclient_createsink_projectnamelogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.java new file mode 100644 index 0000000000..b4ee60474d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createsink_stringlogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncCreateSinkStringLogsink { + + public static void main(String[] args) throws Exception { + syncCreateSinkStringLogsink(); + } + + public static void syncCreateSinkStringLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.createSink(parent, sink); + } + } +} +// [END logging_v2_generated_configclient_createsink_stringlogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/AsyncCreateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/AsyncCreateView.java new file mode 100644 index 0000000000..3965775a98 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/AsyncCreateView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createview_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.LogView; + +public class AsyncCreateView { + + public static void main(String[] args) throws Exception { + asyncCreateView(); + } + + public static void asyncCreateView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + ApiFuture future = configClient.createViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_createview_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/SyncCreateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/SyncCreateView.java new file mode 100644 index 0000000000..8f3b00f1fc --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createview/SyncCreateView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_createview_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CreateViewRequest; +import com.google.logging.v2.LogView; + +public class SyncCreateView { + + public static void main(String[] args) throws Exception { + syncCreateView(); + } + + public static void syncCreateView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + CreateViewRequest request = + CreateViewRequest.newBuilder() + .setParent("parent-995424086") + .setViewId("viewId-816632160") + .setView(LogView.newBuilder().build()) + .build(); + LogView response = configClient.createView(request); + } + } +} +// [END logging_v2_generated_configclient_createview_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/AsyncDeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/AsyncDeleteBucket.java new file mode 100644 index 0000000000..0798689fd3 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/AsyncDeleteBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletebucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.LogBucketName; +import com.google.protobuf.Empty; + +public class AsyncDeleteBucket { + + public static void main(String[] args) throws Exception { + asyncDeleteBucket(); + } + + public static void asyncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.deleteBucketCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_configclient_deletebucket_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/SyncDeleteBucket.java new file mode 100644 index 0000000000..d48a002db1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletebucket/SyncDeleteBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletebucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteBucketRequest; +import com.google.logging.v2.LogBucketName; +import com.google.protobuf.Empty; + +public class SyncDeleteBucket { + + public static void main(String[] args) throws Exception { + syncDeleteBucket(); + } + + public static void syncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + configClient.deleteBucket(request); + } + } +} +// [END logging_v2_generated_configclient_deletebucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/AsyncDeleteExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/AsyncDeleteExclusion.java new file mode 100644 index 0000000000..21a399e11e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/AsyncDeleteExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteexclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class AsyncDeleteExclusion { + + public static void main(String[] args) throws Exception { + asyncDeleteExclusion(); + } + + public static void asyncDeleteExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + ApiFuture future = configClient.deleteExclusionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_configclient_deleteexclusion_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion.java new file mode 100644 index 0000000000..4eea01ed80 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteExclusionRequest; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusion { + + public static void main(String[] args) throws Exception { + syncDeleteExclusion(); + } + + public static void syncDeleteExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteExclusionRequest request = + DeleteExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + configClient.deleteExclusion(request); + } + } +} +// [END logging_v2_generated_configclient_deleteexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.java new file mode 100644 index 0000000000..84df5f5e4d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteexclusion_logexclusionname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusionLogexclusionname { + + public static void main(String[] args) throws Exception { + syncDeleteExclusionLogexclusionname(); + } + + public static void syncDeleteExclusionLogexclusionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + configClient.deleteExclusion(name); + } + } +} +// [END logging_v2_generated_configclient_deleteexclusion_logexclusionname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.java new file mode 100644 index 0000000000..99a910b7e2 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteexclusion_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.Empty; + +public class SyncDeleteExclusionString { + + public static void main(String[] args) throws Exception { + syncDeleteExclusionString(); + } + + public static void syncDeleteExclusionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + configClient.deleteExclusion(name); + } + } +} +// [END logging_v2_generated_configclient_deleteexclusion_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/AsyncDeleteSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/AsyncDeleteSink.java new file mode 100644 index 0000000000..2defdb3fb5 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/AsyncDeleteSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletesink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class AsyncDeleteSink { + + public static void main(String[] args) throws Exception { + asyncDeleteSink(); + } + + public static void asyncDeleteSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + ApiFuture future = configClient.deleteSinkCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_configclient_deletesink_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink.java new file mode 100644 index 0000000000..ab83572efc --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletesink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteSinkRequest; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSink { + + public static void main(String[] args) throws Exception { + syncDeleteSink(); + } + + public static void syncDeleteSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteSinkRequest request = + DeleteSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + configClient.deleteSink(request); + } + } +} +// [END logging_v2_generated_configclient_deletesink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.java new file mode 100644 index 0000000000..26dd24f2d1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletesink_logsinkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSinkLogsinkname { + + public static void main(String[] args) throws Exception { + syncDeleteSinkLogsinkname(); + } + + public static void syncDeleteSinkLogsinkname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + configClient.deleteSink(sinkName); + } + } +} +// [END logging_v2_generated_configclient_deletesink_logsinkname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.java new file mode 100644 index 0000000000..a70a666121 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deletesink_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.Empty; + +public class SyncDeleteSinkString { + + public static void main(String[] args) throws Exception { + syncDeleteSinkString(); + } + + public static void syncDeleteSinkString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + configClient.deleteSink(sinkName); + } + } +} +// [END logging_v2_generated_configclient_deletesink_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/AsyncDeleteView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/AsyncDeleteView.java new file mode 100644 index 0000000000..0c9335978f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/AsyncDeleteView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteview_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.LogViewName; +import com.google.protobuf.Empty; + +public class AsyncDeleteView { + + public static void main(String[] args) throws Exception { + asyncDeleteView(); + } + + public static void asyncDeleteView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + ApiFuture future = configClient.deleteViewCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_configclient_deleteview_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/SyncDeleteView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/SyncDeleteView.java new file mode 100644 index 0000000000..5970758e08 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteview/SyncDeleteView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_deleteview_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.DeleteViewRequest; +import com.google.logging.v2.LogViewName; +import com.google.protobuf.Empty; + +public class SyncDeleteView { + + public static void main(String[] args) throws Exception { + syncDeleteView(); + } + + public static void syncDeleteView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + DeleteViewRequest request = + DeleteViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + configClient.deleteView(request); + } + } +} +// [END logging_v2_generated_configclient_deleteview_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/AsyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/AsyncGetBucket.java new file mode 100644 index 0000000000..a8e9b6b108 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/AsyncGetBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getbucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; + +public class AsyncGetBucket { + + public static void main(String[] args) throws Exception { + asyncGetBucket(); + } + + public static void asyncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.getBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_getbucket_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/SyncGetBucket.java new file mode 100644 index 0000000000..de19568a33 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getbucket/SyncGetBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getbucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetBucketRequest; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + LogBucket response = configClient.getBucket(request); + } + } +} +// [END logging_v2_generated_configclient_getbucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/AsyncGetCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/AsyncGetCmekSettings.java new file mode 100644 index 0000000000..35bd79e757 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/AsyncGetCmekSettings.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getcmeksettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.GetCmekSettingsRequest; + +public class AsyncGetCmekSettings { + + public static void main(String[] args) throws Exception { + asyncGetCmekSettings(); + } + + public static void asyncGetCmekSettings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + ApiFuture future = configClient.getCmekSettingsCallable().futureCall(request); + // Do something. + CmekSettings response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_getcmeksettings_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/SyncGetCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/SyncGetCmekSettings.java new file mode 100644 index 0000000000..489b7d7a55 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getcmeksettings/SyncGetCmekSettings.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getcmeksettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.CmekSettingsName; +import com.google.logging.v2.GetCmekSettingsRequest; + +public class SyncGetCmekSettings { + + public static void main(String[] args) throws Exception { + syncGetCmekSettings(); + } + + public static void syncGetCmekSettings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetCmekSettingsRequest request = + GetCmekSettingsRequest.newBuilder() + .setName(CmekSettingsName.ofProjectName("[PROJECT]").toString()) + .build(); + CmekSettings response = configClient.getCmekSettings(request); + } + } +} +// [END logging_v2_generated_configclient_getcmeksettings_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/AsyncGetExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/AsyncGetExclusion.java new file mode 100644 index 0000000000..966c48a490 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/AsyncGetExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getexclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class AsyncGetExclusion { + + public static void main(String[] args) throws Exception { + asyncGetExclusion(); + } + + public static void asyncGetExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + ApiFuture future = configClient.getExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_getexclusion_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion.java new file mode 100644 index 0000000000..993486736b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetExclusionRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusion { + + public static void main(String[] args) throws Exception { + syncGetExclusion(); + } + + public static void syncGetExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetExclusionRequest request = + GetExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .build(); + LogExclusion response = configClient.getExclusion(request); + } + } +} +// [END logging_v2_generated_configclient_getexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.java new file mode 100644 index 0000000000..d778c37bb1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getexclusion_logexclusionname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusionLogexclusionname { + + public static void main(String[] args) throws Exception { + syncGetExclusionLogexclusionname(); + } + + public static void syncGetExclusionLogexclusionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion response = configClient.getExclusion(name); + } + } +} +// [END logging_v2_generated_configclient_getexclusion_logexclusionname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.java new file mode 100644 index 0000000000..e6fdc9bcf0 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getexclusion_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; + +public class SyncGetExclusionString { + + public static void main(String[] args) throws Exception { + syncGetExclusionString(); + } + + public static void syncGetExclusionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + LogExclusion response = configClient.getExclusion(name); + } + } +} +// [END logging_v2_generated_configclient_getexclusion_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/AsyncGetSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/AsyncGetSink.java new file mode 100644 index 0000000000..b9028ef060 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/AsyncGetSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getsink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class AsyncGetSink { + + public static void main(String[] args) throws Exception { + asyncGetSink(); + } + + public static void asyncGetSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + ApiFuture future = configClient.getSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_getsink_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink.java new file mode 100644 index 0000000000..21f4749a16 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetSinkRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSink { + + public static void main(String[] args) throws Exception { + syncGetSink(); + } + + public static void syncGetSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetSinkRequest request = + GetSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .build(); + LogSink response = configClient.getSink(request); + } + } +} +// [END logging_v2_generated_configclient_getsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.java new file mode 100644 index 0000000000..3c63e0a3a8 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getsink_logsinkname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSinkLogsinkname { + + public static void main(String[] args) throws Exception { + syncGetSinkLogsinkname(); + } + + public static void syncGetSinkLogsinkname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink response = configClient.getSink(sinkName); + } + } +} +// [END logging_v2_generated_configclient_getsink_logsinkname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.java new file mode 100644 index 0000000000..e42fae0088 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getsink_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncGetSinkString { + + public static void main(String[] args) throws Exception { + syncGetSinkString(); + } + + public static void syncGetSinkString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink response = configClient.getSink(sinkName); + } + } +} +// [END logging_v2_generated_configclient_getsink_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/AsyncGetView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/AsyncGetView.java new file mode 100644 index 0000000000..4d696c0d10 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/AsyncGetView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getview_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.LogView; +import com.google.logging.v2.LogViewName; + +public class AsyncGetView { + + public static void main(String[] args) throws Exception { + asyncGetView(); + } + + public static void asyncGetView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + ApiFuture future = configClient.getViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_getview_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/SyncGetView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/SyncGetView.java new file mode 100644 index 0000000000..7c34344ca9 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getview/SyncGetView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_getview_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.GetViewRequest; +import com.google.logging.v2.LogView; +import com.google.logging.v2.LogViewName; + +public class SyncGetView { + + public static void main(String[] args) throws Exception { + syncGetView(); + } + + public static void syncGetView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + GetViewRequest request = + GetViewRequest.newBuilder() + .setName( + LogViewName.ofProjectLocationBucketViewName( + "[PROJECT]", "[LOCATION]", "[BUCKET]", "[VIEW]") + .toString()) + .build(); + LogView response = configClient.getView(request); + } + } +} +// [END logging_v2_generated_configclient_getview_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets.java new file mode 100644 index 0000000000..4161c97f46 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncListBuckets { + + public static void main(String[] args) throws Exception { + asyncListBuckets(); + } + + public static void asyncListBuckets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listBucketsPagedCallable().futureCall(request); + // Do something. + for (LogBucket element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java new file mode 100644 index 0000000000..1f6faace46 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.ListBucketsResponse; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class AsyncListBucketsPaged { + + public static void main(String[] args) throws Exception { + asyncListBucketsPaged(); + } + + public static void asyncListBucketsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListBucketsResponse response = configClient.listBucketsCallable().call(request); + for (LogBucket element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets.java new file mode 100644 index 0000000000..d9a54bec64 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListBucketsRequest; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBuckets { + + public static void main(String[] args) throws Exception { + syncListBuckets(); + } + + public static void syncListBuckets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogBucket element : configClient.listBuckets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java new file mode 100644 index 0000000000..67d1df8d1b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java @@ -0,0 +1,42 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_billingaccountlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountLocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsBillingaccountlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsBillingaccountlocationname(); + } + + public static void syncListBucketsBillingaccountlocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountLocationName parent = + BillingAccountLocationName.of("[BILLING_ACCOUNT]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_billingaccountlocationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.java new file mode 100644 index 0000000000..727e9b4fc5 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_folderlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderLocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsFolderlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsFolderlocationname(); + } + + public static void syncListBucketsFolderlocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_folderlocationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.java new file mode 100644 index 0000000000..5d77cafba3 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_locationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsLocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsLocationname(); + } + + public static void syncListBucketsLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_locationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.java new file mode 100644 index 0000000000..7cecb6a90a --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_organizationlocationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.OrganizationLocationName; + +public class SyncListBucketsOrganizationlocationname { + + public static void main(String[] args) throws Exception { + syncListBucketsOrganizationlocationname(); + } + + public static void syncListBucketsOrganizationlocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]"); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_organizationlocationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.java new file mode 100644 index 0000000000..d800efaa1d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listbuckets_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LocationName; +import com.google.logging.v2.LogBucket; + +public class SyncListBucketsString { + + public static void main(String[] args) throws Exception { + syncListBucketsString(); + } + + public static void syncListBucketsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (LogBucket element : configClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listbuckets_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions.java new file mode 100644 index 0000000000..602a5b0fe6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncListExclusions { + + public static void main(String[] args) throws Exception { + asyncListExclusions(); + } + + public static void asyncListExclusions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = + configClient.listExclusionsPagedCallable().futureCall(request); + // Do something. + for (LogExclusion element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java new file mode 100644 index 0000000000..cf1286a405 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.ListExclusionsResponse; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class AsyncListExclusionsPaged { + + public static void main(String[] args) throws Exception { + asyncListExclusionsPaged(); + } + + public static void asyncListExclusionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListExclusionsResponse response = configClient.listExclusionsCallable().call(request); + for (LogExclusion element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions.java new file mode 100644 index 0000000000..aea97da057 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListExclusionsRequest; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusions { + + public static void main(String[] args) throws Exception { + syncListExclusions(); + } + + public static void syncListExclusions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListExclusionsRequest request = + ListExclusionsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogExclusion element : configClient.listExclusions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.java new file mode 100644 index 0000000000..c771bdd426 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_billingaccountname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogExclusion; + +public class SyncListExclusionsBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListExclusionsBillingaccountname(); + } + + public static void syncListExclusionsBillingaccountname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_billingaccountname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.java new file mode 100644 index 0000000000..b87b93003f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_foldername_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogExclusion; + +public class SyncListExclusionsFoldername { + + public static void main(String[] args) throws Exception { + syncListExclusionsFoldername(); + } + + public static void syncListExclusionsFoldername() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_foldername_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.java new file mode 100644 index 0000000000..c95c8904c7 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_organizationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.OrganizationName; + +public class SyncListExclusionsOrganizationname { + + public static void main(String[] args) throws Exception { + syncListExclusionsOrganizationname(); + } + + public static void syncListExclusionsOrganizationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_organizationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.java new file mode 100644 index 0000000000..7d5773b4ab --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_projectname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusionsProjectname { + + public static void main(String[] args) throws Exception { + syncListExclusionsProjectname(); + } + + public static void syncListExclusionsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_projectname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.java new file mode 100644 index 0000000000..3894b5236e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listexclusions_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.ProjectName; + +public class SyncListExclusionsString { + + public static void main(String[] args) throws Exception { + syncListExclusionsString(); + } + + public static void syncListExclusionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogExclusion element : configClient.listExclusions(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listexclusions_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks.java new file mode 100644 index 0000000000..7baeb1a545 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncListSinks { + + public static void main(String[] args) throws Exception { + asyncListSinks(); + } + + public static void asyncListSinks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listSinksPagedCallable().futureCall(request); + // Do something. + for (LogSink element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java new file mode 100644 index 0000000000..47e3a3d2b1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.ListSinksResponse; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class AsyncListSinksPaged { + + public static void main(String[] args) throws Exception { + asyncListSinksPaged(); + } + + public static void asyncListSinksPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListSinksResponse response = configClient.listSinksCallable().call(request); + for (LogSink element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks.java new file mode 100644 index 0000000000..a57003dcb5 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListSinksRequest; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinks { + + public static void main(String[] args) throws Exception { + syncListSinks(); + } + + public static void syncListSinks() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListSinksRequest request = + ListSinksRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogSink element : configClient.listSinks(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.java new file mode 100644 index 0000000000..43c3f9bb79 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_billingaccountname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.BillingAccountName; +import com.google.logging.v2.LogSink; + +public class SyncListSinksBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListSinksBillingaccountname(); + } + + public static void syncListSinksBillingaccountname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_billingaccountname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.java new file mode 100644 index 0000000000..149a8bea5c --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_foldername_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.FolderName; +import com.google.logging.v2.LogSink; + +public class SyncListSinksFoldername { + + public static void main(String[] args) throws Exception { + syncListSinksFoldername(); + } + + public static void syncListSinksFoldername() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_foldername_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.java new file mode 100644 index 0000000000..d3ba5899b6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_organizationname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.OrganizationName; + +public class SyncListSinksOrganizationname { + + public static void main(String[] args) throws Exception { + syncListSinksOrganizationname(); + } + + public static void syncListSinksOrganizationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_organizationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.java new file mode 100644 index 0000000000..3fa5049203 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_projectname_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinksProjectname { + + public static void main(String[] args) throws Exception { + syncListSinksProjectname(); + } + + public static void syncListSinksProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_projectname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.java new file mode 100644 index 0000000000..8b39c2e9a0 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listsinks_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.ProjectName; + +public class SyncListSinksString { + + public static void main(String[] args) throws Exception { + syncListSinksString(); + } + + public static void syncListSinksString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogSink element : configClient.listSinks(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listsinks_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews.java new file mode 100644 index 0000000000..0c75f8787b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listviews_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.LogView; + +public class AsyncListViews { + + public static void main(String[] args) throws Exception { + asyncListViews(); + } + + public static void asyncListViews() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = configClient.listViewsPagedCallable().futureCall(request); + // Do something. + for (LogView element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listviews_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java new file mode 100644 index 0000000000..4025b9b986 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java @@ -0,0 +1,57 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listviews_paged_async] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.ListViewsResponse; +import com.google.logging.v2.LogView; + +public class AsyncListViewsPaged { + + public static void main(String[] args) throws Exception { + asyncListViewsPaged(); + } + + public static void asyncListViewsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListViewsResponse response = configClient.listViewsCallable().call(request); + for (LogView element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_configclient_listviews_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews.java new file mode 100644 index 0000000000..35bf3c3bff --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listviews_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.ListViewsRequest; +import com.google.logging.v2.LogView; + +public class SyncListViews { + + public static void main(String[] args) throws Exception { + syncListViews(); + } + + public static void syncListViews() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + ListViewsRequest request = + ListViewsRequest.newBuilder() + .setParent("parent-995424086") + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogView element : configClient.listViews(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listviews_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.java new file mode 100644 index 0000000000..9c3a70563e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_listviews_string_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; + +public class SyncListViewsString { + + public static void main(String[] args) throws Exception { + syncListViewsString(); + } + + public static void syncListViewsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String parent = "parent-995424086"; + for (LogView element : configClient.listViews(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_configclient_listviews_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/AsyncUndeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/AsyncUndeleteBucket.java new file mode 100644 index 0000000000..853b0fa092 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/AsyncUndeleteBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_undeletebucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.protobuf.Empty; + +public class AsyncUndeleteBucket { + + public static void main(String[] args) throws Exception { + asyncUndeleteBucket(); + } + + public static void asyncUndeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + ApiFuture future = configClient.undeleteBucketCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_configclient_undeletebucket_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/SyncUndeleteBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/SyncUndeleteBucket.java new file mode 100644 index 0000000000..24a7ba8c7f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/undeletebucket/SyncUndeleteBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_undeletebucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UndeleteBucketRequest; +import com.google.protobuf.Empty; + +public class SyncUndeleteBucket { + + public static void main(String[] args) throws Exception { + syncUndeleteBucket(); + } + + public static void syncUndeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UndeleteBucketRequest request = + UndeleteBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .build(); + configClient.undeleteBucket(request); + } + } +} +// [END logging_v2_generated_configclient_undeletebucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/AsyncUpdateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/AsyncUpdateBucket.java new file mode 100644 index 0000000000..4b43c8f803 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/AsyncUpdateBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatebucket_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateBucket { + + public static void main(String[] args) throws Exception { + asyncUpdateBucket(); + } + + public static void asyncUpdateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateBucketCallable().futureCall(request); + // Do something. + LogBucket response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_updatebucket_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/SyncUpdateBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/SyncUpdateBucket.java new file mode 100644 index 0000000000..4df66d4c3c --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatebucket/SyncUpdateBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatebucket_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogBucket; +import com.google.logging.v2.LogBucketName; +import com.google.logging.v2.UpdateBucketRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateBucket { + + public static void main(String[] args) throws Exception { + syncUpdateBucket(); + } + + public static void syncUpdateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setName( + LogBucketName.ofProjectLocationBucketName("[PROJECT]", "[LOCATION]", "[BUCKET]") + .toString()) + .setBucket(LogBucket.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogBucket response = configClient.updateBucket(request); + } + } +} +// [END logging_v2_generated_configclient_updatebucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/AsyncUpdateCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/AsyncUpdateCmekSettings.java new file mode 100644 index 0000000000..7a75f188f1 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/AsyncUpdateCmekSettings.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatecmeksettings_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateCmekSettings { + + public static void main(String[] args) throws Exception { + asyncUpdateCmekSettings(); + } + + public static void asyncUpdateCmekSettings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + configClient.updateCmekSettingsCallable().futureCall(request); + // Do something. + CmekSettings response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_updatecmeksettings_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/SyncUpdateCmekSettings.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/SyncUpdateCmekSettings.java new file mode 100644 index 0000000000..012d01fa93 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatecmeksettings/SyncUpdateCmekSettings.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatecmeksettings_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.CmekSettings; +import com.google.logging.v2.UpdateCmekSettingsRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateCmekSettings { + + public static void main(String[] args) throws Exception { + syncUpdateCmekSettings(); + } + + public static void syncUpdateCmekSettings() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateCmekSettingsRequest request = + UpdateCmekSettingsRequest.newBuilder() + .setName("name3373707") + .setCmekSettings(CmekSettings.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + CmekSettings response = configClient.updateCmekSettings(request); + } + } +} +// [END logging_v2_generated_configclient_updatecmeksettings_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/AsyncUpdateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/AsyncUpdateExclusion.java new file mode 100644 index 0000000000..30388f02d6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/AsyncUpdateExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateexclusion_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateExclusion { + + public static void main(String[] args) throws Exception { + asyncUpdateExclusion(); + } + + public static void asyncUpdateExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateExclusionCallable().futureCall(request); + // Do something. + LogExclusion response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_updateexclusion_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion.java new file mode 100644 index 0000000000..85e49f0146 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateexclusion_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.logging.v2.UpdateExclusionRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusion { + + public static void main(String[] args) throws Exception { + syncUpdateExclusion(); + } + + public static void syncUpdateExclusion() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateExclusionRequest request = + UpdateExclusionRequest.newBuilder() + .setName( + LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString()) + .setExclusion(LogExclusion.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogExclusion response = configClient.updateExclusion(request); + } + } +} +// [END logging_v2_generated_configclient_updateexclusion_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java new file mode 100644 index 0000000000..843d144b5d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java @@ -0,0 +1,42 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateexclusion_logexclusionnamelogexclusionfieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateExclusionLogexclusionnameLogexclusionFieldmask(); + } + + public static void syncUpdateExclusionLogexclusionnameLogexclusionFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogExclusionName name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]"); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask); + } + } +} +// [END logging_v2_generated_configclient_updateexclusion_logexclusionnamelogexclusionfieldmask_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java new file mode 100644 index 0000000000..e4339ec2e4 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java @@ -0,0 +1,42 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateexclusion_stringlogexclusionfieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogExclusion; +import com.google.logging.v2.LogExclusionName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateExclusionStringLogexclusionFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateExclusionStringLogexclusionFieldmask(); + } + + public static void syncUpdateExclusionStringLogexclusionFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String name = LogExclusionName.ofProjectExclusionName("[PROJECT]", "[EXCLUSION]").toString(); + LogExclusion exclusion = LogExclusion.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogExclusion response = configClient.updateExclusion(name, exclusion, updateMask); + } + } +} +// [END logging_v2_generated_configclient_updateexclusion_stringlogexclusionfieldmask_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/AsyncUpdateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/AsyncUpdateSink.java new file mode 100644 index 0000000000..7001e79931 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/AsyncUpdateSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateSink { + + public static void main(String[] args) throws Exception { + asyncUpdateSink(); + } + + public static void asyncUpdateSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateSinkCallable().futureCall(request); + // Do something. + LogSink response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_updatesink_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink.java new file mode 100644 index 0000000000..c672ae0ec6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.logging.v2.UpdateSinkRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSink { + + public static void main(String[] args) throws Exception { + syncUpdateSink(); + } + + public static void syncUpdateSink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateSinkRequest request = + UpdateSinkRequest.newBuilder() + .setSinkName(LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString()) + .setSink(LogSink.newBuilder().build()) + .setUniqueWriterIdentity(true) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogSink response = configClient.updateSink(request); + } + } +} +// [END logging_v2_generated_configclient_updatesink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.java new file mode 100644 index 0000000000..b137e0ca15 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_logsinknamelogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncUpdateSinkLogsinknameLogsink { + + public static void main(String[] args) throws Exception { + syncUpdateSinkLogsinknameLogsink(); + } + + public static void syncUpdateSinkLogsinknameLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink); + } + } +} +// [END logging_v2_generated_configclient_updatesink_logsinknamelogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java new file mode 100644 index 0000000000..85f50fd328 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java @@ -0,0 +1,42 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_logsinknamelogsinkfieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSinkLogsinknameLogsinkFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSinkLogsinknameLogsinkFieldmask(); + } + + public static void syncUpdateSinkLogsinknameLogsinkFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + LogSinkName sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]"); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink, updateMask); + } + } +} +// [END logging_v2_generated_configclient_updatesink_logsinknamelogsinkfieldmask_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.java new file mode 100644 index 0000000000..389c84a6ab --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_stringlogsink_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; + +public class SyncUpdateSinkStringLogsink { + + public static void main(String[] args) throws Exception { + syncUpdateSinkStringLogsink(); + } + + public static void syncUpdateSinkStringLogsink() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink sink = LogSink.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink); + } + } +} +// [END logging_v2_generated_configclient_updatesink_stringlogsink_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java new file mode 100644 index 0000000000..bb8d68fa3e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java @@ -0,0 +1,42 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updatesink_stringlogsinkfieldmask_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogSink; +import com.google.logging.v2.LogSinkName; +import com.google.protobuf.FieldMask; + +public class SyncUpdateSinkStringLogsinkFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateSinkStringLogsinkFieldmask(); + } + + public static void syncUpdateSinkStringLogsinkFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + String sinkName = LogSinkName.ofProjectSinkName("[PROJECT]", "[SINK]").toString(); + LogSink sink = LogSink.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + LogSink response = configClient.updateSink(sinkName, sink, updateMask); + } + } +} +// [END logging_v2_generated_configclient_updatesink_stringlogsinkfieldmask_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/AsyncUpdateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/AsyncUpdateView.java new file mode 100644 index 0000000000..d4f662038c --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/AsyncUpdateView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateview_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; +import com.google.logging.v2.UpdateViewRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateView { + + public static void main(String[] args) throws Exception { + asyncUpdateView(); + } + + public static void asyncUpdateView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = configClient.updateViewCallable().futureCall(request); + // Do something. + LogView response = future.get(); + } + } +} +// [END logging_v2_generated_configclient_updateview_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/SyncUpdateView.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/SyncUpdateView.java new file mode 100644 index 0000000000..4fe57e77d8 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateview/SyncUpdateView.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.logging.v2.samples; + +// [START logging_v2_generated_configclient_updateview_sync] +import com.google.cloud.logging.v2.ConfigClient; +import com.google.logging.v2.LogView; +import com.google.logging.v2.UpdateViewRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateView { + + public static void main(String[] args) throws Exception { + syncUpdateView(); + } + + public static void syncUpdateView() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (ConfigClient configClient = ConfigClient.create()) { + UpdateViewRequest request = + UpdateViewRequest.newBuilder() + .setName("name3373707") + .setView(LogView.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + LogView response = configClient.updateView(request); + } + } +} +// [END logging_v2_generated_configclient_updateview_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.java new file mode 100644 index 0000000000..9df354b9cb --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configsettings/getbucket/SyncGetBucket.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.logging.v2.samples; + +// [START logging_v2_generated_configsettings_getbucket_sync] +import com.google.cloud.logging.v2.ConfigSettings; +import java.time.Duration; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ConfigSettings.Builder configSettingsBuilder = ConfigSettings.newBuilder(); + configSettingsBuilder + .getBucketSettings() + .setRetrySettings( + configSettingsBuilder + .getBucketSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConfigSettings configSettings = configSettingsBuilder.build(); + } +} +// [END logging_v2_generated_configsettings_getbucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..c3d9e27a99 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.cloud.logging.v2.LoggingSettings; +import com.google.cloud.logging.v2.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. + LoggingSettings loggingSettings = + LoggingSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + LoggingClient loggingClient = LoggingClient.create(loggingSettings); + } +} +// [END logging_v2_generated_loggingclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..6793beeff0 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java @@ -0,0 +1,37 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_create_setendpoint_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.cloud.logging.v2.LoggingSettings; +import com.google.cloud.logging.v2.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. + LoggingSettings loggingSettings = LoggingSettings.newBuilder().setEndpoint(myEndpoint).build(); + LoggingClient loggingClient = LoggingClient.create(loggingSettings); + } +} +// [END logging_v2_generated_loggingclient_create_setendpoint_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/AsyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/AsyncDeleteLog.java new file mode 100644 index 0000000000..cea7571ac9 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/AsyncDeleteLog.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_deletelog_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class AsyncDeleteLog { + + public static void main(String[] args) throws Exception { + asyncDeleteLog(); + } + + public static void asyncDeleteLog() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .build(); + ApiFuture future = loggingClient.deleteLogCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_loggingclient_deletelog_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog.java new file mode 100644 index 0000000000..567bce04cf --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_deletelog_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.DeleteLogRequest; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + DeleteLogRequest request = + DeleteLogRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .build(); + loggingClient.deleteLog(request); + } + } +} +// [END logging_v2_generated_loggingclient_deletelog_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.java new file mode 100644 index 0000000000..333f8f3e8e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_deletelog_logname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogLogname { + + public static void main(String[] args) throws Exception { + syncDeleteLogLogname(); + } + + public static void syncDeleteLogLogname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + loggingClient.deleteLog(logName); + } + } +} +// [END logging_v2_generated_loggingclient_deletelog_logname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.java new file mode 100644 index 0000000000..593fb8b650 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_deletelog_string_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogString { + + public static void main(String[] args) throws Exception { + syncDeleteLogString(); + } + + public static void syncDeleteLogString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString(); + loggingClient.deleteLog(logName); + } + } +} +// [END logging_v2_generated_loggingclient_deletelog_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries.java new file mode 100644 index 0000000000..ed2fe13008 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogentries_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class AsyncListLogEntries { + + public static void main(String[] args) throws Exception { + asyncListLogEntries(); + } + + public static void asyncListLogEntries() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = loggingClient.listLogEntriesPagedCallable().futureCall(request); + // Do something. + for (LogEntry element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogentries_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.java new file mode 100644 index 0000000000..075fb38d62 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogentries_paged_async] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.ListLogEntriesResponse; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class AsyncListLogEntriesPaged { + + public static void main(String[] args) throws Exception { + asyncListLogEntriesPaged(); + } + + public static void asyncListLogEntriesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request); + for (LogEntry element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogentries_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries.java new file mode 100644 index 0000000000..88dda82a28 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogentries_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogEntriesRequest; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; + +public class SyncListLogEntries { + + public static void main(String[] args) throws Exception { + syncListLogEntries(); + } + + public static void syncListLogEntries() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogEntriesRequest request = + ListLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (LogEntry element : loggingClient.listLogEntries(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogentries_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.java new file mode 100644 index 0000000000..6d14bff372 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogentries_liststringstringstring_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import java.util.ArrayList; +import java.util.List; + +public class SyncListLogEntriesListstringStringString { + + public static void main(String[] args) throws Exception { + syncListLogEntriesListstringStringString(); + } + + public static void syncListLogEntriesListstringStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + List resourceNames = new ArrayList<>(); + String filter = "filter-1274492040"; + String orderBy = "orderBy-1207110587"; + for (LogEntry element : + loggingClient.listLogEntries(resourceNames, filter, orderBy).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogentries_liststringstringstring_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs.java new file mode 100644 index 0000000000..954a1ef109 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class AsyncListLogs { + + public static void main(String[] args) throws Exception { + asyncListLogs(); + } + + public static void asyncListLogs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllResourceNames(new ArrayList()) + .build(); + ApiFuture future = loggingClient.listLogsPagedCallable().futureCall(request); + // Do something. + for (String element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.java new file mode 100644 index 0000000000..4c9eb7c00a --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_paged_async] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ListLogsResponse; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class AsyncListLogsPaged { + + public static void main(String[] args) throws Exception { + asyncListLogsPaged(); + } + + public static void asyncListLogsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllResourceNames(new ArrayList()) + .build(); + while (true) { + ListLogsResponse response = loggingClient.listLogsCallable().call(request); + for (String element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs.java new file mode 100644 index 0000000000..d1b89b033d --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListLogsRequest; +import com.google.logging.v2.ProjectName; +import java.util.ArrayList; + +public class SyncListLogs { + + public static void main(String[] args) throws Exception { + syncListLogs(); + } + + public static void syncListLogs() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListLogsRequest request = + ListLogsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .addAllResourceNames(new ArrayList()) + .build(); + for (String element : loggingClient.listLogs(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.java new file mode 100644 index 0000000000..38edf85574 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_billingaccountname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.BillingAccountName; + +public class SyncListLogsBillingaccountname { + + public static void main(String[] args) throws Exception { + syncListLogsBillingaccountname(); + } + + public static void syncListLogsBillingaccountname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + BillingAccountName parent = BillingAccountName.of("[BILLING_ACCOUNT]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_billingaccountname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.java new file mode 100644 index 0000000000..3d00e4e445 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_foldername_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.FolderName; + +public class SyncListLogsFoldername { + + public static void main(String[] args) throws Exception { + syncListLogsFoldername(); + } + + public static void syncListLogsFoldername() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + FolderName parent = FolderName.of("[FOLDER]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_foldername_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.java new file mode 100644 index 0000000000..f7a8209b0f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_organizationname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.OrganizationName; + +public class SyncListLogsOrganizationname { + + public static void main(String[] args) throws Exception { + syncListLogsOrganizationname(); + } + + public static void syncListLogsOrganizationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + OrganizationName parent = OrganizationName.of("[ORGANIZATION]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_organizationname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.java new file mode 100644 index 0000000000..de21231a2a --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_projectname_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ProjectName; + +public class SyncListLogsProjectname { + + public static void main(String[] args) throws Exception { + syncListLogsProjectname(); + } + + public static void syncListLogsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_projectname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.java new file mode 100644 index 0000000000..404a102a4e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listlogs_string_sync] +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ProjectName; + +public class SyncListLogsString { + + public static void main(String[] args) throws Exception { + syncListLogsString(); + } + + public static void syncListLogsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (String element : loggingClient.listLogs(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listlogs_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.java new file mode 100644 index 0000000000..1589bb5b35 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_async] +import com.google.api.MonitoredResourceDescriptor; +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; + +public class AsyncListMonitoredResourceDescriptors { + + public static void main(String[] args) throws Exception { + asyncListMonitoredResourceDescriptors(); + } + + public static void asyncListMonitoredResourceDescriptors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + loggingClient.listMonitoredResourceDescriptorsPagedCallable().futureCall(request); + // Do something. + for (MonitoredResourceDescriptor element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java new file mode 100644 index 0000000000..810d07aadd --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java @@ -0,0 +1,57 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_paged_async] +import com.google.api.MonitoredResourceDescriptor; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; +import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse; + +public class AsyncListMonitoredResourceDescriptorsPaged { + + public static void main(String[] args) throws Exception { + asyncListMonitoredResourceDescriptorsPaged(); + } + + public static void asyncListMonitoredResourceDescriptorsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListMonitoredResourceDescriptorsResponse response = + loggingClient.listMonitoredResourceDescriptorsCallable().call(request); + for (MonitoredResourceDescriptor element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.java new file mode 100644 index 0000000000..3c4bee11c6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/SyncListMonitoredResourceDescriptors.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_sync] +import com.google.api.MonitoredResourceDescriptor; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest; + +public class SyncListMonitoredResourceDescriptors { + + public static void main(String[] args) throws Exception { + syncListMonitoredResourceDescriptors(); + } + + public static void syncListMonitoredResourceDescriptors() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + ListMonitoredResourceDescriptorsRequest request = + ListMonitoredResourceDescriptorsRequest.newBuilder() + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (MonitoredResourceDescriptor element : + loggingClient.listMonitoredResourceDescriptors(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_loggingclient_listmonitoredresourcedescriptors_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/taillogentries/AsyncTailLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/taillogentries/AsyncTailLogEntries.java new file mode 100644 index 0000000000..026fd8c853 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/taillogentries/AsyncTailLogEntries.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_taillogentries_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.TailLogEntriesRequest; +import com.google.logging.v2.TailLogEntriesResponse; +import com.google.protobuf.Duration; +import java.util.ArrayList; + +public class AsyncTailLogEntries { + + public static void main(String[] args) throws Exception { + asyncTailLogEntries(); + } + + public static void asyncTailLogEntries() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + BidiStream bidiStream = + loggingClient.tailLogEntriesCallable().call(); + TailLogEntriesRequest request = + TailLogEntriesRequest.newBuilder() + .addAllResourceNames(new ArrayList()) + .setFilter("filter-1274492040") + .setBufferWindow(Duration.newBuilder().build()) + .build(); + bidiStream.send(request); + for (TailLogEntriesResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END logging_v2_generated_loggingclient_taillogentries_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/AsyncWriteLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/AsyncWriteLogEntries.java new file mode 100644 index 0000000000..14ba6ca1a5 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/AsyncWriteLogEntries.java @@ -0,0 +1,56 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_writelogentries_async] +import com.google.api.MonitoredResource; +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; + +public class AsyncWriteLogEntries { + + public static void main(String[] args) throws Exception { + asyncWriteLogEntries(); + } + + public static void asyncWriteLogEntries() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .setResource(MonitoredResource.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllEntries(new ArrayList()) + .setPartialSuccess(true) + .setDryRun(true) + .build(); + ApiFuture future = + loggingClient.writeLogEntriesCallable().futureCall(request); + // Do something. + WriteLogEntriesResponse response = future.get(); + } + } +} +// [END logging_v2_generated_loggingclient_writelogentries_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries.java new file mode 100644 index 0000000000..72835920ad --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_writelogentries_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesRequest; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; + +public class SyncWriteLogEntries { + + public static void main(String[] args) throws Exception { + syncWriteLogEntries(); + } + + public static void syncWriteLogEntries() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + WriteLogEntriesRequest request = + WriteLogEntriesRequest.newBuilder() + .setLogName(LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString()) + .setResource(MonitoredResource.newBuilder().build()) + .putAllLabels(new HashMap()) + .addAllEntries(new ArrayList()) + .setPartialSuccess(true) + .setDryRun(true) + .build(); + WriteLogEntriesResponse response = loggingClient.writeLogEntries(request); + } + } +} +// [END logging_v2_generated_loggingclient_writelogentries_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java new file mode 100644 index 0000000000..c6da656a5e --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_writelogentries_lognamemonitoredresourcemapstringstringlistlogentry_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry { + + public static void main(String[] args) throws Exception { + syncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry(); + } + + public static void syncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + LogName logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]"); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + WriteLogEntriesResponse response = + loggingClient.writeLogEntries(logName, resource, labels, entries); + } + } +} +// [END logging_v2_generated_loggingclient_writelogentries_lognamemonitoredresourcemapstringstringlistlogentry_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java new file mode 100644 index 0000000000..83e9df4822 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.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.logging.v2.samples; + +// [START logging_v2_generated_loggingclient_writelogentries_stringmonitoredresourcemapstringstringlistlogentry_sync] +import com.google.api.MonitoredResource; +import com.google.cloud.logging.v2.LoggingClient; +import com.google.logging.v2.LogEntry; +import com.google.logging.v2.LogName; +import com.google.logging.v2.WriteLogEntriesResponse; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry { + + public static void main(String[] args) throws Exception { + syncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry(); + } + + public static void syncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (LoggingClient loggingClient = LoggingClient.create()) { + String logName = LogName.ofProjectLogName("[PROJECT]", "[LOG]").toString(); + MonitoredResource resource = MonitoredResource.newBuilder().build(); + Map labels = new HashMap<>(); + List entries = new ArrayList<>(); + WriteLogEntriesResponse response = + loggingClient.writeLogEntries(logName, resource, labels, entries); + } + } +} +// [END logging_v2_generated_loggingclient_writelogentries_stringmonitoredresourcemapstringstringlistlogentry_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.java new file mode 100644 index 0000000000..d46470a27b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingsettings/deletelog/SyncDeleteLog.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.logging.v2.samples; + +// [START logging_v2_generated_loggingsettings_deletelog_sync] +import com.google.cloud.logging.v2.LoggingSettings; +import java.time.Duration; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + LoggingSettings.Builder loggingSettingsBuilder = LoggingSettings.newBuilder(); + loggingSettingsBuilder + .deleteLogSettings() + .setRetrySettings( + loggingSettingsBuilder + .deleteLogSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LoggingSettings loggingSettings = loggingSettingsBuilder.build(); + } +} +// [END logging_v2_generated_loggingsettings_deletelog_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..4e16520c1f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.cloud.logging.v2.MetricsSettings; +import com.google.cloud.logging.v2.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. + MetricsSettings metricsSettings = + MetricsSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MetricsClient metricsClient = MetricsClient.create(metricsSettings); + } +} +// [END logging_v2_generated_metricsclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..1e023b0445 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java @@ -0,0 +1,37 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_create_setendpoint_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.cloud.logging.v2.MetricsSettings; +import com.google.cloud.logging.v2.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. + MetricsSettings metricsSettings = MetricsSettings.newBuilder().setEndpoint(myEndpoint).build(); + MetricsClient metricsClient = MetricsClient.create(metricsSettings); + } +} +// [END logging_v2_generated_metricsclient_create_setendpoint_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/AsyncCreateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/AsyncCreateLogMetric.java new file mode 100644 index 0000000000..24af4a48b6 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/AsyncCreateLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_createlogmetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncCreateLogMetric { + + public static void main(String[] args) throws Exception { + asyncCreateLogMetric(); + } + + public static void asyncCreateLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + ApiFuture future = metricsClient.createLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_metricsclient_createlogmetric_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric.java new file mode 100644 index 0000000000..8ea9c99360 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_createlogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.CreateLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetric(); + } + + public static void syncCreateLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + CreateLogMetricRequest request = + CreateLogMetricRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + LogMetric response = metricsClient.createLogMetric(request); + } + } +} +// [END logging_v2_generated_metricsclient_createlogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.java new file mode 100644 index 0000000000..843fcba89f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_createlogmetric_projectnamelogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetricProjectnameLogmetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetricProjectnameLogmetric(); + } + + public static void syncCreateLogMetricProjectnameLogmetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.createLogMetric(parent, metric); + } + } +} +// [END logging_v2_generated_metricsclient_createlogmetric_projectnamelogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.java new file mode 100644 index 0000000000..ac5b5a1574 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_createlogmetric_stringlogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncCreateLogMetricStringLogmetric { + + public static void main(String[] args) throws Exception { + syncCreateLogMetricStringLogmetric(); + } + + public static void syncCreateLogMetricStringLogmetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.createLogMetric(parent, metric); + } + } +} +// [END logging_v2_generated_metricsclient_createlogmetric_stringlogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/AsyncDeleteLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/AsyncDeleteLogMetric.java new file mode 100644 index 0000000000..eda0326167 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/AsyncDeleteLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_deletelogmetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class AsyncDeleteLogMetric { + + public static void main(String[] args) throws Exception { + asyncDeleteLogMetric(); + } + + public static void asyncDeleteLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + ApiFuture future = metricsClient.deleteLogMetricCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END logging_v2_generated_metricsclient_deletelogmetric_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric.java new file mode 100644 index 0000000000..6a77d2bbc3 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_deletelogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.DeleteLogMetricRequest; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetric { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetric(); + } + + public static void syncDeleteLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + DeleteLogMetricRequest request = + DeleteLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + metricsClient.deleteLogMetric(request); + } + } +} +// [END logging_v2_generated_metricsclient_deletelogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.java new file mode 100644 index 0000000000..427ceb5379 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_deletelogmetric_logmetricname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetricLogmetricname { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetricLogmetricname(); + } + + public static void syncDeleteLogMetricLogmetricname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + metricsClient.deleteLogMetric(metricName); + } + } +} +// [END logging_v2_generated_metricsclient_deletelogmetric_logmetricname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.java new file mode 100644 index 0000000000..3b76667609 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_deletelogmetric_string_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetricName; +import com.google.protobuf.Empty; + +public class SyncDeleteLogMetricString { + + public static void main(String[] args) throws Exception { + syncDeleteLogMetricString(); + } + + public static void syncDeleteLogMetricString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + metricsClient.deleteLogMetric(metricName); + } + } +} +// [END logging_v2_generated_metricsclient_deletelogmetric_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/AsyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/AsyncGetLogMetric.java new file mode 100644 index 0000000000..ecf3837fad --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/AsyncGetLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_getlogmetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class AsyncGetLogMetric { + + public static void main(String[] args) throws Exception { + asyncGetLogMetric(); + } + + public static void asyncGetLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + ApiFuture future = metricsClient.getLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_metricsclient_getlogmetric_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 0000000000..5003835e45 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_getlogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.GetLogMetricRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + GetLogMetricRequest request = + GetLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .build(); + LogMetric response = metricsClient.getLogMetric(request); + } + } +} +// [END logging_v2_generated_metricsclient_getlogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.java new file mode 100644 index 0000000000..8ae3a7ec04 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_getlogmetric_logmetricname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetricLogmetricname { + + public static void main(String[] args) throws Exception { + syncGetLogMetricLogmetricname(); + } + + public static void syncGetLogMetricLogmetricname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric response = metricsClient.getLogMetric(metricName); + } + } +} +// [END logging_v2_generated_metricsclient_getlogmetric_logmetricname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.java new file mode 100644 index 0000000000..8c1c1b74c4 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_getlogmetric_string_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncGetLogMetricString { + + public static void main(String[] args) throws Exception { + syncGetLogMetricString(); + } + + public static void syncGetLogMetricString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + LogMetric response = metricsClient.getLogMetric(metricName); + } + } +} +// [END logging_v2_generated_metricsclient_getlogmetric_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics.java new file mode 100644 index 0000000000..8b8d1146ad --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_listlogmetrics_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncListLogMetrics { + + public static void main(String[] args) throws Exception { + asyncListLogMetrics(); + } + + public static void asyncListLogMetrics() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + ApiFuture future = metricsClient.listLogMetricsPagedCallable().futureCall(request); + // Do something. + for (LogMetric element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_metricsclient_listlogmetrics_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java new file mode 100644 index 0000000000..4dc679fbfe --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_listlogmetrics_paged_async] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.common.base.Strings; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.ListLogMetricsResponse; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class AsyncListLogMetricsPaged { + + public static void main(String[] args) throws Exception { + asyncListLogMetricsPaged(); + } + + public static void asyncListLogMetricsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + while (true) { + ListLogMetricsResponse response = metricsClient.listLogMetricsCallable().call(request); + for (LogMetric element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END logging_v2_generated_metricsclient_listlogmetrics_paged_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics.java new file mode 100644 index 0000000000..14b9375517 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_listlogmetrics_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.ListLogMetricsRequest; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetrics { + + public static void main(String[] args) throws Exception { + syncListLogMetrics(); + } + + public static void syncListLogMetrics() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + ListLogMetricsRequest request = + ListLogMetricsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageToken("pageToken873572522") + .setPageSize(883849137) + .build(); + for (LogMetric element : metricsClient.listLogMetrics(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_metricsclient_listlogmetrics_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.java new file mode 100644 index 0000000000..af52d4c136 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_listlogmetrics_projectname_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetricsProjectname { + + public static void main(String[] args) throws Exception { + syncListLogMetricsProjectname(); + } + + public static void syncListLogMetricsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_metricsclient_listlogmetrics_projectname_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.java new file mode 100644 index 0000000000..181ba2b40f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_listlogmetrics_string_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.ProjectName; + +public class SyncListLogMetricsString { + + public static void main(String[] args) throws Exception { + syncListLogMetricsString(); + } + + public static void syncListLogMetricsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (LogMetric element : metricsClient.listLogMetrics(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END logging_v2_generated_metricsclient_listlogmetrics_string_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/AsyncUpdateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/AsyncUpdateLogMetric.java new file mode 100644 index 0000000000..2609602572 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/AsyncUpdateLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_updatelogmetric_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.UpdateLogMetricRequest; + +public class AsyncUpdateLogMetric { + + public static void main(String[] args) throws Exception { + asyncUpdateLogMetric(); + } + + public static void asyncUpdateLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + ApiFuture future = metricsClient.updateLogMetricCallable().futureCall(request); + // Do something. + LogMetric response = future.get(); + } + } +} +// [END logging_v2_generated_metricsclient_updatelogmetric_async] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric.java new file mode 100644 index 0000000000..d304d8f8c4 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_updatelogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; +import com.google.logging.v2.UpdateLogMetricRequest; + +public class SyncUpdateLogMetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetric(); + } + + public static void syncUpdateLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + UpdateLogMetricRequest request = + UpdateLogMetricRequest.newBuilder() + .setMetricName(LogMetricName.of("[PROJECT]", "[METRIC]").toString()) + .setMetric(LogMetric.newBuilder().build()) + .build(); + LogMetric response = metricsClient.updateLogMetric(request); + } + } +} +// [END logging_v2_generated_metricsclient_updatelogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.java new file mode 100644 index 0000000000..6df03d103a --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_updatelogmetric_logmetricnamelogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncUpdateLogMetricLogmetricnameLogmetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetricLogmetricnameLogmetric(); + } + + public static void syncUpdateLogMetricLogmetricnameLogmetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + LogMetricName metricName = LogMetricName.of("[PROJECT]", "[METRIC]"); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.updateLogMetric(metricName, metric); + } + } +} +// [END logging_v2_generated_metricsclient_updatelogmetric_logmetricnamelogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.java new file mode 100644 index 0000000000..bd4b6a378b --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricsclient_updatelogmetric_stringlogmetric_sync] +import com.google.cloud.logging.v2.MetricsClient; +import com.google.logging.v2.LogMetric; +import com.google.logging.v2.LogMetricName; + +public class SyncUpdateLogMetricStringLogmetric { + + public static void main(String[] args) throws Exception { + syncUpdateLogMetricStringLogmetric(); + } + + public static void syncUpdateLogMetricStringLogmetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (MetricsClient metricsClient = MetricsClient.create()) { + String metricName = LogMetricName.of("[PROJECT]", "[METRIC]").toString(); + LogMetric metric = LogMetric.newBuilder().build(); + LogMetric response = metricsClient.updateLogMetric(metricName, metric); + } + } +} +// [END logging_v2_generated_metricsclient_updatelogmetric_stringlogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 0000000000..ca54ad920f --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricssettings/getlogmetric/SyncGetLogMetric.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.logging.v2.samples; + +// [START logging_v2_generated_metricssettings_getlogmetric_sync] +import com.google.cloud.logging.v2.MetricsSettings; +import java.time.Duration; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetricsSettings.Builder metricsSettingsBuilder = MetricsSettings.newBuilder(); + metricsSettingsBuilder + .getLogMetricSettings() + .setRetrySettings( + metricsSettingsBuilder + .getLogMetricSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MetricsSettings metricsSettings = metricsSettingsBuilder.build(); + } +} +// [END logging_v2_generated_metricssettings_getlogmetric_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.java new file mode 100644 index 0000000000..21a82d85d5 --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/configservicev2stubsettings/getbucket/SyncGetBucket.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.logging.v2.stub.samples; + +// [START logging_v2_generated_configservicev2stubsettings_getbucket_sync] +import com.google.cloud.logging.v2.stub.ConfigServiceV2StubSettings; +import java.time.Duration; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + ConfigServiceV2StubSettings.Builder configSettingsBuilder = + ConfigServiceV2StubSettings.newBuilder(); + configSettingsBuilder + .getBucketSettings() + .setRetrySettings( + configSettingsBuilder + .getBucketSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + ConfigServiceV2StubSettings configSettings = configSettingsBuilder.build(); + } +} +// [END logging_v2_generated_configservicev2stubsettings_getbucket_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.java new file mode 100644 index 0000000000..43a154123c --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/loggingservicev2stubsettings/deletelog/SyncDeleteLog.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.logging.v2.stub.samples; + +// [START logging_v2_generated_loggingservicev2stubsettings_deletelog_sync] +import com.google.cloud.logging.v2.stub.LoggingServiceV2StubSettings; +import java.time.Duration; + +public class SyncDeleteLog { + + public static void main(String[] args) throws Exception { + syncDeleteLog(); + } + + public static void syncDeleteLog() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + LoggingServiceV2StubSettings.Builder loggingSettingsBuilder = + LoggingServiceV2StubSettings.newBuilder(); + loggingSettingsBuilder + .deleteLogSettings() + .setRetrySettings( + loggingSettingsBuilder + .deleteLogSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + LoggingServiceV2StubSettings loggingSettings = loggingSettingsBuilder.build(); + } +} +// [END logging_v2_generated_loggingservicev2stubsettings_deletelog_sync] diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.java new file mode 100644 index 0000000000..89b702323a --- /dev/null +++ b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/stub/metricsservicev2stubsettings/getlogmetric/SyncGetLogMetric.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.logging.v2.stub.samples; + +// [START logging_v2_generated_metricsservicev2stubsettings_getlogmetric_sync] +import com.google.cloud.logging.v2.stub.MetricsServiceV2StubSettings; +import java.time.Duration; + +public class SyncGetLogMetric { + + public static void main(String[] args) throws Exception { + syncGetLogMetric(); + } + + public static void syncGetLogMetric() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + MetricsServiceV2StubSettings.Builder metricsSettingsBuilder = + MetricsServiceV2StubSettings.newBuilder(); + metricsSettingsBuilder + .getLogMetricSettings() + .setRetrySettings( + metricsSettingsBuilder + .getLogMetricSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + MetricsServiceV2StubSettings metricsSettings = metricsSettingsBuilder.build(); + } +} +// [END logging_v2_generated_metricsservicev2stubsettings_getlogmetric_sync] diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigClient.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClient.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigClientTest.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigClientTest.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/ConfigSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/ConfigSettings.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingClient.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClient.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingClientTest.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingClientTest.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/LoggingSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/LoggingSettings.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsClient.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsClient.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClient.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsClientTest.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsClientTest.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsClientTest.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MetricsSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MetricsSettings.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockConfigServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockConfigServiceV2.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockConfigServiceV2Impl.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockLoggingServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockLoggingServiceV2.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockLoggingServiceV2Impl.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockMetricsServiceV2.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockMetricsServiceV2.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/MockMetricsServiceV2Impl.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/gapic_metadata.json b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/gapic_metadata.json rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/gapic_metadata.json diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/package-info.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/package-info.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/package-info.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/ConfigServiceV2StubSettings.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2CallableFactory.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcConfigServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2CallableFactory.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcLoggingServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2CallableFactory.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/GrpcMetricsServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/LoggingServiceV2StubSettings.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2Stub.java diff --git a/test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java b/test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java similarity index 100% rename from test/integration/goldens/logging/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java rename to test/integration/goldens/logging/src/com/google/cloud/logging/v2/stub/MetricsServiceV2StubSettings.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/BillingAccountLocationName.java b/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/BillingAccountLocationName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountLocationName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/BillingAccountName.java b/test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/BillingAccountName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/BillingAccountName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/CmekSettingsName.java b/test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/CmekSettingsName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/CmekSettingsName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/FolderLocationName.java b/test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/FolderLocationName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/FolderLocationName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/FolderName.java b/test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/FolderName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/FolderName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LocationName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LocationName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LocationName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogBucketName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogBucketName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogBucketName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogExclusionName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogExclusionName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogExclusionName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogMetricName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogMetricName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogMetricName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogSinkName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogSinkName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogSinkName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/LogViewName.java b/test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/LogViewName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/LogViewName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/OrganizationLocationName.java b/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/OrganizationLocationName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/OrganizationLocationName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/OrganizationName.java b/test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/OrganizationName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/OrganizationName.java diff --git a/test/integration/goldens/logging/com/google/logging/v2/ProjectName.java b/test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java similarity index 100% rename from test/integration/goldens/logging/com/google/logging/v2/ProjectName.java rename to test/integration/goldens/logging/src/com/google/logging/v2/ProjectName.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..7c919b545e --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.cloud.pubsub.v1.SchemaServiceSettings; +import com.google.cloud.pubsub.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. + SchemaServiceSettings schemaServiceSettings = + SchemaServiceSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); + } +} +// [END pubsub_v1_generated_schemaserviceclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..f0db3dd1aa --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_create_setendpoint_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.cloud.pubsub.v1.SchemaServiceSettings; +import com.google.cloud.pubsub.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. + SchemaServiceSettings schemaServiceSettings = + SchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings); + } +} +// [END pubsub_v1_generated_schemaserviceclient_create_setendpoint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/AsyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/AsyncCreateSchema.java new file mode 100644 index 0000000000..16cf7cf855 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/AsyncCreateSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_createschema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.CreateSchemaRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class AsyncCreateSchema { + + public static void main(String[] args) throws Exception { + asyncCreateSchema(); + } + + public static void asyncCreateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSchema(Schema.newBuilder().build()) + .setSchemaId("schemaId-697673060") + .build(); + ApiFuture future = schemaServiceClient.createSchemaCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_createschema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema.java new file mode 100644 index 0000000000..802eff6c83 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_createschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.CreateSchemaRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class SyncCreateSchema { + + public static void main(String[] args) throws Exception { + syncCreateSchema(); + } + + public static void syncCreateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + CreateSchemaRequest request = + CreateSchemaRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSchema(Schema.newBuilder().build()) + .setSchemaId("schemaId-697673060") + .build(); + Schema response = schemaServiceClient.createSchema(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_createschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.java new file mode 100644 index 0000000000..0ae2df9279 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_createschema_projectnameschemastring_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class SyncCreateSchemaProjectnameSchemaString { + + public static void main(String[] args) throws Exception { + syncCreateSchemaProjectnameSchemaString(); + } + + public static void syncCreateSchemaProjectnameSchemaString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + Schema response = schemaServiceClient.createSchema(parent, schema, schemaId); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_createschema_projectnameschemastring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.java new file mode 100644 index 0000000000..79633abb96 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_createschema_stringschemastring_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class SyncCreateSchemaStringSchemaString { + + public static void main(String[] args) throws Exception { + syncCreateSchemaStringSchemaString(); + } + + public static void syncCreateSchemaStringSchemaString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Schema schema = Schema.newBuilder().build(); + String schemaId = "schemaId-697673060"; + Schema response = schemaServiceClient.createSchema(parent, schema, schemaId); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_createschema_stringschemastring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/AsyncDeleteSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/AsyncDeleteSchema.java new file mode 100644 index 0000000000..e34f41d285 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/AsyncDeleteSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_deleteschema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.SchemaName; + +public class AsyncDeleteSchema { + + public static void main(String[] args) throws Exception { + asyncDeleteSchema(); + } + + public static void asyncDeleteSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .build(); + ApiFuture future = schemaServiceClient.deleteSchemaCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_deleteschema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema.java new file mode 100644 index 0000000000..13661a81f0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_deleteschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSchemaRequest; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchema { + + public static void main(String[] args) throws Exception { + syncDeleteSchema(); + } + + public static void syncDeleteSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + DeleteSchemaRequest request = + DeleteSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .build(); + schemaServiceClient.deleteSchema(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_deleteschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.java new file mode 100644 index 0000000000..8ce7c44700 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_deleteschema_schemaname_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchemaSchemaname { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaSchemaname(); + } + + public static void syncDeleteSchemaSchemaname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + schemaServiceClient.deleteSchema(name); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_deleteschema_schemaname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.java new file mode 100644 index 0000000000..21f09fe2c6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_deleteschema_string_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SchemaName; + +public class SyncDeleteSchemaString { + + public static void main(String[] args) throws Exception { + syncDeleteSchemaString(); + } + + public static void syncDeleteSchemaString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + schemaServiceClient.deleteSchema(name); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_deleteschema_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..9da237388c --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/AsyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = schemaServiceClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..f7c1333a26 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getiampolicy/SyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getiampolicy_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = schemaServiceClient.getIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/AsyncGetSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/AsyncGetSchema.java new file mode 100644 index 0000000000..ee315fcfc8 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/AsyncGetSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getschema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; +import com.google.pubsub.v1.SchemaView; + +public class AsyncGetSchema { + + public static void main(String[] args) throws Exception { + asyncGetSchema(); + } + + public static void asyncGetSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setView(SchemaView.forNumber(0)) + .build(); + ApiFuture future = schemaServiceClient.getSchemaCallable().futureCall(request); + // Do something. + Schema response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getschema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema.java new file mode 100644 index 0000000000..a32701f8ec --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.GetSchemaRequest; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; +import com.google.pubsub.v1.SchemaView; + +public class SyncGetSchema { + + public static void main(String[] args) throws Exception { + syncGetSchema(); + } + + public static void syncGetSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + GetSchemaRequest request = + GetSchemaRequest.newBuilder() + .setName(SchemaName.of("[PROJECT]", "[SCHEMA]").toString()) + .setView(SchemaView.forNumber(0)) + .build(); + Schema response = schemaServiceClient.getSchema(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.java new file mode 100644 index 0000000000..0abb6d7522 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getschema_schemaname_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncGetSchemaSchemaname { + + public static void main(String[] args) throws Exception { + syncGetSchemaSchemaname(); + } + + public static void syncGetSchemaSchemaname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SchemaName name = SchemaName.of("[PROJECT]", "[SCHEMA]"); + Schema response = schemaServiceClient.getSchema(name); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getschema_schemaname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.java new file mode 100644 index 0000000000..cfdbe99a35 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_getschema_string_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaName; + +public class SyncGetSchemaString { + + public static void main(String[] args) throws Exception { + syncGetSchemaString(); + } + + public static void syncGetSchemaString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String name = SchemaName.of("[PROJECT]", "[SCHEMA]").toString(); + Schema response = schemaServiceClient.getSchema(name); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_getschema_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas.java new file mode 100644 index 0000000000..5448288d28 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_listschemas_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ListSchemasRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaView; + +public class AsyncListSchemas { + + public static void main(String[] args) throws Exception { + asyncListSchemas(); + } + + public static void asyncListSchemas() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = schemaServiceClient.listSchemasPagedCallable().futureCall(request); + // Do something. + for (Schema element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_listschemas_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.java new file mode 100644 index 0000000000..fb41f2362a --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_listschemas_paged_async] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListSchemasRequest; +import com.google.pubsub.v1.ListSchemasResponse; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaView; + +public class AsyncListSchemasPaged { + + public static void main(String[] args) throws Exception { + asyncListSchemasPaged(); + } + + public static void asyncListSchemasPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request); + for (Schema element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_listschemas_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas.java new file mode 100644 index 0000000000..398dfb1a01 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_listschemas_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ListSchemasRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.SchemaView; + +public class SyncListSchemas { + + public static void main(String[] args) throws Exception { + syncListSchemas(); + } + + public static void syncListSchemas() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ListSchemasRequest request = + ListSchemasRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setView(SchemaView.forNumber(0)) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Schema element : schemaServiceClient.listSchemas(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_listschemas_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.java new file mode 100644 index 0000000000..77a9e914c5 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_listschemas_projectname_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class SyncListSchemasProjectname { + + public static void main(String[] args) throws Exception { + syncListSchemasProjectname(); + } + + public static void syncListSchemasProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_listschemas_projectname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.java new file mode 100644 index 0000000000..7302d2e501 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_listschemas_string_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; + +public class SyncListSchemasString { + + public static void main(String[] args) throws Exception { + syncListSchemasString(); + } + + public static void syncListSchemasString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_listschemas_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..21a968ee0e --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/AsyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + ApiFuture future = schemaServiceClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_setiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..0a729de1c7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/setiampolicy/SyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_setiampolicy_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + Policy response = schemaServiceClient.setIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_setiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..460a418bd9 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/AsyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + schemaServiceClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_testiampermissions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..8243336958 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/testiampermissions/SyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_testiampermissions_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = schemaServiceClient.testIamPermissions(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_testiampermissions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/AsyncValidateMessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/AsyncValidateMessage.java new file mode 100644 index 0000000000..13eb8f2e4f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/AsyncValidateMessage.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validatemessage_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.ByteString; +import com.google.pubsub.v1.Encoding; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.ValidateMessageRequest; +import com.google.pubsub.v1.ValidateMessageResponse; + +public class AsyncValidateMessage { + + public static void main(String[] args) throws Exception { + asyncValidateMessage(); + } + + public static void asyncValidateMessage() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ValidateMessageRequest request = + ValidateMessageRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMessage(ByteString.EMPTY) + .setEncoding(Encoding.forNumber(0)) + .build(); + ApiFuture future = + schemaServiceClient.validateMessageCallable().futureCall(request); + // Do something. + ValidateMessageResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validatemessage_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/SyncValidateMessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/SyncValidateMessage.java new file mode 100644 index 0000000000..e44537eed2 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validatemessage/SyncValidateMessage.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validatemessage_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.protobuf.ByteString; +import com.google.pubsub.v1.Encoding; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.ValidateMessageRequest; +import com.google.pubsub.v1.ValidateMessageResponse; + +public class SyncValidateMessage { + + public static void main(String[] args) throws Exception { + syncValidateMessage(); + } + + public static void syncValidateMessage() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ValidateMessageRequest request = + ValidateMessageRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setMessage(ByteString.EMPTY) + .setEncoding(Encoding.forNumber(0)) + .build(); + ValidateMessageResponse response = schemaServiceClient.validateMessage(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validatemessage_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/AsyncValidateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/AsyncValidateSchema.java new file mode 100644 index 0000000000..d6a800372c --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/AsyncValidateSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validateschema_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.ValidateSchemaRequest; +import com.google.pubsub.v1.ValidateSchemaResponse; + +public class AsyncValidateSchema { + + public static void main(String[] args) throws Exception { + asyncValidateSchema(); + } + + public static void asyncValidateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ValidateSchemaRequest request = + ValidateSchemaRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSchema(Schema.newBuilder().build()) + .build(); + ApiFuture future = + schemaServiceClient.validateSchemaCallable().futureCall(request); + // Do something. + ValidateSchemaResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validateschema_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema.java new file mode 100644 index 0000000000..d13ba3db03 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validateschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.ValidateSchemaRequest; +import com.google.pubsub.v1.ValidateSchemaResponse; + +public class SyncValidateSchema { + + public static void main(String[] args) throws Exception { + syncValidateSchema(); + } + + public static void syncValidateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ValidateSchemaRequest request = + ValidateSchemaRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setSchema(Schema.newBuilder().build()) + .build(); + ValidateSchemaResponse response = schemaServiceClient.validateSchema(request); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validateschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.java new file mode 100644 index 0000000000..a47e89db85 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validateschema_projectnameschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.ValidateSchemaResponse; + +public class SyncValidateSchemaProjectnameSchema { + + public static void main(String[] args) throws Exception { + syncValidateSchemaProjectnameSchema(); + } + + public static void syncValidateSchemaProjectnameSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Schema schema = Schema.newBuilder().build(); + ValidateSchemaResponse response = schemaServiceClient.validateSchema(parent, schema); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validateschema_projectnameschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.java new file mode 100644 index 0000000000..7a16eaaf28 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaserviceclient_validateschema_stringschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Schema; +import com.google.pubsub.v1.ValidateSchemaResponse; + +public class SyncValidateSchemaStringSchema { + + public static void main(String[] args) throws Exception { + syncValidateSchemaStringSchema(); + } + + public static void syncValidateSchemaStringSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Schema schema = Schema.newBuilder().build(); + ValidateSchemaResponse response = schemaServiceClient.validateSchema(parent, schema); + } + } +} +// [END pubsub_v1_generated_schemaserviceclient_validateschema_stringschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.java new file mode 100644 index 0000000000..f1c984ec7e --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaservicesettings/createschema/SyncCreateSchema.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_schemaservicesettings_createschema_sync] +import com.google.cloud.pubsub.v1.SchemaServiceSettings; +import java.time.Duration; + +public class SyncCreateSchema { + + public static void main(String[] args) throws Exception { + syncCreateSchema(); + } + + public static void syncCreateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SchemaServiceSettings.Builder schemaServiceSettingsBuilder = SchemaServiceSettings.newBuilder(); + schemaServiceSettingsBuilder + .createSchemaSettings() + .setRetrySettings( + schemaServiceSettingsBuilder + .createSchemaSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SchemaServiceSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_schemaservicesettings_createschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.java new file mode 100644 index 0000000000..afc5c2463b --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/publisherstubsettings/createtopic/SyncCreateTopic.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.pubsub.v1.stub.samples; + +// [START pubsub_v1_generated_publisherstubsettings_createtopic_sync] +import com.google.cloud.pubsub.v1.stub.PublisherStubSettings; +import java.time.Duration; + +public class SyncCreateTopic { + + public static void main(String[] args) throws Exception { + syncCreateTopic(); + } + + public static void syncCreateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + PublisherStubSettings.Builder topicAdminSettingsBuilder = PublisherStubSettings.newBuilder(); + topicAdminSettingsBuilder + .createTopicSettings() + .setRetrySettings( + topicAdminSettingsBuilder + .createTopicSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + PublisherStubSettings topicAdminSettings = topicAdminSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_publisherstubsettings_createtopic_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.java new file mode 100644 index 0000000000..8d52c1b51c --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/schemaservicestubsettings/createschema/SyncCreateSchema.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.pubsub.v1.stub.samples; + +// [START pubsub_v1_generated_schemaservicestubsettings_createschema_sync] +import com.google.cloud.pubsub.v1.stub.SchemaServiceStubSettings; +import java.time.Duration; + +public class SyncCreateSchema { + + public static void main(String[] args) throws Exception { + syncCreateSchema(); + } + + public static void syncCreateSchema() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SchemaServiceStubSettings.Builder schemaServiceSettingsBuilder = + SchemaServiceStubSettings.newBuilder(); + schemaServiceSettingsBuilder + .createSchemaSettings() + .setRetrySettings( + schemaServiceSettingsBuilder + .createSchemaSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SchemaServiceStubSettings schemaServiceSettings = schemaServiceSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_schemaservicestubsettings_createschema_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.java new file mode 100644 index 0000000000..05cce37df7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/stub/subscriberstubsettings/createsubscription/SyncCreateSubscription.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.pubsub.v1.stub.samples; + +// [START pubsub_v1_generated_subscriberstubsettings_createsubscription_sync] +import com.google.cloud.pubsub.v1.stub.SubscriberStubSettings; +import java.time.Duration; + +public class SyncCreateSubscription { + + public static void main(String[] args) throws Exception { + syncCreateSubscription(); + } + + public static void syncCreateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SubscriberStubSettings.Builder subscriptionAdminSettingsBuilder = + SubscriberStubSettings.newBuilder(); + subscriptionAdminSettingsBuilder + .createSubscriptionSettings() + .setRetrySettings( + subscriptionAdminSettingsBuilder + .createSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SubscriberStubSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_subscriberstubsettings_createsubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/AsyncAcknowledge.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/AsyncAcknowledge.java new file mode 100644 index 0000000000..09170a1b85 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/AsyncAcknowledge.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_acknowledge_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.AcknowledgeRequest; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; + +public class AsyncAcknowledge { + + public static void main(String[] args) throws Exception { + asyncAcknowledge(); + } + + public static void asyncAcknowledge() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + AcknowledgeRequest request = + AcknowledgeRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .addAllAckIds(new ArrayList()) + .build(); + ApiFuture future = subscriptionAdminClient.acknowledgeCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_acknowledge_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge.java new file mode 100644 index 0000000000..c879c2529a --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_acknowledge_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.AcknowledgeRequest; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; + +public class SyncAcknowledge { + + public static void main(String[] args) throws Exception { + syncAcknowledge(); + } + + public static void syncAcknowledge() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + AcknowledgeRequest request = + AcknowledgeRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .addAllAckIds(new ArrayList()) + .build(); + subscriptionAdminClient.acknowledge(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_acknowledge_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java new file mode 100644 index 0000000000..f3622bcf3a --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java @@ -0,0 +1,42 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_acknowledge_stringliststring_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; +import java.util.List; + +public class SyncAcknowledgeStringListstring { + + public static void main(String[] args) throws Exception { + syncAcknowledgeStringListstring(); + } + + public static void syncAcknowledgeStringListstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + List ackIds = new ArrayList<>(); + subscriptionAdminClient.acknowledge(subscription, ackIds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_acknowledge_stringliststring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java new file mode 100644 index 0000000000..cc7386facb --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java @@ -0,0 +1,42 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_acknowledge_subscriptionnameliststring_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; +import java.util.List; + +public class SyncAcknowledgeSubscriptionnameListstring { + + public static void main(String[] args) throws Exception { + syncAcknowledgeSubscriptionnameListstring(); + } + + public static void syncAcknowledgeSubscriptionnameListstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + List ackIds = new ArrayList<>(); + subscriptionAdminClient.acknowledge(subscription, ackIds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_acknowledge_subscriptionnameliststring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..a3f2e2cc29 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java @@ -0,0 +1,42 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.cloud.pubsub.v1.SubscriptionAdminSettings; +import com.google.cloud.pubsub.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. + SubscriptionAdminSettings subscriptionAdminSettings = + SubscriptionAdminSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + SubscriptionAdminClient subscriptionAdminClient = + SubscriptionAdminClient.create(subscriptionAdminSettings); + } +} +// [END pubsub_v1_generated_subscriptionadminclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..61447bf2e6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_create_setendpoint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.cloud.pubsub.v1.SubscriptionAdminSettings; +import com.google.cloud.pubsub.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. + SubscriptionAdminSettings subscriptionAdminSettings = + SubscriptionAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); + SubscriptionAdminClient subscriptionAdminClient = + SubscriptionAdminClient.create(subscriptionAdminSettings); + } +} +// [END pubsub_v1_generated_subscriptionadminclient_create_setendpoint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/AsyncCreateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/AsyncCreateSnapshot.java new file mode 100644 index 0000000000..574c708681 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/AsyncCreateSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.CreateSnapshotRequest; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; +import java.util.HashMap; + +public class AsyncCreateSnapshot { + + public static void main(String[] args) throws Exception { + asyncCreateSnapshot(); + } + + public static void asyncCreateSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .putAllLabels(new HashMap()) + .build(); + ApiFuture future = + subscriptionAdminClient.createSnapshotCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot.java new file mode 100644 index 0000000000..7ea954384f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.CreateSnapshotRequest; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; +import java.util.HashMap; + +public class SyncCreateSnapshot { + + public static void main(String[] args) throws Exception { + syncCreateSnapshot(); + } + + public static void syncCreateSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + CreateSnapshotRequest request = + CreateSnapshotRequest.newBuilder() + .setName(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .putAllLabels(new HashMap()) + .build(); + Snapshot response = subscriptionAdminClient.createSnapshot(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.java new file mode 100644 index 0000000000..a9253018ec --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_snapshotnamestring_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncCreateSnapshotSnapshotnameString { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotSnapshotnameString(); + } + + public static void syncCreateSnapshotSnapshotnameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_snapshotnamestring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.java new file mode 100644 index 0000000000..3c891f5536 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_snapshotnamesubscriptionname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncCreateSnapshotSnapshotnameSubscriptionname { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotSnapshotnameSubscriptionname(); + } + + public static void syncCreateSnapshotSnapshotnameSubscriptionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SnapshotName name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_snapshotnamesubscriptionname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.java new file mode 100644 index 0000000000..88f93ef673 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_stringstring_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncCreateSnapshotStringString { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotStringString(); + } + + public static void syncCreateSnapshotStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString(); + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_stringstring_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.java new file mode 100644 index 0000000000..1e1e3d96a0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsnapshot_stringsubscriptionname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncCreateSnapshotStringSubscriptionname { + + public static void main(String[] args) throws Exception { + syncCreateSnapshotStringSubscriptionname(); + } + + public static void syncCreateSnapshotStringSubscriptionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String name = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString(); + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + Snapshot response = subscriptionAdminClient.createSnapshot(name, subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsnapshot_stringsubscriptionname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/AsyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/AsyncCreateSubscription.java new file mode 100644 index 0000000000..d2bf1ca3b8 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/AsyncCreateSubscription.java @@ -0,0 +1,67 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Duration; +import com.google.pubsub.v1.DeadLetterPolicy; +import com.google.pubsub.v1.ExpirationPolicy; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.RetryPolicy; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; +import java.util.HashMap; + +public class AsyncCreateSubscription { + + public static void main(String[] args) throws Exception { + asyncCreateSubscription(); + } + + public static void asyncCreateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + Subscription request = + Subscription.newBuilder() + .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPushConfig(PushConfig.newBuilder().build()) + .setAckDeadlineSeconds(2135351438) + .setRetainAckedMessages(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) + .putAllLabels(new HashMap()) + .setEnableMessageOrdering(true) + .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) + .setFilter("filter-1274492040") + .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) + .setRetryPolicy(RetryPolicy.newBuilder().build()) + .setDetached(true) + .setEnableExactlyOnceDelivery(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = + subscriptionAdminClient.createSubscriptionCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription.java new file mode 100644 index 0000000000..579f5a2a28 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription.java @@ -0,0 +1,63 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Duration; +import com.google.pubsub.v1.DeadLetterPolicy; +import com.google.pubsub.v1.ExpirationPolicy; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.RetryPolicy; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; +import java.util.HashMap; + +public class SyncCreateSubscription { + + public static void main(String[] args) throws Exception { + syncCreateSubscription(); + } + + public static void syncCreateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + Subscription request = + Subscription.newBuilder() + .setName(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPushConfig(PushConfig.newBuilder().build()) + .setAckDeadlineSeconds(2135351438) + .setRetainAckedMessages(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) + .putAllLabels(new HashMap()) + .setEnableMessageOrdering(true) + .setExpirationPolicy(ExpirationPolicy.newBuilder().build()) + .setFilter("filter-1274492040") + .setDeadLetterPolicy(DeadLetterPolicy.newBuilder().build()) + .setRetryPolicy(RetryPolicy.newBuilder().build()) + .setDetached(true) + .setEnableExactlyOnceDelivery(true) + .setTopicMessageRetentionDuration(Duration.newBuilder().build()) + .build(); + Subscription response = subscriptionAdminClient.createSubscription(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.java new file mode 100644 index 0000000000..879745c4c3 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_stringstringpushconfigint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateSubscriptionStringStringPushconfigInt { + + public static void main(String[] args) throws Exception { + syncCreateSubscriptionStringStringPushconfigInt(); + } + + public static void syncCreateSubscriptionStringStringPushconfigInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + PushConfig pushConfig = PushConfig.newBuilder().build(); + int ackDeadlineSeconds = 2135351438; + Subscription response = + subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_stringstringpushconfigint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.java new file mode 100644 index 0000000000..49e74740b5 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_stringtopicnamepushconfigint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateSubscriptionStringTopicnamePushconfigInt { + + public static void main(String[] args) throws Exception { + syncCreateSubscriptionStringTopicnamePushconfigInt(); + } + + public static void syncCreateSubscriptionStringTopicnamePushconfigInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + PushConfig pushConfig = PushConfig.newBuilder().build(); + int ackDeadlineSeconds = 2135351438; + Subscription response = + subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_stringtopicnamepushconfigint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java new file mode 100644 index 0000000000..31450dc20c --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_subscriptionnamestringpushconfigint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateSubscriptionSubscriptionnameStringPushconfigInt { + + public static void main(String[] args) throws Exception { + syncCreateSubscriptionSubscriptionnameStringPushconfigInt(); + } + + public static void syncCreateSubscriptionSubscriptionnameStringPushconfigInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + PushConfig pushConfig = PushConfig.newBuilder().build(); + int ackDeadlineSeconds = 2135351438; + Subscription response = + subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_subscriptionnamestringpushconfigint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java new file mode 100644 index 0000000000..1f7d589e86 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_createsubscription_subscriptionnametopicnamepushconfigint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt { + + public static void main(String[] args) throws Exception { + syncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt(); + } + + public static void syncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName name = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + PushConfig pushConfig = PushConfig.newBuilder().build(); + int ackDeadlineSeconds = 2135351438; + Subscription response = + subscriptionAdminClient.createSubscription(name, topic, pushConfig, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_createsubscription_subscriptionnametopicnamepushconfigint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/AsyncDeleteSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/AsyncDeleteSnapshot.java new file mode 100644 index 0000000000..137a6f86c4 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/AsyncDeleteSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSnapshotRequest; +import com.google.pubsub.v1.SnapshotName; + +public class AsyncDeleteSnapshot { + + public static void main(String[] args) throws Exception { + asyncDeleteSnapshot(); + } + + public static void asyncDeleteSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .build(); + ApiFuture future = + subscriptionAdminClient.deleteSnapshotCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesnapshot_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot.java new file mode 100644 index 0000000000..0072e7c285 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesnapshot_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSnapshotRequest; +import com.google.pubsub.v1.SnapshotName; + +public class SyncDeleteSnapshot { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshot(); + } + + public static void syncDeleteSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + DeleteSnapshotRequest request = + DeleteSnapshotRequest.newBuilder() + .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .build(); + subscriptionAdminClient.deleteSnapshot(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesnapshot_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.java new file mode 100644 index 0000000000..5d451bd560 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesnapshot_snapshotname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SnapshotName; + +public class SyncDeleteSnapshotSnapshotname { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshotSnapshotname(); + } + + public static void syncDeleteSnapshotSnapshotname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + subscriptionAdminClient.deleteSnapshot(snapshot); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesnapshot_snapshotname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.java new file mode 100644 index 0000000000..4c66c5c028 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesnapshot_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SnapshotName; + +public class SyncDeleteSnapshotString { + + public static void main(String[] args) throws Exception { + syncDeleteSnapshotString(); + } + + public static void syncDeleteSnapshotString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString(); + subscriptionAdminClient.deleteSnapshot(snapshot); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesnapshot_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/AsyncDeleteSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/AsyncDeleteSubscription.java new file mode 100644 index 0000000000..1b4305a1b0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/AsyncDeleteSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesubscription_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncDeleteSubscription { + + public static void main(String[] args) throws Exception { + asyncDeleteSubscription(); + } + + public static void asyncDeleteSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = + subscriptionAdminClient.deleteSubscriptionCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesubscription_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription.java new file mode 100644 index 0000000000..6f789cdac3 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesubscription_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteSubscriptionRequest; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncDeleteSubscription { + + public static void main(String[] args) throws Exception { + syncDeleteSubscription(); + } + + public static void syncDeleteSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + DeleteSubscriptionRequest request = + DeleteSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + subscriptionAdminClient.deleteSubscription(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.java new file mode 100644 index 0000000000..305640ac04 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesubscription_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncDeleteSubscriptionString { + + public static void main(String[] args) throws Exception { + syncDeleteSubscriptionString(); + } + + public static void syncDeleteSubscriptionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + subscriptionAdminClient.deleteSubscription(subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesubscription_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.java new file mode 100644 index 0000000000..c36c3858f8 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_deletesubscription_subscriptionname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncDeleteSubscriptionSubscriptionname { + + public static void main(String[] args) throws Exception { + syncDeleteSubscriptionSubscriptionname(); + } + + public static void syncDeleteSubscriptionSubscriptionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + subscriptionAdminClient.deleteSubscription(subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_deletesubscription_subscriptionname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..08b3a437a3 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/AsyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = subscriptionAdminClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..6a0c4322fb --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getiampolicy/SyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getiampolicy_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = subscriptionAdminClient.getIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/AsyncGetSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/AsyncGetSnapshot.java new file mode 100644 index 0000000000..42f848b480 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/AsyncGetSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.GetSnapshotRequest; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; + +public class AsyncGetSnapshot { + + public static void main(String[] args) throws Exception { + asyncGetSnapshot(); + } + + public static void asyncGetSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .build(); + ApiFuture future = + subscriptionAdminClient.getSnapshotCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsnapshot_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot.java new file mode 100644 index 0000000000..2eb2191762 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsnapshot_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.GetSnapshotRequest; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; + +public class SyncGetSnapshot { + + public static void main(String[] args) throws Exception { + syncGetSnapshot(); + } + + public static void syncGetSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetSnapshotRequest request = + GetSnapshotRequest.newBuilder() + .setSnapshot(SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString()) + .build(); + Snapshot response = subscriptionAdminClient.getSnapshot(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsnapshot_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.java new file mode 100644 index 0000000000..3a9a6dba17 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsnapshot_snapshotname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; + +public class SyncGetSnapshotSnapshotname { + + public static void main(String[] args) throws Exception { + syncGetSnapshotSnapshotname(); + } + + public static void syncGetSnapshotSnapshotname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SnapshotName snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]"); + Snapshot response = subscriptionAdminClient.getSnapshot(snapshot); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsnapshot_snapshotname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.java new file mode 100644 index 0000000000..988ad0c82c --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsnapshot_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.SnapshotName; + +public class SyncGetSnapshotString { + + public static void main(String[] args) throws Exception { + syncGetSnapshotString(); + } + + public static void syncGetSnapshotString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String snapshot = SnapshotName.of("[PROJECT]", "[SNAPSHOT]").toString(); + Snapshot response = subscriptionAdminClient.getSnapshot(snapshot); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsnapshot_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/AsyncGetSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/AsyncGetSubscription.java new file mode 100644 index 0000000000..900ac3a2dd --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/AsyncGetSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsubscription_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.GetSubscriptionRequest; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncGetSubscription { + + public static void main(String[] args) throws Exception { + asyncGetSubscription(); + } + + public static void asyncGetSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = + subscriptionAdminClient.getSubscriptionCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsubscription_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription.java new file mode 100644 index 0000000000..59452611c3 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsubscription_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.GetSubscriptionRequest; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncGetSubscription { + + public static void main(String[] args) throws Exception { + syncGetSubscription(); + } + + public static void syncGetSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + GetSubscriptionRequest request = + GetSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + Subscription response = subscriptionAdminClient.getSubscription(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.java new file mode 100644 index 0000000000..2327ec9800 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsubscription_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncGetSubscriptionString { + + public static void main(String[] args) throws Exception { + syncGetSubscriptionString(); + } + + public static void syncGetSubscriptionString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + Subscription response = subscriptionAdminClient.getSubscription(subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsubscription_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.java new file mode 100644 index 0000000000..392517e314 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_getsubscription_subscriptionname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncGetSubscriptionSubscriptionname { + + public static void main(String[] args) throws Exception { + syncGetSubscriptionSubscriptionname(); + } + + public static void syncGetSubscriptionSubscriptionname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + Subscription response = subscriptionAdminClient.getSubscription(subscription); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_getsubscription_subscriptionname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots.java new file mode 100644 index 0000000000..86fb881d6b --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsnapshots_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ListSnapshotsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Snapshot; + +public class AsyncListSnapshots { + + public static void main(String[] args) throws Exception { + asyncListSnapshots(); + } + + public static void asyncListSnapshots() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + subscriptionAdminClient.listSnapshotsPagedCallable().futureCall(request); + // Do something. + for (Snapshot element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsnapshots_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.java new file mode 100644 index 0000000000..7654455bf1 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsnapshots_paged_async] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListSnapshotsRequest; +import com.google.pubsub.v1.ListSnapshotsResponse; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Snapshot; + +public class AsyncListSnapshotsPaged { + + public static void main(String[] args) throws Exception { + asyncListSnapshotsPaged(); + } + + public static void asyncListSnapshotsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSnapshotsResponse response = + subscriptionAdminClient.listSnapshotsCallable().call(request); + for (Snapshot element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsnapshots_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots.java new file mode 100644 index 0000000000..900e4e26f5 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsnapshots_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ListSnapshotsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Snapshot; + +public class SyncListSnapshots { + + public static void main(String[] args) throws Exception { + syncListSnapshots(); + } + + public static void syncListSnapshots() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSnapshotsRequest request = + ListSnapshotsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Snapshot element : subscriptionAdminClient.listSnapshots(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsnapshots_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.java new file mode 100644 index 0000000000..684ee19403 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsnapshots_projectname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Snapshot; + +public class SyncListSnapshotsProjectname { + + public static void main(String[] args) throws Exception { + syncListSnapshotsProjectname(); + } + + public static void syncListSnapshotsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + for (Snapshot element : subscriptionAdminClient.listSnapshots(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsnapshots_projectname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.java new file mode 100644 index 0000000000..a712abde37 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsnapshots_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Snapshot; + +public class SyncListSnapshotsString { + + public static void main(String[] args) throws Exception { + syncListSnapshotsString(); + } + + public static void syncListSnapshotsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + for (Snapshot element : subscriptionAdminClient.listSnapshots(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsnapshots_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions.java new file mode 100644 index 0000000000..b700294ad5 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsubscriptions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ListSubscriptionsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Subscription; + +public class AsyncListSubscriptions { + + public static void main(String[] args) throws Exception { + asyncListSubscriptions(); + } + + public static void asyncListSubscriptions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + subscriptionAdminClient.listSubscriptionsPagedCallable().futureCall(request); + // Do something. + for (Subscription element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsubscriptions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.java new file mode 100644 index 0000000000..beb20080bc --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsubscriptions_paged_async] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListSubscriptionsRequest; +import com.google.pubsub.v1.ListSubscriptionsResponse; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Subscription; + +public class AsyncListSubscriptionsPaged { + + public static void main(String[] args) throws Exception { + asyncListSubscriptionsPaged(); + } + + public static void asyncListSubscriptionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListSubscriptionsResponse response = + subscriptionAdminClient.listSubscriptionsCallable().call(request); + for (Subscription element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsubscriptions_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions.java new file mode 100644 index 0000000000..149ba21dd2 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsubscriptions_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ListSubscriptionsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Subscription; + +public class SyncListSubscriptions { + + public static void main(String[] args) throws Exception { + syncListSubscriptions(); + } + + public static void syncListSubscriptions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ListSubscriptionsRequest request = + ListSubscriptionsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Subscription element : subscriptionAdminClient.listSubscriptions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsubscriptions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.java new file mode 100644 index 0000000000..24b2286321 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsubscriptions_projectname_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Subscription; + +public class SyncListSubscriptionsProjectname { + + public static void main(String[] args) throws Exception { + syncListSubscriptionsProjectname(); + } + + public static void syncListSubscriptionsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + for (Subscription element : subscriptionAdminClient.listSubscriptions(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsubscriptions_projectname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.java new file mode 100644 index 0000000000..c96628b09d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_listsubscriptions_string_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Subscription; + +public class SyncListSubscriptionsString { + + public static void main(String[] args) throws Exception { + syncListSubscriptionsString(); + } + + public static void syncListSubscriptionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + for (Subscription element : subscriptionAdminClient.listSubscriptions(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_listsubscriptions_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/AsyncModifyAckDeadline.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/AsyncModifyAckDeadline.java new file mode 100644 index 0000000000..d74c7cd102 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/AsyncModifyAckDeadline.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.ModifyAckDeadlineRequest; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; + +public class AsyncModifyAckDeadline { + + public static void main(String[] args) throws Exception { + asyncModifyAckDeadline(); + } + + public static void asyncModifyAckDeadline() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ModifyAckDeadlineRequest request = + ModifyAckDeadlineRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .addAllAckIds(new ArrayList()) + .setAckDeadlineSeconds(2135351438) + .build(); + ApiFuture future = + subscriptionAdminClient.modifyAckDeadlineCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline.java new file mode 100644 index 0000000000..27fddd9c91 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.ModifyAckDeadlineRequest; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; + +public class SyncModifyAckDeadline { + + public static void main(String[] args) throws Exception { + syncModifyAckDeadline(); + } + + public static void syncModifyAckDeadline() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ModifyAckDeadlineRequest request = + ModifyAckDeadlineRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .addAllAckIds(new ArrayList()) + .setAckDeadlineSeconds(2135351438) + .build(); + subscriptionAdminClient.modifyAckDeadline(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.java new file mode 100644 index 0000000000..e457109102 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_stringliststringint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; +import java.util.List; + +public class SyncModifyAckDeadlineStringListstringInt { + + public static void main(String[] args) throws Exception { + syncModifyAckDeadlineStringListstringInt(); + } + + public static void syncModifyAckDeadlineStringListstringInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + List ackIds = new ArrayList<>(); + int ackDeadlineSeconds = 2135351438; + subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_stringliststringint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.java new file mode 100644 index 0000000000..a81a40bdc7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_subscriptionnameliststringint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; +import java.util.List; + +public class SyncModifyAckDeadlineSubscriptionnameListstringInt { + + public static void main(String[] args) throws Exception { + syncModifyAckDeadlineSubscriptionnameListstringInt(); + } + + public static void syncModifyAckDeadlineSubscriptionnameListstringInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + List ackIds = new ArrayList<>(); + int ackDeadlineSeconds = 2135351438; + subscriptionAdminClient.modifyAckDeadline(subscription, ackIds, ackDeadlineSeconds); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifyackdeadline_subscriptionnameliststringint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/AsyncModifyPushConfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/AsyncModifyPushConfig.java new file mode 100644 index 0000000000..f7e5ac5c4d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/AsyncModifyPushConfig.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifypushconfig_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.ModifyPushConfigRequest; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncModifyPushConfig { + + public static void main(String[] args) throws Exception { + asyncModifyPushConfig(); + } + + public static void asyncModifyPushConfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ModifyPushConfigRequest request = + ModifyPushConfigRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setPushConfig(PushConfig.newBuilder().build()) + .build(); + ApiFuture future = + subscriptionAdminClient.modifyPushConfigCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifypushconfig_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig.java new file mode 100644 index 0000000000..1fb6e03255 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifypushconfig_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.ModifyPushConfigRequest; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncModifyPushConfig { + + public static void main(String[] args) throws Exception { + syncModifyPushConfig(); + } + + public static void syncModifyPushConfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + ModifyPushConfigRequest request = + ModifyPushConfigRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setPushConfig(PushConfig.newBuilder().build()) + .build(); + subscriptionAdminClient.modifyPushConfig(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifypushconfig_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.java new file mode 100644 index 0000000000..a9935cc0e8 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifypushconfig_stringpushconfig_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncModifyPushConfigStringPushconfig { + + public static void main(String[] args) throws Exception { + syncModifyPushConfigStringPushconfig(); + } + + public static void syncModifyPushConfigStringPushconfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + PushConfig pushConfig = PushConfig.newBuilder().build(); + subscriptionAdminClient.modifyPushConfig(subscription, pushConfig); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifypushconfig_stringpushconfig_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.java new file mode 100644 index 0000000000..c2bcdbdccc --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_modifypushconfig_subscriptionnamepushconfig_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.PushConfig; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncModifyPushConfigSubscriptionnamePushconfig { + + public static void main(String[] args) throws Exception { + syncModifyPushConfigSubscriptionnamePushconfig(); + } + + public static void syncModifyPushConfigSubscriptionnamePushconfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + PushConfig pushConfig = PushConfig.newBuilder().build(); + subscriptionAdminClient.modifyPushConfig(subscription, pushConfig); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_modifypushconfig_subscriptionnamepushconfig_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/AsyncPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/AsyncPull.java new file mode 100644 index 0000000000..5dbf1ed63d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/AsyncPull.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullRequest; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncPull { + + public static void main(String[] args) throws Exception { + asyncPull(); + } + + public static void asyncPull() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setReturnImmediately(true) + .setMaxMessages(496131527) + .build(); + ApiFuture future = subscriptionAdminClient.pullCallable().futureCall(request); + // Do something. + PullResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull.java new file mode 100644 index 0000000000..6940910d5f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullRequest; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncPull { + + public static void main(String[] args) throws Exception { + syncPull(); + } + + public static void syncPull() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + PullRequest request = + PullRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .setReturnImmediately(true) + .setMaxMessages(496131527) + .build(); + PullResponse response = subscriptionAdminClient.pull(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java new file mode 100644 index 0000000000..eafea3f003 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java @@ -0,0 +1,42 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_stringbooleanint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncPullStringBooleanInt { + + public static void main(String[] args) throws Exception { + syncPullStringBooleanInt(); + } + + public static void syncPullStringBooleanInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + boolean returnImmediately = true; + int maxMessages = 496131527; + PullResponse response = + subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_stringbooleanint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.java new file mode 100644 index 0000000000..6d931399e6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_stringint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncPullStringInt { + + public static void main(String[] args) throws Exception { + syncPullStringInt(); + } + + public static void syncPullStringInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + String subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString(); + int maxMessages = 496131527; + PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_stringint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java new file mode 100644 index 0000000000..577d4cbc1f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java @@ -0,0 +1,42 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_subscriptionnamebooleanint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncPullSubscriptionnameBooleanInt { + + public static void main(String[] args) throws Exception { + syncPullSubscriptionnameBooleanInt(); + } + + public static void syncPullSubscriptionnameBooleanInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + boolean returnImmediately = true; + int maxMessages = 496131527; + PullResponse response = + subscriptionAdminClient.pull(subscription, returnImmediately, maxMessages); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_subscriptionnamebooleanint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.java new file mode 100644 index 0000000000..b0529d5b82 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_pull_subscriptionnameint_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.PullResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncPullSubscriptionnameInt { + + public static void main(String[] args) throws Exception { + syncPullSubscriptionnameInt(); + } + + public static void syncPullSubscriptionnameInt() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SubscriptionName subscription = SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]"); + int maxMessages = 496131527; + PullResponse response = subscriptionAdminClient.pull(subscription, maxMessages); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_pull_subscriptionnameint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/AsyncSeek.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/AsyncSeek.java new file mode 100644 index 0000000000..07cc3cf56d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/AsyncSeek.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_seek_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.SeekRequest; +import com.google.pubsub.v1.SeekResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncSeek { + + public static void main(String[] args) throws Exception { + asyncSeek(); + } + + public static void asyncSeek() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SeekRequest request = + SeekRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = subscriptionAdminClient.seekCallable().futureCall(request); + // Do something. + SeekResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_seek_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/SyncSeek.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/SyncSeek.java new file mode 100644 index 0000000000..92f05b98b2 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/seek/SyncSeek.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_seek_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.SeekRequest; +import com.google.pubsub.v1.SeekResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncSeek { + + public static void main(String[] args) throws Exception { + syncSeek(); + } + + public static void syncSeek() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SeekRequest request = + SeekRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + SeekResponse response = subscriptionAdminClient.seek(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_seek_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..2391c2254d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/AsyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + ApiFuture future = subscriptionAdminClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_setiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..f58ff8467d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/setiampolicy/SyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_setiampolicy_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + Policy response = subscriptionAdminClient.setIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_setiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/streamingpull/AsyncStreamingPull.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/streamingpull/AsyncStreamingPull.java new file mode 100644 index 0000000000..6b37e3e2dd --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/streamingpull/AsyncStreamingPull.java @@ -0,0 +1,57 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_streamingpull_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.pubsub.v1.StreamingPullRequest; +import com.google.pubsub.v1.StreamingPullResponse; +import com.google.pubsub.v1.SubscriptionName; +import java.util.ArrayList; + +public class AsyncStreamingPull { + + public static void main(String[] args) throws Exception { + asyncStreamingPull(); + } + + public static void asyncStreamingPull() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + BidiStream bidiStream = + subscriptionAdminClient.streamingPullCallable().call(); + StreamingPullRequest request = + StreamingPullRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .addAllAckIds(new ArrayList()) + .addAllModifyDeadlineSeconds(new ArrayList()) + .addAllModifyDeadlineAckIds(new ArrayList()) + .setStreamAckDeadlineSeconds(1875467245) + .setClientId("clientId908408390") + .setMaxOutstandingMessages(-1315266996) + .setMaxOutstandingBytes(-2103098517) + .build(); + bidiStream.send(request); + for (StreamingPullResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_streamingpull_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..73da08f3c6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/AsyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + subscriptionAdminClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_testiampermissions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..b40e380872 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/testiampermissions/SyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_testiampermissions_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = subscriptionAdminClient.testIamPermissions(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_testiampermissions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/AsyncUpdateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/AsyncUpdateSnapshot.java new file mode 100644 index 0000000000..e81cfd863e --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/AsyncUpdateSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_updatesnapshot_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.UpdateSnapshotRequest; + +public class AsyncUpdateSnapshot { + + public static void main(String[] args) throws Exception { + asyncUpdateSnapshot(); + } + + public static void asyncUpdateSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder() + .setSnapshot(Snapshot.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + subscriptionAdminClient.updateSnapshotCallable().futureCall(request); + // Do something. + Snapshot response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_updatesnapshot_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/SyncUpdateSnapshot.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/SyncUpdateSnapshot.java new file mode 100644 index 0000000000..3ebc64c376 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesnapshot/SyncUpdateSnapshot.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_updatesnapshot_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Snapshot; +import com.google.pubsub.v1.UpdateSnapshotRequest; + +public class SyncUpdateSnapshot { + + public static void main(String[] args) throws Exception { + syncUpdateSnapshot(); + } + + public static void syncUpdateSnapshot() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + UpdateSnapshotRequest request = + UpdateSnapshotRequest.newBuilder() + .setSnapshot(Snapshot.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Snapshot response = subscriptionAdminClient.updateSnapshot(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_updatesnapshot_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/AsyncUpdateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/AsyncUpdateSubscription.java new file mode 100644 index 0000000000..2a9d30bb4a --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/AsyncUpdateSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_updatesubscription_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.UpdateSubscriptionRequest; + +public class AsyncUpdateSubscription { + + public static void main(String[] args) throws Exception { + asyncUpdateSubscription(); + } + + public static void asyncUpdateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = + subscriptionAdminClient.updateSubscriptionCallable().futureCall(request); + // Do something. + Subscription response = future.get(); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_updatesubscription_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/SyncUpdateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/SyncUpdateSubscription.java new file mode 100644 index 0000000000..b76693bfe6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/updatesubscription/SyncUpdateSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminclient_updatesubscription_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Subscription; +import com.google.pubsub.v1.UpdateSubscriptionRequest; + +public class SyncUpdateSubscription { + + public static void main(String[] args) throws Exception { + syncUpdateSubscription(); + } + + public static void syncUpdateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) { + UpdateSubscriptionRequest request = + UpdateSubscriptionRequest.newBuilder() + .setSubscription(Subscription.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Subscription response = subscriptionAdminClient.updateSubscription(request); + } + } +} +// [END pubsub_v1_generated_subscriptionadminclient_updatesubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.java new file mode 100644 index 0000000000..543fbd8b9f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminsettings/createsubscription/SyncCreateSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_subscriptionadminsettings_createsubscription_sync] +import com.google.cloud.pubsub.v1.SubscriptionAdminSettings; +import java.time.Duration; + +public class SyncCreateSubscription { + + public static void main(String[] args) throws Exception { + syncCreateSubscription(); + } + + public static void syncCreateSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + SubscriptionAdminSettings.Builder subscriptionAdminSettingsBuilder = + SubscriptionAdminSettings.newBuilder(); + subscriptionAdminSettingsBuilder + .createSubscriptionSettings() + .setRetrySettings( + subscriptionAdminSettingsBuilder + .createSubscriptionSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + SubscriptionAdminSettings subscriptionAdminSettings = subscriptionAdminSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_subscriptionadminsettings_createsubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..8d9640b79b --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.cloud.pubsub.v1.TopicAdminSettings; +import com.google.cloud.pubsub.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. + TopicAdminSettings topicAdminSettings = + TopicAdminSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings); + } +} +// [END pubsub_v1_generated_topicadminclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..6d4ea2b3bc --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_create_setendpoint_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.cloud.pubsub.v1.TopicAdminSettings; +import com.google.cloud.pubsub.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. + TopicAdminSettings topicAdminSettings = + TopicAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); + TopicAdminClient topicAdminClient = TopicAdminClient.create(topicAdminSettings); + } +} +// [END pubsub_v1_generated_topicadminclient_create_setendpoint_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/AsyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/AsyncCreateTopic.java new file mode 100644 index 0000000000..50e8e9d761 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/AsyncCreateTopic.java @@ -0,0 +1,55 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_createtopic_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Duration; +import com.google.pubsub.v1.MessageStoragePolicy; +import com.google.pubsub.v1.SchemaSettings; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; +import java.util.HashMap; + +public class AsyncCreateTopic { + + public static void main(String[] args) throws Exception { + asyncCreateTopic(); + } + + public static void asyncCreateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + Topic request = + Topic.newBuilder() + .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .putAllLabels(new HashMap()) + .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setSchemaSettings(SchemaSettings.newBuilder().build()) + .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) + .build(); + ApiFuture future = topicAdminClient.createTopicCallable().futureCall(request); + // Do something. + Topic response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_createtopic_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic.java new file mode 100644 index 0000000000..ad42c1b649 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_createtopic_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Duration; +import com.google.pubsub.v1.MessageStoragePolicy; +import com.google.pubsub.v1.SchemaSettings; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; +import java.util.HashMap; + +public class SyncCreateTopic { + + public static void main(String[] args) throws Exception { + syncCreateTopic(); + } + + public static void syncCreateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + Topic request = + Topic.newBuilder() + .setName(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .putAllLabels(new HashMap()) + .setMessageStoragePolicy(MessageStoragePolicy.newBuilder().build()) + .setKmsKeyName("kmsKeyName412586233") + .setSchemaSettings(SchemaSettings.newBuilder().build()) + .setSatisfiesPzs(true) + .setMessageRetentionDuration(Duration.newBuilder().build()) + .build(); + Topic response = topicAdminClient.createTopic(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_createtopic_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.java new file mode 100644 index 0000000000..fded47ac1d --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_createtopic_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateTopicString { + + public static void main(String[] args) throws Exception { + syncCreateTopicString(); + } + + public static void syncCreateTopicString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + Topic response = topicAdminClient.createTopic(name); + } + } +} +// [END pubsub_v1_generated_topicadminclient_createtopic_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.java new file mode 100644 index 0000000000..66a3c9abfb --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_createtopic_topicname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class SyncCreateTopicTopicname { + + public static void main(String[] args) throws Exception { + syncCreateTopicTopicname(); + } + + public static void syncCreateTopicTopicname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName name = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + Topic response = topicAdminClient.createTopic(name); + } + } +} +// [END pubsub_v1_generated_topicadminclient_createtopic_topicname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/AsyncDeleteTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/AsyncDeleteTopic.java new file mode 100644 index 0000000000..6472eb7123 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/AsyncDeleteTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_deletetopic_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteTopicRequest; +import com.google.pubsub.v1.TopicName; + +public class AsyncDeleteTopic { + + public static void main(String[] args) throws Exception { + asyncDeleteTopic(); + } + + public static void asyncDeleteTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + DeleteTopicRequest request = + DeleteTopicRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .build(); + ApiFuture future = topicAdminClient.deleteTopicCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_deletetopic_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic.java new file mode 100644 index 0000000000..c64b019021 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_deletetopic_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.DeleteTopicRequest; +import com.google.pubsub.v1.TopicName; + +public class SyncDeleteTopic { + + public static void main(String[] args) throws Exception { + syncDeleteTopic(); + } + + public static void syncDeleteTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + DeleteTopicRequest request = + DeleteTopicRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .build(); + topicAdminClient.deleteTopic(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_deletetopic_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.java new file mode 100644 index 0000000000..a65a97ea56 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_deletetopic_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.TopicName; + +public class SyncDeleteTopicString { + + public static void main(String[] args) throws Exception { + syncDeleteTopicString(); + } + + public static void syncDeleteTopicString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + topicAdminClient.deleteTopic(topic); + } + } +} +// [END pubsub_v1_generated_topicadminclient_deletetopic_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.java new file mode 100644 index 0000000000..4e61693dd7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_deletetopic_topicname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.Empty; +import com.google.pubsub.v1.TopicName; + +public class SyncDeleteTopicTopicname { + + public static void main(String[] args) throws Exception { + syncDeleteTopicTopicname(); + } + + public static void syncDeleteTopicTopicname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + topicAdminClient.deleteTopic(topic); + } + } +} +// [END pubsub_v1_generated_topicadminclient_deletetopic_topicname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/AsyncDetachSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/AsyncDetachSubscription.java new file mode 100644 index 0000000000..96cf59176f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/AsyncDetachSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_detachsubscription_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.DetachSubscriptionRequest; +import com.google.pubsub.v1.DetachSubscriptionResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class AsyncDetachSubscription { + + public static void main(String[] args) throws Exception { + asyncDetachSubscription(); + } + + public static void asyncDetachSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + DetachSubscriptionRequest request = + DetachSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + ApiFuture future = + topicAdminClient.detachSubscriptionCallable().futureCall(request); + // Do something. + DetachSubscriptionResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_detachsubscription_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/SyncDetachSubscription.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/SyncDetachSubscription.java new file mode 100644 index 0000000000..df0e774a08 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/detachsubscription/SyncDetachSubscription.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_detachsubscription_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.DetachSubscriptionRequest; +import com.google.pubsub.v1.DetachSubscriptionResponse; +import com.google.pubsub.v1.SubscriptionName; + +public class SyncDetachSubscription { + + public static void main(String[] args) throws Exception { + syncDetachSubscription(); + } + + public static void syncDetachSubscription() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + DetachSubscriptionRequest request = + DetachSubscriptionRequest.newBuilder() + .setSubscription(SubscriptionName.of("[PROJECT]", "[SUBSCRIPTION]").toString()) + .build(); + DetachSubscriptionResponse response = topicAdminClient.detachSubscription(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_detachsubscription_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..e751df5487 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/AsyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = topicAdminClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_getiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..d44235c6d0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/getiampolicy/SyncGetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_getiampolicy_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.pubsub.v1.ProjectName; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = topicAdminClient.getIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_getiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/AsyncGetTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/AsyncGetTopic.java new file mode 100644 index 0000000000..7e55e7e304 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/AsyncGetTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_gettopic_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class AsyncGetTopic { + + public static void main(String[] args) throws Exception { + asyncGetTopic(); + } + + public static void asyncGetTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + GetTopicRequest request = + GetTopicRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .build(); + ApiFuture future = topicAdminClient.getTopicCallable().futureCall(request); + // Do something. + Topic response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_gettopic_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic.java new file mode 100644 index 0000000000..5ac56d2134 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_gettopic_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.GetTopicRequest; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class SyncGetTopic { + + public static void main(String[] args) throws Exception { + syncGetTopic(); + } + + public static void syncGetTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + GetTopicRequest request = + GetTopicRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .build(); + Topic response = topicAdminClient.getTopic(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_gettopic_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.java new file mode 100644 index 0000000000..4b550ba881 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_gettopic_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class SyncGetTopicString { + + public static void main(String[] args) throws Exception { + syncGetTopicString(); + } + + public static void syncGetTopicString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + Topic response = topicAdminClient.getTopic(topic); + } + } +} +// [END pubsub_v1_generated_topicadminclient_gettopic_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.java new file mode 100644 index 0000000000..48e345db28 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_gettopic_topicname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.TopicName; + +public class SyncGetTopicTopicname { + + public static void main(String[] args) throws Exception { + syncGetTopicTopicname(); + } + + public static void syncGetTopicTopicname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + Topic response = topicAdminClient.getTopic(topic); + } + } +} +// [END pubsub_v1_generated_topicadminclient_gettopic_topicname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics.java new file mode 100644 index 0000000000..f6551df358 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopics_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Topic; + +public class AsyncListTopics { + + public static void main(String[] args) throws Exception { + asyncListTopics(); + } + + public static void asyncListTopics() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicsRequest request = + ListTopicsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = topicAdminClient.listTopicsPagedCallable().futureCall(request); + // Do something. + for (Topic element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopics_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java new file mode 100644 index 0000000000..5280c62391 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopics_paged_async] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListTopicsRequest; +import com.google.pubsub.v1.ListTopicsResponse; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Topic; + +public class AsyncListTopicsPaged { + + public static void main(String[] args) throws Exception { + asyncListTopicsPaged(); + } + + public static void asyncListTopicsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicsRequest request = + ListTopicsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListTopicsResponse response = topicAdminClient.listTopicsCallable().call(request); + for (Topic element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopics_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics.java new file mode 100644 index 0000000000..74a4c01610 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopics_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicsRequest; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Topic; + +public class SyncListTopics { + + public static void main(String[] args) throws Exception { + syncListTopics(); + } + + public static void syncListTopics() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicsRequest request = + ListTopicsRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Topic element : topicAdminClient.listTopics(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopics_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.java new file mode 100644 index 0000000000..980f0509f4 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopics_projectname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Topic; + +public class SyncListTopicsProjectname { + + public static void main(String[] args) throws Exception { + syncListTopicsProjectname(); + } + + public static void syncListTopicsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + for (Topic element : topicAdminClient.listTopics(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopics_projectname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.java new file mode 100644 index 0000000000..670d6552b8 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopics_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ProjectName; +import com.google.pubsub.v1.Topic; + +public class SyncListTopicsString { + + public static void main(String[] args) throws Exception { + syncListTopicsString(); + } + + public static void syncListTopicsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + for (Topic element : topicAdminClient.listTopics(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopics_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots.java new file mode 100644 index 0000000000..301c750a50 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsnapshots_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.TopicName; + +public class AsyncListTopicSnapshots { + + public static void main(String[] args) throws Exception { + asyncListTopicSnapshots(); + } + + public static void asyncListTopicSnapshots() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSnapshotsRequest request = + ListTopicSnapshotsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + topicAdminClient.listTopicSnapshotsPagedCallable().futureCall(request); + // Do something. + for (String element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsnapshots_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java new file mode 100644 index 0000000000..d6bdec8b39 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsnapshots_paged_async] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.ListTopicSnapshotsResponse; +import com.google.pubsub.v1.TopicName; + +public class AsyncListTopicSnapshotsPaged { + + public static void main(String[] args) throws Exception { + asyncListTopicSnapshotsPaged(); + } + + public static void asyncListTopicSnapshotsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSnapshotsRequest request = + ListTopicSnapshotsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListTopicSnapshotsResponse response = + topicAdminClient.listTopicSnapshotsCallable().call(request); + for (String element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsnapshots_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots.java new file mode 100644 index 0000000000..71794f9803 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsnapshots_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicSnapshotsRequest; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSnapshots { + + public static void main(String[] args) throws Exception { + syncListTopicSnapshots(); + } + + public static void syncListTopicSnapshots() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSnapshotsRequest request = + ListTopicSnapshotsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (String element : topicAdminClient.listTopicSnapshots(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsnapshots_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.java new file mode 100644 index 0000000000..3e069480b2 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsnapshots_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSnapshotsString { + + public static void main(String[] args) throws Exception { + syncListTopicSnapshotsString(); + } + + public static void syncListTopicSnapshotsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + for (String element : topicAdminClient.listTopicSnapshots(topic).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsnapshots_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.java new file mode 100644 index 0000000000..eff93a9188 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsnapshots_topicname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSnapshotsTopicname { + + public static void main(String[] args) throws Exception { + syncListTopicSnapshotsTopicname(); + } + + public static void syncListTopicSnapshotsTopicname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + for (String element : topicAdminClient.listTopicSnapshots(topic).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsnapshots_topicname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions.java new file mode 100644 index 0000000000..7e1e3288b7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsubscriptions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicSubscriptionsRequest; +import com.google.pubsub.v1.TopicName; + +public class AsyncListTopicSubscriptions { + + public static void main(String[] args) throws Exception { + asyncListTopicSubscriptions(); + } + + public static void asyncListTopicSubscriptions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + topicAdminClient.listTopicSubscriptionsPagedCallable().futureCall(request); + // Do something. + for (String element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsubscriptions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java new file mode 100644 index 0000000000..c824051379 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsubscriptions_paged_async] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.common.base.Strings; +import com.google.pubsub.v1.ListTopicSubscriptionsRequest; +import com.google.pubsub.v1.ListTopicSubscriptionsResponse; +import com.google.pubsub.v1.TopicName; + +public class AsyncListTopicSubscriptionsPaged { + + public static void main(String[] args) throws Exception { + asyncListTopicSubscriptionsPaged(); + } + + public static void asyncListTopicSubscriptionsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListTopicSubscriptionsResponse response = + topicAdminClient.listTopicSubscriptionsCallable().call(request); + for (String element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsubscriptions_paged_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions.java new file mode 100644 index 0000000000..7420dec7b0 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsubscriptions_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.ListTopicSubscriptionsRequest; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSubscriptions { + + public static void main(String[] args) throws Exception { + syncListTopicSubscriptions(); + } + + public static void syncListTopicSubscriptions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + ListTopicSubscriptionsRequest request = + ListTopicSubscriptionsRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (String element : topicAdminClient.listTopicSubscriptions(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsubscriptions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.java new file mode 100644 index 0000000000..689ca05174 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsubscriptions_string_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSubscriptionsString { + + public static void main(String[] args) throws Exception { + syncListTopicSubscriptionsString(); + } + + public static void syncListTopicSubscriptionsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + for (String element : topicAdminClient.listTopicSubscriptions(topic).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsubscriptions_string_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.java new file mode 100644 index 0000000000..d822739f23 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_listtopicsubscriptions_topicname_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.TopicName; + +public class SyncListTopicSubscriptionsTopicname { + + public static void main(String[] args) throws Exception { + syncListTopicSubscriptionsTopicname(); + } + + public static void syncListTopicSubscriptionsTopicname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + for (String element : topicAdminClient.listTopicSubscriptions(topic).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END pubsub_v1_generated_topicadminclient_listtopicsubscriptions_topicname_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/AsyncPublish.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/AsyncPublish.java new file mode 100644 index 0000000000..ee9d7bdc7f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/AsyncPublish.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_publish_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.PublishRequest; +import com.google.pubsub.v1.PublishResponse; +import com.google.pubsub.v1.PubsubMessage; +import com.google.pubsub.v1.TopicName; +import java.util.ArrayList; + +public class AsyncPublish { + + public static void main(String[] args) throws Exception { + asyncPublish(); + } + + public static void asyncPublish() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + PublishRequest request = + PublishRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .addAllMessages(new ArrayList()) + .build(); + ApiFuture future = topicAdminClient.publishCallable().futureCall(request); + // Do something. + PublishResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_publish_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish.java new file mode 100644 index 0000000000..0bd715cf18 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_publish_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.PublishRequest; +import com.google.pubsub.v1.PublishResponse; +import com.google.pubsub.v1.PubsubMessage; +import com.google.pubsub.v1.TopicName; +import java.util.ArrayList; + +public class SyncPublish { + + public static void main(String[] args) throws Exception { + syncPublish(); + } + + public static void syncPublish() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + PublishRequest request = + PublishRequest.newBuilder() + .setTopic(TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString()) + .addAllMessages(new ArrayList()) + .build(); + PublishResponse response = topicAdminClient.publish(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_publish_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.java new file mode 100644 index 0000000000..dbb931e5f6 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_publish_stringlistpubsubmessage_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.PublishResponse; +import com.google.pubsub.v1.PubsubMessage; +import com.google.pubsub.v1.TopicName; +import java.util.ArrayList; +import java.util.List; + +public class SyncPublishStringListpubsubmessage { + + public static void main(String[] args) throws Exception { + syncPublishStringListpubsubmessage(); + } + + public static void syncPublishStringListpubsubmessage() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + String topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]").toString(); + List messages = new ArrayList<>(); + PublishResponse response = topicAdminClient.publish(topic, messages); + } + } +} +// [END pubsub_v1_generated_topicadminclient_publish_stringlistpubsubmessage_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.java new file mode 100644 index 0000000000..66eecb8a39 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_publish_topicnamelistpubsubmessage_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.pubsub.v1.PublishResponse; +import com.google.pubsub.v1.PubsubMessage; +import com.google.pubsub.v1.TopicName; +import java.util.ArrayList; +import java.util.List; + +public class SyncPublishTopicnameListpubsubmessage { + + public static void main(String[] args) throws Exception { + syncPublishTopicnameListpubsubmessage(); + } + + public static void syncPublishTopicnameListpubsubmessage() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TopicName topic = TopicName.ofProjectTopicName("[PROJECT]", "[TOPIC]"); + List messages = new ArrayList<>(); + PublishResponse response = topicAdminClient.publish(topic, messages); + } + } +} +// [END pubsub_v1_generated_topicadminclient_publish_topicnamelistpubsubmessage_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..943213ce6a --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/AsyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + ApiFuture future = topicAdminClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_setiampolicy_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..52f912fdaf --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/setiampolicy/SyncSetIamPolicy.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_setiampolicy_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.pubsub.v1.ProjectName; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + Policy response = topicAdminClient.setIamPolicy(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_setiampolicy_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..d1c2ce8934 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/AsyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + topicAdminClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_testiampermissions_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..2de0c18bbe --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/testiampermissions/SyncTestIamPermissions.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_testiampermissions_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.pubsub.v1.ProjectName; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(ProjectName.of("[PROJECT]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_testiampermissions_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/AsyncUpdateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/AsyncUpdateTopic.java new file mode 100644 index 0000000000..b935bb2f7f --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/AsyncUpdateTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_updatetopic_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.UpdateTopicRequest; + +public class AsyncUpdateTopic { + + public static void main(String[] args) throws Exception { + asyncUpdateTopic(); + } + + public static void asyncUpdateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + UpdateTopicRequest request = + UpdateTopicRequest.newBuilder() + .setTopic(Topic.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = topicAdminClient.updateTopicCallable().futureCall(request); + // Do something. + Topic response = future.get(); + } + } +} +// [END pubsub_v1_generated_topicadminclient_updatetopic_async] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/SyncUpdateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/SyncUpdateTopic.java new file mode 100644 index 0000000000..6f1b6ed2c7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/updatetopic/SyncUpdateTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminclient_updatetopic_sync] +import com.google.cloud.pubsub.v1.TopicAdminClient; +import com.google.protobuf.FieldMask; +import com.google.pubsub.v1.Topic; +import com.google.pubsub.v1.UpdateTopicRequest; + +public class SyncUpdateTopic { + + public static void main(String[] args) throws Exception { + syncUpdateTopic(); + } + + public static void syncUpdateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) { + UpdateTopicRequest request = + UpdateTopicRequest.newBuilder() + .setTopic(Topic.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + Topic response = topicAdminClient.updateTopic(request); + } + } +} +// [END pubsub_v1_generated_topicadminclient_updatetopic_sync] diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.java new file mode 100644 index 0000000000..23c6aa40c7 --- /dev/null +++ b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminsettings/createtopic/SyncCreateTopic.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.pubsub.v1.samples; + +// [START pubsub_v1_generated_topicadminsettings_createtopic_sync] +import com.google.cloud.pubsub.v1.TopicAdminSettings; +import java.time.Duration; + +public class SyncCreateTopic { + + public static void main(String[] args) throws Exception { + syncCreateTopic(); + } + + public static void syncCreateTopic() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + TopicAdminSettings.Builder topicAdminSettingsBuilder = TopicAdminSettings.newBuilder(); + topicAdminSettingsBuilder + .createTopicSettings() + .setRetrySettings( + topicAdminSettingsBuilder + .createTopicSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + TopicAdminSettings topicAdminSettings = topicAdminSettingsBuilder.build(); + } +} +// [END pubsub_v1_generated_topicadminsettings_createtopic_sync] diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockIAMPolicy.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockIAMPolicy.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicy.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockIAMPolicyImpl.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockPublisher.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockPublisher.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisher.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockPublisherImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockPublisherImpl.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockPublisherImpl.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSchemaService.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSchemaService.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaService.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSchemaServiceImpl.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSubscriber.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSubscriber.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriber.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSubscriberImpl.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/MockSubscriberImpl.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/MockSubscriberImpl.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceClient.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClient.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceClientTest.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SchemaServiceSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SchemaServiceSettings.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClient.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminClientTest.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/SubscriptionAdminSettings.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClient.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClient.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminClientTest.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminClientTest.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/TopicAdminSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/TopicAdminSettings.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/gapic_metadata.json b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/gapic_metadata.json rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/gapic_metadata.json diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/package-info.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/package-info.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/package-info.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherCallableFactory.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcPublisherStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceCallableFactory.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSchemaServiceStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberCallableFactory.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/GrpcSubscriberStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/PublisherStubSettings.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SchemaServiceStubSettings.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStub.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStub.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStub.java diff --git a/test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java b/test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java rename to test/integration/goldens/pubsub/src/com/google/cloud/pubsub/v1/stub/SubscriberStubSettings.java diff --git a/test/integration/goldens/pubsub/com/google/pubsub/v1/ProjectName.java b/test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/pubsub/v1/ProjectName.java rename to test/integration/goldens/pubsub/src/com/google/pubsub/v1/ProjectName.java diff --git a/test/integration/goldens/pubsub/com/google/pubsub/v1/SchemaName.java b/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/pubsub/v1/SchemaName.java rename to test/integration/goldens/pubsub/src/com/google/pubsub/v1/SchemaName.java diff --git a/test/integration/goldens/pubsub/com/google/pubsub/v1/SnapshotName.java b/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/pubsub/v1/SnapshotName.java rename to test/integration/goldens/pubsub/src/com/google/pubsub/v1/SnapshotName.java diff --git a/test/integration/goldens/pubsub/com/google/pubsub/v1/SubscriptionName.java b/test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/pubsub/v1/SubscriptionName.java rename to test/integration/goldens/pubsub/src/com/google/pubsub/v1/SubscriptionName.java diff --git a/test/integration/goldens/pubsub/com/google/pubsub/v1/TopicName.java b/test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java similarity index 100% rename from test/integration/goldens/pubsub/com/google/pubsub/v1/TopicName.java rename to test/integration/goldens/pubsub/src/com/google/pubsub/v1/TopicName.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..cfd9fc80f7 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.CloudRedisSettings; +import com.google.cloud.redis.v1beta1.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. + CloudRedisSettings cloudRedisSettings = + CloudRedisSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings); + } +} +// [END redis_v1beta1_generated_cloudredisclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..b6234a302c --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_create_setendpoint_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.CloudRedisSettings; +import com.google.cloud.redis.v1beta1.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. + CloudRedisSettings cloudRedisSettings = + CloudRedisSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudRedisClient cloudRedisClient = CloudRedisClient.create(cloudRedisSettings); + } +} +// [END redis_v1beta1_generated_cloudredisclient_create_setendpoint_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance.java new file mode 100644 index 0000000000..59c4f0fd66 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_createinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .build(); + ApiFuture future = cloudRedisClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_createinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.java new file mode 100644 index 0000000000..8a8154c496 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_createinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; +import com.google.protobuf.Any; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .build(); + OperationFuture future = + cloudRedisClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_createinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance.java new file mode 100644 index 0000000000..fedb0e4ddb --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_createinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.CreateInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .build(); + Instance response = cloudRedisClient.createInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_createinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.java new file mode 100644 index 0000000000..55af3c168b --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_createinstance_locationnamestringinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncCreateInstanceLocationnameStringInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstanceLocationnameStringInstance(); + } + + public static void syncCreateInstanceLocationnameStringInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_createinstance_locationnamestringinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.java new file mode 100644 index 0000000000..1e777a7015 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_createinstance_stringstringinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncCreateInstanceStringStringInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringStringInstance(); + } + + public static void syncCreateInstanceStringStringInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + String instanceId = "instanceId902024336"; + Instance instance = Instance.newBuilder().build(); + Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_createinstance_stringstringinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 0000000000..b7fb20b691 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_deleteinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = cloudRedisClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_deleteinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.java new file mode 100644 index 0000000000..ddb78118cd --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_deleteinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + OperationFuture future = + cloudRedisClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_deleteinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 0000000000..c8916d3582 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_deleteinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.DeleteInstanceRequest; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + cloudRedisClient.deleteInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_deleteinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.java new file mode 100644 index 0000000000..2e63ba9fed --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_deleteinstance_instancename_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + cloudRedisClient.deleteInstanceAsync(name).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_deleteinstance_instancename_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.java new file mode 100644 index 0000000000..51230d5a24 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_deleteinstance_string_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + cloudRedisClient.deleteInstanceAsync(name).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_deleteinstance_string_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance.java new file mode 100644 index 0000000000..ad57c58e7e --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_exportinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.OutputConfig; +import com.google.longrunning.Operation; + +public class AsyncExportInstance { + + public static void main(String[] args) throws Exception { + asyncExportInstance(); + } + + public static void asyncExportInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ExportInstanceRequest request = + ExportInstanceRequest.newBuilder() + .setName("name3373707") + .setOutputConfig(OutputConfig.newBuilder().build()) + .build(); + ApiFuture future = cloudRedisClient.exportInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_exportinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.java new file mode 100644 index 0000000000..8534bf3ee7 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_exportinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.OutputConfig; +import com.google.protobuf.Any; + +public class AsyncExportInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncExportInstanceLRO(); + } + + public static void asyncExportInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ExportInstanceRequest request = + ExportInstanceRequest.newBuilder() + .setName("name3373707") + .setOutputConfig(OutputConfig.newBuilder().build()) + .build(); + OperationFuture future = + cloudRedisClient.exportInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_exportinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance.java new file mode 100644 index 0000000000..3f2cc0e566 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_exportinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ExportInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.OutputConfig; + +public class SyncExportInstance { + + public static void main(String[] args) throws Exception { + syncExportInstance(); + } + + public static void syncExportInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ExportInstanceRequest request = + ExportInstanceRequest.newBuilder() + .setName("name3373707") + .setOutputConfig(OutputConfig.newBuilder().build()) + .build(); + Instance response = cloudRedisClient.exportInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_exportinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.java new file mode 100644 index 0000000000..d2b36f90a1 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_exportinstance_stringoutputconfig_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.OutputConfig; + +public class SyncExportInstanceStringOutputconfig { + + public static void main(String[] args) throws Exception { + syncExportInstanceStringOutputconfig(); + } + + public static void syncExportInstanceStringOutputconfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = "name3373707"; + OutputConfig outputConfig = OutputConfig.newBuilder().build(); + Instance response = cloudRedisClient.exportInstanceAsync(name, outputConfig).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_exportinstance_stringoutputconfig_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance.java new file mode 100644 index 0000000000..908d016b7e --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_failoverinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.longrunning.Operation; + +public class AsyncFailoverInstance { + + public static void main(String[] args) throws Exception { + asyncFailoverInstance(); + } + + public static void asyncFailoverInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = cloudRedisClient.failoverInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_failoverinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.java new file mode 100644 index 0000000000..9424f43065 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_failoverinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.protobuf.Any; + +public class AsyncFailoverInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncFailoverInstanceLRO(); + } + + public static void asyncFailoverInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + OperationFuture future = + cloudRedisClient.failoverInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_failoverinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance.java new file mode 100644 index 0000000000..845c470c4d --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_failoverinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncFailoverInstance { + + public static void main(String[] args) throws Exception { + syncFailoverInstance(); + } + + public static void syncFailoverInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + FailoverInstanceRequest request = + FailoverInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + Instance response = cloudRedisClient.failoverInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_failoverinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java new file mode 100644 index 0000000000..3a534cd444 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_failoverinstance_instancenamefailoverinstancerequestdataprotectionmode_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode(); + } + + public static void syncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_failoverinstance_instancenamefailoverinstancerequestdataprotectionmode_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java new file mode 100644 index 0000000000..af21b9309f --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_failoverinstance_stringfailoverinstancerequestdataprotectionmode_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.FailoverInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncFailoverInstanceStringFailoverinstancerequestdataprotectionmode { + + public static void main(String[] args) throws Exception { + syncFailoverInstanceStringFailoverinstancerequestdataprotectionmode(); + } + + public static void syncFailoverInstanceStringFailoverinstancerequestdataprotectionmode() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + FailoverInstanceRequest.DataProtectionMode dataProtectionMode = + FailoverInstanceRequest.DataProtectionMode.forNumber(0); + Instance response = cloudRedisClient.failoverInstanceAsync(name, dataProtectionMode).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_failoverinstance_stringfailoverinstancerequestdataprotectionmode_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/AsyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/AsyncGetInstance.java new file mode 100644 index 0000000000..b2147500ef --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/AsyncGetInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = cloudRedisClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance.java new file mode 100644 index 0000000000..d68e05277b --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.GetInstanceRequest; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + Instance response = cloudRedisClient.getInstance(request); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.java new file mode 100644 index 0000000000..97b5990568 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstance_instancename_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Instance response = cloudRedisClient.getInstance(name); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstance_instancename_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.java new file mode 100644 index 0000000000..92ff58b94d --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstance_string_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + Instance response = cloudRedisClient.getInstance(name); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstance_string_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/AsyncGetInstanceAuthString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/AsyncGetInstanceAuthString.java new file mode 100644 index 0000000000..1adc84838e --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/AsyncGetInstanceAuthString.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; +import com.google.cloud.redis.v1beta1.InstanceAuthString; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class AsyncGetInstanceAuthString { + + public static void main(String[] args) throws Exception { + asyncGetInstanceAuthString(); + } + + public static void asyncGetInstanceAuthString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + GetInstanceAuthStringRequest request = + GetInstanceAuthStringRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = + cloudRedisClient.getInstanceAuthStringCallable().futureCall(request); + // Do something. + InstanceAuthString response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString.java new file mode 100644 index 0000000000..44666a4cc9 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.GetInstanceAuthStringRequest; +import com.google.cloud.redis.v1beta1.InstanceAuthString; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstanceAuthString { + + public static void main(String[] args) throws Exception { + syncGetInstanceAuthString(); + } + + public static void syncGetInstanceAuthString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + GetInstanceAuthStringRequest request = + GetInstanceAuthStringRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + InstanceAuthString response = cloudRedisClient.getInstanceAuthString(request); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.java new file mode 100644 index 0000000000..9aab155d90 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_instancename_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceAuthString; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstanceAuthStringInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceAuthStringInstancename(); + } + + public static void syncGetInstanceAuthStringInstancename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_instancename_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.java new file mode 100644 index 0000000000..b9ffffca54 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_string_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceAuthString; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncGetInstanceAuthStringString { + + public static void main(String[] args) throws Exception { + syncGetInstanceAuthStringString(); + } + + public static void syncGetInstanceAuthStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + InstanceAuthString response = cloudRedisClient.getInstanceAuthString(name); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_getinstanceauthstring_string_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance.java new file mode 100644 index 0000000000..cdf2776d77 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_importinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.InputConfig; +import com.google.longrunning.Operation; + +public class AsyncImportInstance { + + public static void main(String[] args) throws Exception { + asyncImportInstance(); + } + + public static void asyncImportInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ImportInstanceRequest request = + ImportInstanceRequest.newBuilder() + .setName("name3373707") + .setInputConfig(InputConfig.newBuilder().build()) + .build(); + ApiFuture future = cloudRedisClient.importInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_importinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.java new file mode 100644 index 0000000000..74e69879e2 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_importinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.InputConfig; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.protobuf.Any; + +public class AsyncImportInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncImportInstanceLRO(); + } + + public static void asyncImportInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ImportInstanceRequest request = + ImportInstanceRequest.newBuilder() + .setName("name3373707") + .setInputConfig(InputConfig.newBuilder().build()) + .build(); + OperationFuture future = + cloudRedisClient.importInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_importinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance.java new file mode 100644 index 0000000000..4482b68059 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_importinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.ImportInstanceRequest; +import com.google.cloud.redis.v1beta1.InputConfig; +import com.google.cloud.redis.v1beta1.Instance; + +public class SyncImportInstance { + + public static void main(String[] args) throws Exception { + syncImportInstance(); + } + + public static void syncImportInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ImportInstanceRequest request = + ImportInstanceRequest.newBuilder() + .setName("name3373707") + .setInputConfig(InputConfig.newBuilder().build()) + .build(); + Instance response = cloudRedisClient.importInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_importinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.java new file mode 100644 index 0000000000..bc0092ca15 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_importinstance_stringinputconfig_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InputConfig; +import com.google.cloud.redis.v1beta1.Instance; + +public class SyncImportInstanceStringInputconfig { + + public static void main(String[] args) throws Exception { + syncImportInstanceStringInputconfig(); + } + + public static void syncImportInstanceStringInputconfig() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = "name3373707"; + InputConfig inputConfig = InputConfig.newBuilder().build(); + Instance response = cloudRedisClient.importInstanceAsync(name, inputConfig).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_importinstance_stringinputconfig_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances.java new file mode 100644 index 0000000000..f4d15eb731 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_listinstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.LocationName; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudRedisClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_listinstances_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java new file mode 100644 index 0000000000..c7db15f532 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java @@ -0,0 +1,58 @@ +/* + * 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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_listinstances_paged_async] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.ListInstancesResponse; +import com.google.cloud.redis.v1beta1.LocationName; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListInstancesResponse response = cloudRedisClient.listInstancesCallable().call(request); + for (Instance element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_listinstances_paged_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances.java new file mode 100644 index 0000000000..c76dc3b7a7 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_listinstances_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.ListInstancesRequest; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Instance element : cloudRedisClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_listinstances_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.java new file mode 100644 index 0000000000..3b16874b2f --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_listinstances_locationname_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncListInstancesLocationname { + + public static void main(String[] args) throws Exception { + syncListInstancesLocationname(); + } + + public static void syncListInstancesLocationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_listinstances_locationname_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.java new file mode 100644 index 0000000000..fd896631ab --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_listinstances_string_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.LocationName; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_listinstances_string_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance.java new file mode 100644 index 0000000000..6da21f92b4 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Timestamp; + +public class AsyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + asyncRescheduleMaintenance(); + } + + public static void asyncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + RescheduleMaintenanceRequest request = + RescheduleMaintenanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setScheduleTime(Timestamp.newBuilder().build()) + .build(); + ApiFuture future = + cloudRedisClient.rescheduleMaintenanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.java new file mode 100644 index 0000000000..2e4486d494 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; + +public class AsyncRescheduleMaintenanceLRO { + + public static void main(String[] args) throws Exception { + asyncRescheduleMaintenanceLRO(); + } + + public static void asyncRescheduleMaintenanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + RescheduleMaintenanceRequest request = + RescheduleMaintenanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setScheduleTime(Timestamp.newBuilder().build()) + .build(); + OperationFuture future = + cloudRedisClient.rescheduleMaintenanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance.java new file mode 100644 index 0000000000..e5aa6c3438 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.protobuf.Timestamp; + +public class SyncRescheduleMaintenance { + + public static void main(String[] args) throws Exception { + syncRescheduleMaintenance(); + } + + public static void syncRescheduleMaintenance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + RescheduleMaintenanceRequest request = + RescheduleMaintenanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setScheduleTime(Timestamp.newBuilder().build()) + .build(); + Instance response = cloudRedisClient.rescheduleMaintenanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java new file mode 100644 index 0000000000..8e4e5e99ec --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_instancenamereschedulemaintenancerequestrescheduletypetimestamp_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.protobuf.Timestamp; + +public +class SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp { + + public static void main(String[] args) throws Exception { + syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp(); + } + + public static void + syncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + Instance response = + cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_instancenamereschedulemaintenancerequestrescheduletypetimestamp_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java new file mode 100644 index 0000000000..686b3760c8 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_stringreschedulemaintenancerequestrescheduletypetimestamp_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.RescheduleMaintenanceRequest; +import com.google.protobuf.Timestamp; + +public class SyncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp { + + public static void main(String[] args) throws Exception { + syncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp(); + } + + public static void + syncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp() + throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + RescheduleMaintenanceRequest.RescheduleType rescheduleType = + RescheduleMaintenanceRequest.RescheduleType.forNumber(0); + Timestamp scheduleTime = Timestamp.newBuilder().build(); + Instance response = + cloudRedisClient.rescheduleMaintenanceAsync(name, rescheduleType, scheduleTime).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_reschedulemaintenance_stringreschedulemaintenancerequestrescheduletypetimestamp_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 0000000000..a8250d4dae --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_updateinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .build(); + ApiFuture future = cloudRedisClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_updateinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.java new file mode 100644 index 0000000000..b8702e6ade --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_updateinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.protobuf.Any; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .build(); + OperationFuture future = + cloudRedisClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_updateinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance.java new file mode 100644 index 0000000000..3e2e71b820 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_updateinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .build(); + Instance response = cloudRedisClient.updateInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_updateinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.java new file mode 100644 index 0000000000..2580dcde7b --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_updateinstance_fieldmaskinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceFieldmaskInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceFieldmaskInstance(); + } + + public static void syncUpdateInstanceFieldmaskInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance instance = Instance.newBuilder().build(); + Instance response = cloudRedisClient.updateInstanceAsync(updateMask, instance).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_updateinstance_fieldmaskinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance.java new file mode 100644 index 0000000000..e94e34c920 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_upgradeinstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; +import com.google.longrunning.Operation; + +public class AsyncUpgradeInstance { + + public static void main(String[] args) throws Exception { + asyncUpgradeInstance(); + } + + public static void asyncUpgradeInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpgradeInstanceRequest request = + UpgradeInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRedisVersion("redisVersion-1972584739") + .build(); + ApiFuture future = cloudRedisClient.upgradeInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_upgradeinstance_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.java new file mode 100644 index 0000000000..daae237f8b --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_upgradeinstance_lro_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; +import com.google.protobuf.Any; + +public class AsyncUpgradeInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpgradeInstanceLRO(); + } + + public static void asyncUpgradeInstanceLRO() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpgradeInstanceRequest request = + UpgradeInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRedisVersion("redisVersion-1972584739") + .build(); + OperationFuture future = + cloudRedisClient.upgradeInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_upgradeinstance_lro_async] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance.java new file mode 100644 index 0000000000..2860730b58 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_upgradeinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; +import com.google.cloud.redis.v1beta1.UpgradeInstanceRequest; + +public class SyncUpgradeInstance { + + public static void main(String[] args) throws Exception { + syncUpgradeInstance(); + } + + public static void syncUpgradeInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + UpgradeInstanceRequest request = + UpgradeInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRedisVersion("redisVersion-1972584739") + .build(); + Instance response = cloudRedisClient.upgradeInstanceAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_upgradeinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.java new file mode 100644 index 0000000000..20bc73d1df --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_upgradeinstance_instancenamestring_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncUpgradeInstanceInstancenameString { + + public static void main(String[] args) throws Exception { + syncUpgradeInstanceInstancenameString(); + } + + public static void syncUpgradeInstanceInstancenameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + String redisVersion = "redisVersion-1972584739"; + Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_upgradeinstance_instancenamestring_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.java new file mode 100644 index 0000000000..d5e491b2aa --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredisclient_upgradeinstance_stringstring_sync] +import com.google.cloud.redis.v1beta1.CloudRedisClient; +import com.google.cloud.redis.v1beta1.Instance; +import com.google.cloud.redis.v1beta1.InstanceName; + +public class SyncUpgradeInstanceStringString { + + public static void main(String[] args) throws Exception { + syncUpgradeInstanceStringString(); + } + + public static void syncUpgradeInstanceStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + String redisVersion = "redisVersion-1972584739"; + Instance response = cloudRedisClient.upgradeInstanceAsync(name, redisVersion).get(); + } + } +} +// [END redis_v1beta1_generated_cloudredisclient_upgradeinstance_stringstring_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.java new file mode 100644 index 0000000000..83c8035482 --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredissettings/getinstance/SyncGetInstance.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.redis.v1beta1.samples; + +// [START redis_v1beta1_generated_cloudredissettings_getinstance_sync] +import com.google.cloud.redis.v1beta1.CloudRedisSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudRedisSettings.Builder cloudRedisSettingsBuilder = CloudRedisSettings.newBuilder(); + cloudRedisSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + cloudRedisSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); + } +} +// [END redis_v1beta1_generated_cloudredissettings_getinstance_sync] diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.java new file mode 100644 index 0000000000..3721e3591d --- /dev/null +++ b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/stub/cloudredisstubsettings/getinstance/SyncGetInstance.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.redis.v1beta1.stub.samples; + +// [START redis_v1beta1_generated_cloudredisstubsettings_getinstance_sync] +import com.google.cloud.redis.v1beta1.stub.CloudRedisStubSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + CloudRedisStubSettings.Builder cloudRedisSettingsBuilder = CloudRedisStubSettings.newBuilder(); + cloudRedisSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + cloudRedisSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build(); + } +} +// [END redis_v1beta1_generated_cloudredisstubsettings_getinstance_sync] diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisClient.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisClient.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClient.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisClientTest.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/CloudRedisSettings.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/CloudRedisSettings.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/InstanceName.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/InstanceName.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/InstanceName.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/LocationName.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/LocationName.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/LocationName.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/MockCloudRedis.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/MockCloudRedis.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedis.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/MockCloudRedisImpl.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/gapic_metadata.json b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/gapic_metadata.json similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/gapic_metadata.json rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/gapic_metadata.json diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/package-info.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/package-info.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/package-info.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStub.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/CloudRedisStubSettings.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisCallableFactory.java diff --git a/test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java b/test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java similarity index 100% rename from test/integration/goldens/redis/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java rename to test/integration/goldens/redis/src/com/google/cloud/redis/v1beta1/stub/GrpcCloudRedisStub.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/AsyncComposeObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/AsyncComposeObject.java new file mode 100644 index 0000000000..4934b8f0ff --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/AsyncComposeObject.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_composeobject_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ComposeObjectRequest; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; + +public class AsyncComposeObject { + + public static void main(String[] args) throws Exception { + asyncComposeObject(); + } + + public static void asyncComposeObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ComposeObjectRequest request = + ComposeObjectRequest.newBuilder() + .setDestination(Object.newBuilder().build()) + .addAllSourceObjects(new ArrayList()) + .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setIfGenerationMatch(-1086241088) + .setIfMetagenerationMatch(1043427781) + .setKmsKey( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.composeObjectCallable().futureCall(request); + // Do something. + Object response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_composeobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/SyncComposeObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/SyncComposeObject.java new file mode 100644 index 0000000000..8c6cdaed89 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/composeobject/SyncComposeObject.java @@ -0,0 +1,56 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_composeobject_sync] +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ComposeObjectRequest; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; + +public class SyncComposeObject { + + public static void main(String[] args) throws Exception { + syncComposeObject(); + } + + public static void syncComposeObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ComposeObjectRequest request = + ComposeObjectRequest.newBuilder() + .setDestination(Object.newBuilder().build()) + .addAllSourceObjects(new ArrayList()) + .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setIfGenerationMatch(-1086241088) + .setIfMetagenerationMatch(1043427781) + .setKmsKey( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + Object response = storageClient.composeObject(request); + } + } +} +// [END storage_v2_generated_storageclient_composeobject_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.java new file mode 100644 index 0000000000..39d638fed7 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_create_setcredentialsprovider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.StorageSettings; +import com.google.storage.v2.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. + StorageSettings storageSettings = + StorageSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + StorageClient storageClient = StorageClient.create(storageSettings); + } +} +// [END storage_v2_generated_storageclient_create_setcredentialsprovider_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java new file mode 100644 index 0000000000..5f2737eff9 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java @@ -0,0 +1,37 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_create_setendpoint_sync] +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.StorageSettings; +import com.google.storage.v2.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. + StorageSettings storageSettings = StorageSettings.newBuilder().setEndpoint(myEndpoint).build(); + StorageClient storageClient = StorageClient.create(storageSettings); + } +} +// [END storage_v2_generated_storageclient_create_setendpoint_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/AsyncCreateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/AsyncCreateBucket.java new file mode 100644 index 0000000000..ea02b71efd --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/AsyncCreateBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createbucket_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CreateBucketRequest; +import com.google.storage.v2.PredefinedBucketAcl; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncCreateBucket { + + public static void main(String[] args) throws Exception { + asyncCreateBucket(); + } + + public static void asyncCreateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBucket(Bucket.newBuilder().build()) + .setBucketId("bucketId-1603305307") + .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) + .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .build(); + ApiFuture future = storageClient.createBucketCallable().futureCall(request); + // Do something. + Bucket response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_createbucket_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket.java new file mode 100644 index 0000000000..d6169862a6 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createbucket_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CreateBucketRequest; +import com.google.storage.v2.PredefinedBucketAcl; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateBucket { + + public static void main(String[] args) throws Exception { + syncCreateBucket(); + } + + public static void syncCreateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateBucketRequest request = + CreateBucketRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setBucket(Bucket.newBuilder().build()) + .setBucketId("bucketId-1603305307") + .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) + .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .build(); + Bucket response = storageClient.createBucket(request); + } + } +} +// [END storage_v2_generated_storageclient_createbucket_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.java new file mode 100644 index 0000000000..e54fcfa9de --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createbucket_projectnamebucketstring_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateBucketProjectnameBucketString { + + public static void main(String[] args) throws Exception { + syncCreateBucketProjectnameBucketString(); + } + + public static void syncCreateBucketProjectnameBucketString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Bucket bucket = Bucket.newBuilder().build(); + String bucketId = "bucketId-1603305307"; + Bucket response = storageClient.createBucket(parent, bucket, bucketId); + } + } +} +// [END storage_v2_generated_storageclient_createbucket_projectnamebucketstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.java new file mode 100644 index 0000000000..5986132c21 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createbucket_stringbucketstring_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateBucketStringBucketString { + + public static void main(String[] args) throws Exception { + syncCreateBucketStringBucketString(); + } + + public static void syncCreateBucketStringBucketString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Bucket bucket = Bucket.newBuilder().build(); + String bucketId = "bucketId-1603305307"; + Bucket response = storageClient.createBucket(parent, bucket, bucketId); + } + } +} +// [END storage_v2_generated_storageclient_createbucket_stringbucketstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/AsyncCreateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/AsyncCreateHmacKey.java new file mode 100644 index 0000000000..4bff0acd46 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/AsyncCreateHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createhmackey_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.CreateHmacKeyRequest; +import com.google.storage.v2.CreateHmacKeyResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncCreateHmacKey { + + public static void main(String[] args) throws Exception { + asyncCreateHmacKey(); + } + + public static void asyncCreateHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateHmacKeyRequest request = + CreateHmacKeyRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.createHmacKeyCallable().futureCall(request); + // Do something. + CreateHmacKeyResponse response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_createhmackey_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey.java new file mode 100644 index 0000000000..c113cd9966 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createhmackey_sync] +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.CreateHmacKeyRequest; +import com.google.storage.v2.CreateHmacKeyResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateHmacKey { + + public static void main(String[] args) throws Exception { + syncCreateHmacKey(); + } + + public static void syncCreateHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateHmacKeyRequest request = + CreateHmacKeyRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + CreateHmacKeyResponse response = storageClient.createHmacKey(request); + } + } +} +// [END storage_v2_generated_storageclient_createhmackey_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.java new file mode 100644 index 0000000000..a11dec2391 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createhmackey_projectnamestring_sync] +import com.google.storage.v2.CreateHmacKeyResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateHmacKeyProjectnameString { + + public static void main(String[] args) throws Exception { + syncCreateHmacKeyProjectnameString(); + } + + public static void syncCreateHmacKeyProjectnameString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + String serviceAccountEmail = "serviceAccountEmail1825953988"; + CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail); + } + } +} +// [END storage_v2_generated_storageclient_createhmackey_projectnamestring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.java new file mode 100644 index 0000000000..037a2842f4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createhmackey_stringstring_sync] +import com.google.storage.v2.CreateHmacKeyResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateHmacKeyStringString { + + public static void main(String[] args) throws Exception { + syncCreateHmacKeyStringString(); + } + + public static void syncCreateHmacKeyStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + String serviceAccountEmail = "serviceAccountEmail1825953988"; + CreateHmacKeyResponse response = storageClient.createHmacKey(project, serviceAccountEmail); + } + } +} +// [END storage_v2_generated_storageclient_createhmackey_stringstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/AsyncCreateNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/AsyncCreateNotification.java new file mode 100644 index 0000000000..b98aeb1974 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/AsyncCreateNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createnotification_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CreateNotificationRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncCreateNotification { + + public static void main(String[] args) throws Exception { + asyncCreateNotification(); + } + + public static void asyncCreateNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateNotificationRequest request = + CreateNotificationRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setNotification(Notification.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.createNotificationCallable().futureCall(request); + // Do something. + Notification response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_createnotification_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification.java new file mode 100644 index 0000000000..cc9cb48b0c --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createnotification_sync] +import com.google.storage.v2.CreateNotificationRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateNotification { + + public static void main(String[] args) throws Exception { + syncCreateNotification(); + } + + public static void syncCreateNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + CreateNotificationRequest request = + CreateNotificationRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setNotification(Notification.newBuilder().build()) + .build(); + Notification response = storageClient.createNotification(request); + } + } +} +// [END storage_v2_generated_storageclient_createnotification_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.java new file mode 100644 index 0000000000..36a23dcf6b --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createnotification_projectnamenotification_sync] +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateNotificationProjectnameNotification { + + public static void main(String[] args) throws Exception { + syncCreateNotificationProjectnameNotification(); + } + + public static void syncCreateNotificationProjectnameNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + Notification notification = Notification.newBuilder().build(); + Notification response = storageClient.createNotification(parent, notification); + } + } +} +// [END storage_v2_generated_storageclient_createnotification_projectnamenotification_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.java new file mode 100644 index 0000000000..f76deb03d7 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_createnotification_stringnotification_sync] +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncCreateNotificationStringNotification { + + public static void main(String[] args) throws Exception { + syncCreateNotificationStringNotification(); + } + + public static void syncCreateNotificationStringNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + Notification notification = Notification.newBuilder().build(); + Notification response = storageClient.createNotification(parent, notification); + } + } +} +// [END storage_v2_generated_storageclient_createnotification_stringnotification_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/AsyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/AsyncDeleteBucket.java new file mode 100644 index 0000000000..05d02266e3 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/AsyncDeleteBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletebucket_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteBucketRequest; +import com.google.storage.v2.StorageClient; + +public class AsyncDeleteBucket { + + public static void main(String[] args) throws Exception { + asyncDeleteBucket(); + } + + public static void asyncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.deleteBucketCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END storage_v2_generated_storageclient_deletebucket_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket.java new file mode 100644 index 0000000000..abdcf19bd2 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletebucket_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteBucketRequest; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteBucket { + + public static void main(String[] args) throws Exception { + syncDeleteBucket(); + } + + public static void syncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteBucketRequest request = + DeleteBucketRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + storageClient.deleteBucket(request); + } + } +} +// [END storage_v2_generated_storageclient_deletebucket_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.java new file mode 100644 index 0000000000..a37ccb07f0 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletebucket_bucketname_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteBucketBucketname { + + public static void main(String[] args) throws Exception { + syncDeleteBucketBucketname(); + } + + public static void syncDeleteBucketBucketname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); + storageClient.deleteBucket(name); + } + } +} +// [END storage_v2_generated_storageclient_deletebucket_bucketname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.java new file mode 100644 index 0000000000..0cff727dbe --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletebucket_string_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteBucketString { + + public static void main(String[] args) throws Exception { + syncDeleteBucketString(); + } + + public static void syncDeleteBucketString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String name = BucketName.of("[PROJECT]", "[BUCKET]").toString(); + storageClient.deleteBucket(name); + } + } +} +// [END storage_v2_generated_storageclient_deletebucket_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/AsyncDeleteHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/AsyncDeleteHmacKey.java new file mode 100644 index 0000000000..32c206616e --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/AsyncDeleteHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletehmackey_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteHmacKeyRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncDeleteHmacKey { + + public static void main(String[] args) throws Exception { + asyncDeleteHmacKey(); + } + + public static void asyncDeleteHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteHmacKeyRequest request = + DeleteHmacKeyRequest.newBuilder() + .setAccessId("accessId-2146437729") + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.deleteHmacKeyCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END storage_v2_generated_storageclient_deletehmackey_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey.java new file mode 100644 index 0000000000..ca9d6bdd85 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletehmackey_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteHmacKeyRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteHmacKey { + + public static void main(String[] args) throws Exception { + syncDeleteHmacKey(); + } + + public static void syncDeleteHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteHmacKeyRequest request = + DeleteHmacKeyRequest.newBuilder() + .setAccessId("accessId-2146437729") + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + storageClient.deleteHmacKey(request); + } + } +} +// [END storage_v2_generated_storageclient_deletehmackey_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.java new file mode 100644 index 0000000000..d8fd8d0a67 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletehmackey_stringprojectname_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteHmacKeyStringProjectname { + + public static void main(String[] args) throws Exception { + syncDeleteHmacKeyStringProjectname(); + } + + public static void syncDeleteHmacKeyStringProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String accessId = "accessId-2146437729"; + ProjectName project = ProjectName.of("[PROJECT]"); + storageClient.deleteHmacKey(accessId, project); + } + } +} +// [END storage_v2_generated_storageclient_deletehmackey_stringprojectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.java new file mode 100644 index 0000000000..b908249211 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletehmackey_stringstring_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteHmacKeyStringString { + + public static void main(String[] args) throws Exception { + syncDeleteHmacKeyStringString(); + } + + public static void syncDeleteHmacKeyStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String accessId = "accessId-2146437729"; + String project = ProjectName.of("[PROJECT]").toString(); + storageClient.deleteHmacKey(accessId, project); + } + } +} +// [END storage_v2_generated_storageclient_deletehmackey_stringstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/AsyncDeleteNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/AsyncDeleteNotification.java new file mode 100644 index 0000000000..7efc95b1ec --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/AsyncDeleteNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletenotification_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.NotificationName; +import com.google.storage.v2.StorageClient; + +public class AsyncDeleteNotification { + + public static void main(String[] args) throws Exception { + asyncDeleteNotification(); + } + + public static void asyncDeleteNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteNotificationRequest request = + DeleteNotificationRequest.newBuilder() + .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + .build(); + ApiFuture future = storageClient.deleteNotificationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END storage_v2_generated_storageclient_deletenotification_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification.java new file mode 100644 index 0000000000..bbbc6a6165 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletenotification_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.DeleteNotificationRequest; +import com.google.storage.v2.NotificationName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteNotification { + + public static void main(String[] args) throws Exception { + syncDeleteNotification(); + } + + public static void syncDeleteNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteNotificationRequest request = + DeleteNotificationRequest.newBuilder() + .setName(NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString()) + .build(); + storageClient.deleteNotification(request); + } + } +} +// [END storage_v2_generated_storageclient_deletenotification_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.java new file mode 100644 index 0000000000..4055adfefa --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletenotification_notificationname_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.NotificationName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteNotificationNotificationname { + + public static void main(String[] args) throws Exception { + syncDeleteNotificationNotificationname(); + } + + public static void syncDeleteNotificationNotificationname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + NotificationName name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]"); + storageClient.deleteNotification(name); + } + } +} +// [END storage_v2_generated_storageclient_deletenotification_notificationname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.java new file mode 100644 index 0000000000..9551ed80e0 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deletenotification_string_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.NotificationName; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteNotificationString { + + public static void main(String[] args) throws Exception { + syncDeleteNotificationString(); + } + + public static void syncDeleteNotificationString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String name = NotificationName.of("[PROJECT]", "[BUCKET]", "[NOTIFICATION]").toString(); + storageClient.deleteNotification(name); + } + } +} +// [END storage_v2_generated_storageclient_deletenotification_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/AsyncDeleteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/AsyncDeleteObject.java new file mode 100644 index 0000000000..dd3d88b048 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/AsyncDeleteObject.java @@ -0,0 +1,56 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deleteobject_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.Empty; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteObjectRequest; +import com.google.storage.v2.StorageClient; + +public class AsyncDeleteObject { + + public static void main(String[] args) throws Exception { + asyncDeleteObject(); + } + + public static void asyncDeleteObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteObjectRequest request = + DeleteObjectRequest.newBuilder() + .setBucket("bucket-1378203158") + .setObject("object-1023368385") + .setUploadId("uploadId1563990780") + .setGeneration(305703192) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.deleteObjectCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END storage_v2_generated_storageclient_deleteobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject.java new file mode 100644 index 0000000000..e8c6168707 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject.java @@ -0,0 +1,53 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deleteobject_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.DeleteObjectRequest; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteObject { + + public static void main(String[] args) throws Exception { + syncDeleteObject(); + } + + public static void syncDeleteObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + DeleteObjectRequest request = + DeleteObjectRequest.newBuilder() + .setBucket("bucket-1378203158") + .setObject("object-1023368385") + .setUploadId("uploadId1563990780") + .setGeneration(305703192) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + storageClient.deleteObject(request); + } + } +} +// [END storage_v2_generated_storageclient_deleteobject_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.java new file mode 100644 index 0000000000..2e5fb4844a --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deleteobject_stringstring_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteObjectStringString { + + public static void main(String[] args) throws Exception { + syncDeleteObjectStringString(); + } + + public static void syncDeleteObjectStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String bucket = "bucket-1378203158"; + String object = "object-1023368385"; + storageClient.deleteObject(bucket, object); + } + } +} +// [END storage_v2_generated_storageclient_deleteobject_stringstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.java new file mode 100644 index 0000000000..fef1b74707 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_deleteobject_stringstringlong_sync] +import com.google.protobuf.Empty; +import com.google.storage.v2.StorageClient; + +public class SyncDeleteObjectStringStringLong { + + public static void main(String[] args) throws Exception { + syncDeleteObjectStringStringLong(); + } + + public static void syncDeleteObjectStringStringLong() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String bucket = "bucket-1378203158"; + String object = "object-1023368385"; + long generation = 305703192; + storageClient.deleteObject(bucket, object, generation); + } + } +} +// [END storage_v2_generated_storageclient_deleteobject_stringstringlong_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/AsyncGetBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/AsyncGetBucket.java new file mode 100644 index 0000000000..0c98dbf933 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/AsyncGetBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getbucket_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetBucketRequest; +import com.google.storage.v2.StorageClient; + +public class AsyncGetBucket { + + public static void main(String[] args) throws Exception { + asyncGetBucket(); + } + + public static void asyncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setReadMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = storageClient.getBucketCallable().futureCall(request); + // Do something. + Bucket response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_getbucket_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket.java new file mode 100644 index 0000000000..b137e5f52e --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getbucket_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetBucketRequest; +import com.google.storage.v2.StorageClient; + +public class SyncGetBucket { + + public static void main(String[] args) throws Exception { + syncGetBucket(); + } + + public static void syncGetBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetBucketRequest request = + GetBucketRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setReadMask(FieldMask.newBuilder().build()) + .build(); + Bucket response = storageClient.getBucket(request); + } + } +} +// [END storage_v2_generated_storageclient_getbucket_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.java new file mode 100644 index 0000000000..c71a2aa933 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getbucket_bucketname_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncGetBucketBucketname { + + public static void main(String[] args) throws Exception { + syncGetBucketBucketname(); + } + + public static void syncGetBucketBucketname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); + Bucket response = storageClient.getBucket(name); + } + } +} +// [END storage_v2_generated_storageclient_getbucket_bucketname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.java new file mode 100644 index 0000000000..0dbf1fdc6a --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getbucket_string_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncGetBucketString { + + public static void main(String[] args) throws Exception { + syncGetBucketString(); + } + + public static void syncGetBucketString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String name = BucketName.of("[PROJECT]", "[BUCKET]").toString(); + Bucket response = storageClient.getBucket(name); + } + } +} +// [END storage_v2_generated_storageclient_getbucket_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/AsyncGetHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/AsyncGetHmacKey.java new file mode 100644 index 0000000000..6c1de14778 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/AsyncGetHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_gethmackey_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetHmacKeyRequest; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncGetHmacKey { + + public static void main(String[] args) throws Exception { + asyncGetHmacKey(); + } + + public static void asyncGetHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetHmacKeyRequest request = + GetHmacKeyRequest.newBuilder() + .setAccessId("accessId-2146437729") + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.getHmacKeyCallable().futureCall(request); + // Do something. + HmacKeyMetadata response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_gethmackey_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey.java new file mode 100644 index 0000000000..eb2822d18c --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_gethmackey_sync] +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetHmacKeyRequest; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncGetHmacKey { + + public static void main(String[] args) throws Exception { + syncGetHmacKey(); + } + + public static void syncGetHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetHmacKeyRequest request = + GetHmacKeyRequest.newBuilder() + .setAccessId("accessId-2146437729") + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + HmacKeyMetadata response = storageClient.getHmacKey(request); + } + } +} +// [END storage_v2_generated_storageclient_gethmackey_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.java new file mode 100644 index 0000000000..96d6a9cbdf --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_gethmackey_stringprojectname_sync] +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncGetHmacKeyStringProjectname { + + public static void main(String[] args) throws Exception { + syncGetHmacKeyStringProjectname(); + } + + public static void syncGetHmacKeyStringProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String accessId = "accessId-2146437729"; + ProjectName project = ProjectName.of("[PROJECT]"); + HmacKeyMetadata response = storageClient.getHmacKey(accessId, project); + } + } +} +// [END storage_v2_generated_storageclient_gethmackey_stringprojectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.java new file mode 100644 index 0000000000..f67a737176 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_gethmackey_stringstring_sync] +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncGetHmacKeyStringString { + + public static void main(String[] args) throws Exception { + syncGetHmacKeyStringString(); + } + + public static void syncGetHmacKeyStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String accessId = "accessId-2146437729"; + String project = ProjectName.of("[PROJECT]").toString(); + HmacKeyMetadata response = storageClient.getHmacKey(accessId, project); + } + } +} +// [END storage_v2_generated_storageclient_gethmackey_stringstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/AsyncGetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/AsyncGetIamPolicy.java new file mode 100644 index 0000000000..5cf6cd70b7 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/AsyncGetIamPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class AsyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncGetIamPolicy(); + } + + public static void asyncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + ApiFuture future = storageClient.getIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_getiampolicy_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy.java new file mode 100644 index 0000000000..157160a4d3 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getiampolicy_sync] +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncGetIamPolicy { + + public static void main(String[] args) throws Exception { + syncGetIamPolicy(); + } + + public static void syncGetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + Policy response = storageClient.getIamPolicy(request); + } + } +} +// [END storage_v2_generated_storageclient_getiampolicy_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.java new file mode 100644 index 0000000000..9d7f2c0ef4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getiampolicy_resourcename_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncGetIamPolicyResourcename { + + public static void main(String[] args) throws Exception { + syncGetIamPolicyResourcename(); + } + + public static void syncGetIamPolicyResourcename() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ResourceName resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + Policy response = storageClient.getIamPolicy(resource); + } + } +} +// [END storage_v2_generated_storageclient_getiampolicy_resourcename_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.java new file mode 100644 index 0000000000..f31117d1c1 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getiampolicy_string_sync] +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncGetIamPolicyString { + + public static void main(String[] args) throws Exception { + syncGetIamPolicyString(); + } + + public static void syncGetIamPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + Policy response = storageClient.getIamPolicy(resource); + } + } +} +// [END storage_v2_generated_storageclient_getiampolicy_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/AsyncGetNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/AsyncGetNotification.java new file mode 100644 index 0000000000..b95fbda727 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/AsyncGetNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getnotification_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.GetNotificationRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.StorageClient; + +public class AsyncGetNotification { + + public static void main(String[] args) throws Exception { + asyncGetNotification(); + } + + public static void asyncGetNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetNotificationRequest request = + GetNotificationRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .build(); + ApiFuture future = storageClient.getNotificationCallable().futureCall(request); + // Do something. + Notification response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_getnotification_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification.java new file mode 100644 index 0000000000..43f6015982 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getnotification_sync] +import com.google.storage.v2.BucketName; +import com.google.storage.v2.GetNotificationRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.StorageClient; + +public class SyncGetNotification { + + public static void main(String[] args) throws Exception { + syncGetNotification(); + } + + public static void syncGetNotification() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetNotificationRequest request = + GetNotificationRequest.newBuilder() + .setName(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .build(); + Notification response = storageClient.getNotification(request); + } + } +} +// [END storage_v2_generated_storageclient_getnotification_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.java new file mode 100644 index 0000000000..e70b2c9779 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getnotification_bucketname_sync] +import com.google.storage.v2.BucketName; +import com.google.storage.v2.Notification; +import com.google.storage.v2.StorageClient; + +public class SyncGetNotificationBucketname { + + public static void main(String[] args) throws Exception { + syncGetNotificationBucketname(); + } + + public static void syncGetNotificationBucketname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + BucketName name = BucketName.of("[PROJECT]", "[BUCKET]"); + Notification response = storageClient.getNotification(name); + } + } +} +// [END storage_v2_generated_storageclient_getnotification_bucketname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.java new file mode 100644 index 0000000000..36660dcea3 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getnotification_string_sync] +import com.google.storage.v2.BucketName; +import com.google.storage.v2.Notification; +import com.google.storage.v2.StorageClient; + +public class SyncGetNotificationString { + + public static void main(String[] args) throws Exception { + syncGetNotificationString(); + } + + public static void syncGetNotificationString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String name = BucketName.of("[PROJECT]", "[BUCKET]").toString(); + Notification response = storageClient.getNotification(name); + } + } +} +// [END storage_v2_generated_storageclient_getnotification_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/AsyncGetObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/AsyncGetObject.java new file mode 100644 index 0000000000..fc76193bbf --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/AsyncGetObject.java @@ -0,0 +1,57 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getobject_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetObjectRequest; +import com.google.storage.v2.Object; +import com.google.storage.v2.StorageClient; + +public class AsyncGetObject { + + public static void main(String[] args) throws Exception { + asyncGetObject(); + } + + public static void asyncGetObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetObjectRequest request = + GetObjectRequest.newBuilder() + .setBucket("bucket-1378203158") + .setObject("object-1023368385") + .setGeneration(305703192) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setReadMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = storageClient.getObjectCallable().futureCall(request); + // Do something. + Object response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_getobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject.java new file mode 100644 index 0000000000..67d11d18c4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject.java @@ -0,0 +1,54 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getobject_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetObjectRequest; +import com.google.storage.v2.Object; +import com.google.storage.v2.StorageClient; + +public class SyncGetObject { + + public static void main(String[] args) throws Exception { + syncGetObject(); + } + + public static void syncGetObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetObjectRequest request = + GetObjectRequest.newBuilder() + .setBucket("bucket-1378203158") + .setObject("object-1023368385") + .setGeneration(305703192) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setReadMask(FieldMask.newBuilder().build()) + .build(); + Object response = storageClient.getObject(request); + } + } +} +// [END storage_v2_generated_storageclient_getobject_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.java new file mode 100644 index 0000000000..3abb96277d --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getobject_stringstring_sync] +import com.google.storage.v2.Object; +import com.google.storage.v2.StorageClient; + +public class SyncGetObjectStringString { + + public static void main(String[] args) throws Exception { + syncGetObjectStringString(); + } + + public static void syncGetObjectStringString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String bucket = "bucket-1378203158"; + String object = "object-1023368385"; + Object response = storageClient.getObject(bucket, object); + } + } +} +// [END storage_v2_generated_storageclient_getobject_stringstring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.java new file mode 100644 index 0000000000..fed50b246c --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getobject_stringstringlong_sync] +import com.google.storage.v2.Object; +import com.google.storage.v2.StorageClient; + +public class SyncGetObjectStringStringLong { + + public static void main(String[] args) throws Exception { + syncGetObjectStringStringLong(); + } + + public static void syncGetObjectStringStringLong() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String bucket = "bucket-1378203158"; + String object = "object-1023368385"; + long generation = 305703192; + Object response = storageClient.getObject(bucket, object, generation); + } + } +} +// [END storage_v2_generated_storageclient_getobject_stringstringlong_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/AsyncGetServiceAccount.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/AsyncGetServiceAccount.java new file mode 100644 index 0000000000..b681e02203 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/AsyncGetServiceAccount.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getserviceaccount_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetServiceAccountRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.ServiceAccount; +import com.google.storage.v2.StorageClient; + +public class AsyncGetServiceAccount { + + public static void main(String[] args) throws Exception { + asyncGetServiceAccount(); + } + + public static void asyncGetServiceAccount() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetServiceAccountRequest request = + GetServiceAccountRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.getServiceAccountCallable().futureCall(request); + // Do something. + ServiceAccount response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_getserviceaccount_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount.java new file mode 100644 index 0000000000..952c479994 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getserviceaccount_sync] +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.GetServiceAccountRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.ServiceAccount; +import com.google.storage.v2.StorageClient; + +public class SyncGetServiceAccount { + + public static void main(String[] args) throws Exception { + syncGetServiceAccount(); + } + + public static void syncGetServiceAccount() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + GetServiceAccountRequest request = + GetServiceAccountRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ServiceAccount response = storageClient.getServiceAccount(request); + } + } +} +// [END storage_v2_generated_storageclient_getserviceaccount_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.java new file mode 100644 index 0000000000..654ecd32e5 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getserviceaccount_projectname_sync] +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.ServiceAccount; +import com.google.storage.v2.StorageClient; + +public class SyncGetServiceAccountProjectname { + + public static void main(String[] args) throws Exception { + syncGetServiceAccountProjectname(); + } + + public static void syncGetServiceAccountProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + ServiceAccount response = storageClient.getServiceAccount(project); + } + } +} +// [END storage_v2_generated_storageclient_getserviceaccount_projectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.java new file mode 100644 index 0000000000..e6709b3e83 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_getserviceaccount_string_sync] +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.ServiceAccount; +import com.google.storage.v2.StorageClient; + +public class SyncGetServiceAccountString { + + public static void main(String[] args) throws Exception { + syncGetServiceAccountString(); + } + + public static void syncGetServiceAccountString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + ServiceAccount response = storageClient.getServiceAccount(project); + } + } +} +// [END storage_v2_generated_storageclient_getserviceaccount_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets.java new file mode 100644 index 0000000000..4c3f916168 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets.java @@ -0,0 +1,55 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listbuckets_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListBucketsRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListBuckets { + + public static void main(String[] args) throws Exception { + asyncListBuckets(); + } + + public static void asyncListBuckets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setPrefix("prefix-980110702") + .setReadMask(FieldMask.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.listBucketsPagedCallable().futureCall(request); + // Do something. + for (Bucket element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listbuckets_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java new file mode 100644 index 0000000000..cfbea5f06d --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java @@ -0,0 +1,63 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listbuckets_paged_async] +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListBucketsRequest; +import com.google.storage.v2.ListBucketsResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListBucketsPaged { + + public static void main(String[] args) throws Exception { + asyncListBucketsPaged(); + } + + public static void asyncListBucketsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setPrefix("prefix-980110702") + .setReadMask(FieldMask.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + while (true) { + ListBucketsResponse response = storageClient.listBucketsCallable().call(request); + for (Bucket element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storage_v2_generated_storageclient_listbuckets_paged_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets.java new file mode 100644 index 0000000000..4a0c475259 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listbuckets_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListBucketsRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListBuckets { + + public static void main(String[] args) throws Exception { + syncListBuckets(); + } + + public static void syncListBuckets() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListBucketsRequest request = + ListBucketsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setPrefix("prefix-980110702") + .setReadMask(FieldMask.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + for (Bucket element : storageClient.listBuckets(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listbuckets_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.java new file mode 100644 index 0000000000..192694085f --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listbuckets_projectname_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListBucketsProjectname { + + public static void main(String[] args) throws Exception { + syncListBucketsProjectname(); + } + + public static void syncListBucketsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Bucket element : storageClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listbuckets_projectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.java new file mode 100644 index 0000000000..7a3294a5af --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listbuckets_string_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListBucketsString { + + public static void main(String[] args) throws Exception { + syncListBucketsString(); + } + + public static void syncListBucketsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Bucket element : storageClient.listBuckets(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listbuckets_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys.java new file mode 100644 index 0000000000..e0885dc7d4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys.java @@ -0,0 +1,55 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listhmackeys_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ListHmacKeysRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListHmacKeys { + + public static void main(String[] args) throws Exception { + asyncListHmacKeys(); + } + + public static void asyncListHmacKeys() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListHmacKeysRequest request = + ListHmacKeysRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setShowDeletedKeys(true) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.listHmacKeysPagedCallable().futureCall(request); + // Do something. + for (HmacKeyMetadata element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listhmackeys_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java new file mode 100644 index 0000000000..18979b0fb2 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java @@ -0,0 +1,62 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listhmackeys_paged_async] +import com.google.common.base.Strings; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ListHmacKeysRequest; +import com.google.storage.v2.ListHmacKeysResponse; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListHmacKeysPaged { + + public static void main(String[] args) throws Exception { + asyncListHmacKeysPaged(); + } + + public static void asyncListHmacKeysPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListHmacKeysRequest request = + ListHmacKeysRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setShowDeletedKeys(true) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + while (true) { + ListHmacKeysResponse response = storageClient.listHmacKeysCallable().call(request); + for (HmacKeyMetadata element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storage_v2_generated_storageclient_listhmackeys_paged_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys.java new file mode 100644 index 0000000000..d60762dccc --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listhmackeys_sync] +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ListHmacKeysRequest; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListHmacKeys { + + public static void main(String[] args) throws Exception { + syncListHmacKeys(); + } + + public static void syncListHmacKeys() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListHmacKeysRequest request = + ListHmacKeysRequest.newBuilder() + .setProject(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setServiceAccountEmail("serviceAccountEmail1825953988") + .setShowDeletedKeys(true) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + for (HmacKeyMetadata element : storageClient.listHmacKeys(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listhmackeys_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.java new file mode 100644 index 0000000000..cc30567b7a --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listhmackeys_projectname_sync] +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListHmacKeysProjectname { + + public static void main(String[] args) throws Exception { + syncListHmacKeysProjectname(); + } + + public static void syncListHmacKeysProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName project = ProjectName.of("[PROJECT]"); + for (HmacKeyMetadata element : storageClient.listHmacKeys(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listhmackeys_projectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.java new file mode 100644 index 0000000000..a8d155e052 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listhmackeys_string_sync] +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListHmacKeysString { + + public static void main(String[] args) throws Exception { + syncListHmacKeysString(); + } + + public static void syncListHmacKeysString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String project = ProjectName.of("[PROJECT]").toString(); + for (HmacKeyMetadata element : storageClient.listHmacKeys(project).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listhmackeys_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications.java new file mode 100644 index 0000000000..ed6a760e87 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listnotifications_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.ListNotificationsRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListNotifications { + + public static void main(String[] args) throws Exception { + asyncListNotifications(); + } + + public static void asyncListNotifications() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListNotificationsRequest request = + ListNotificationsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + storageClient.listNotificationsPagedCallable().futureCall(request); + // Do something. + for (Notification element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listnotifications_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.java new file mode 100644 index 0000000000..ac26b85ab2 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listnotifications_paged_async] +import com.google.common.base.Strings; +import com.google.storage.v2.ListNotificationsRequest; +import com.google.storage.v2.ListNotificationsResponse; +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListNotificationsPaged { + + public static void main(String[] args) throws Exception { + asyncListNotificationsPaged(); + } + + public static void asyncListNotificationsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListNotificationsRequest request = + ListNotificationsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListNotificationsResponse response = + storageClient.listNotificationsCallable().call(request); + for (Notification element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storage_v2_generated_storageclient_listnotifications_paged_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications.java new file mode 100644 index 0000000000..62227c5974 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listnotifications_sync] +import com.google.storage.v2.ListNotificationsRequest; +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListNotifications { + + public static void main(String[] args) throws Exception { + syncListNotifications(); + } + + public static void syncListNotifications() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListNotificationsRequest request = + ListNotificationsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Notification element : storageClient.listNotifications(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listnotifications_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.java new file mode 100644 index 0000000000..62153ce077 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listnotifications_projectname_sync] +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListNotificationsProjectname { + + public static void main(String[] args) throws Exception { + syncListNotificationsProjectname(); + } + + public static void syncListNotificationsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Notification element : storageClient.listNotifications(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listnotifications_projectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.java new file mode 100644 index 0000000000..7dd05643fb --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listnotifications_string_sync] +import com.google.storage.v2.Notification; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListNotificationsString { + + public static void main(String[] args) throws Exception { + syncListNotificationsString(); + } + + public static void syncListNotificationsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Notification element : storageClient.listNotifications(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listnotifications_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects.java new file mode 100644 index 0000000000..40fcf11c41 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listobjects_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListObjectsRequest; +import com.google.storage.v2.Object; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListObjects { + + public static void main(String[] args) throws Exception { + asyncListObjects(); + } + + public static void asyncListObjects() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListObjectsRequest request = + ListObjectsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setDelimiter("delimiter-250518009") + .setIncludeTrailingDelimiter(true) + .setPrefix("prefix-980110702") + .setVersions(true) + .setReadMask(FieldMask.newBuilder().build()) + .setLexicographicStart("lexicographicStart-2093413008") + .setLexicographicEnd("lexicographicEnd1646968169") + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.listObjectsPagedCallable().futureCall(request); + // Do something. + for (Object element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listobjects_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java new file mode 100644 index 0000000000..02fdd06d3f --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java @@ -0,0 +1,68 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listobjects_paged_async] +import com.google.common.base.Strings; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListObjectsRequest; +import com.google.storage.v2.ListObjectsResponse; +import com.google.storage.v2.Object; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class AsyncListObjectsPaged { + + public static void main(String[] args) throws Exception { + asyncListObjectsPaged(); + } + + public static void asyncListObjectsPaged() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListObjectsRequest request = + ListObjectsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setDelimiter("delimiter-250518009") + .setIncludeTrailingDelimiter(true) + .setPrefix("prefix-980110702") + .setVersions(true) + .setReadMask(FieldMask.newBuilder().build()) + .setLexicographicStart("lexicographicStart-2093413008") + .setLexicographicEnd("lexicographicEnd1646968169") + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + while (true) { + ListObjectsResponse response = storageClient.listObjectsCallable().call(request); + for (Object element : response.getResponsesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END storage_v2_generated_storageclient_listobjects_paged_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects.java new file mode 100644 index 0000000000..a4b7c2cef0 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects.java @@ -0,0 +1,57 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listobjects_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ListObjectsRequest; +import com.google.storage.v2.Object; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListObjects { + + public static void main(String[] args) throws Exception { + syncListObjects(); + } + + public static void syncListObjects() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ListObjectsRequest request = + ListObjectsRequest.newBuilder() + .setParent(ProjectName.of("[PROJECT]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setDelimiter("delimiter-250518009") + .setIncludeTrailingDelimiter(true) + .setPrefix("prefix-980110702") + .setVersions(true) + .setReadMask(FieldMask.newBuilder().build()) + .setLexicographicStart("lexicographicStart-2093413008") + .setLexicographicEnd("lexicographicEnd1646968169") + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + for (Object element : storageClient.listObjects(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listobjects_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.java new file mode 100644 index 0000000000..9ee05a71bf --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listobjects_projectname_sync] +import com.google.storage.v2.Object; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListObjectsProjectname { + + public static void main(String[] args) throws Exception { + syncListObjectsProjectname(); + } + + public static void syncListObjectsProjectname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ProjectName parent = ProjectName.of("[PROJECT]"); + for (Object element : storageClient.listObjects(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listobjects_projectname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.java new file mode 100644 index 0000000000..af5e56af56 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_listobjects_string_sync] +import com.google.storage.v2.Object; +import com.google.storage.v2.ProjectName; +import com.google.storage.v2.StorageClient; + +public class SyncListObjectsString { + + public static void main(String[] args) throws Exception { + syncListObjectsString(); + } + + public static void syncListObjectsString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String parent = ProjectName.of("[PROJECT]").toString(); + for (Object element : storageClient.listObjects(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END storage_v2_generated_storageclient_listobjects_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.java new file mode 100644 index 0000000000..673dff68e4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/AsyncLockBucketRetentionPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_lockbucketretentionpolicy_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.LockBucketRetentionPolicyRequest; +import com.google.storage.v2.StorageClient; + +public class AsyncLockBucketRetentionPolicy { + + public static void main(String[] args) throws Exception { + asyncLockBucketRetentionPolicy(); + } + + public static void asyncLockBucketRetentionPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + LockBucketRetentionPolicyRequest request = + LockBucketRetentionPolicyRequest.newBuilder() + .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.lockBucketRetentionPolicyCallable().futureCall(request); + // Do something. + Bucket response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_lockbucketretentionpolicy_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.java new file mode 100644 index 0000000000..beccf20906 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_lockbucketretentionpolicy_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.LockBucketRetentionPolicyRequest; +import com.google.storage.v2.StorageClient; + +public class SyncLockBucketRetentionPolicy { + + public static void main(String[] args) throws Exception { + syncLockBucketRetentionPolicy(); + } + + public static void syncLockBucketRetentionPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + LockBucketRetentionPolicyRequest request = + LockBucketRetentionPolicyRequest.newBuilder() + .setBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setIfMetagenerationMatch(1043427781) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + Bucket response = storageClient.lockBucketRetentionPolicy(request); + } + } +} +// [END storage_v2_generated_storageclient_lockbucketretentionpolicy_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.java new file mode 100644 index 0000000000..12d98648a4 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_lockbucketretentionpolicy_bucketname_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncLockBucketRetentionPolicyBucketname { + + public static void main(String[] args) throws Exception { + syncLockBucketRetentionPolicyBucketname(); + } + + public static void syncLockBucketRetentionPolicyBucketname() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + BucketName bucket = BucketName.of("[PROJECT]", "[BUCKET]"); + Bucket response = storageClient.lockBucketRetentionPolicy(bucket); + } + } +} +// [END storage_v2_generated_storageclient_lockbucketretentionpolicy_bucketname_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.java new file mode 100644 index 0000000000..c41fb963b9 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_lockbucketretentionpolicy_string_sync] +import com.google.storage.v2.Bucket; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.StorageClient; + +public class SyncLockBucketRetentionPolicyString { + + public static void main(String[] args) throws Exception { + syncLockBucketRetentionPolicyString(); + } + + public static void syncLockBucketRetentionPolicyString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String bucket = BucketName.of("[PROJECT]", "[BUCKET]").toString(); + Bucket response = storageClient.lockBucketRetentionPolicy(bucket); + } + } +} +// [END storage_v2_generated_storageclient_lockbucketretentionpolicy_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/AsyncQueryWriteStatus.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/AsyncQueryWriteStatus.java new file mode 100644 index 0000000000..6bde0ab004 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/AsyncQueryWriteStatus.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_querywritestatus_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.QueryWriteStatusRequest; +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.StorageClient; + +public class AsyncQueryWriteStatus { + + public static void main(String[] args) throws Exception { + asyncQueryWriteStatus(); + } + + public static void asyncQueryWriteStatus() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + QueryWriteStatusRequest request = + QueryWriteStatusRequest.newBuilder() + .setUploadId("uploadId1563990780") + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.queryWriteStatusCallable().futureCall(request); + // Do something. + QueryWriteStatusResponse response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_querywritestatus_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus.java new file mode 100644 index 0000000000..6c64cf890d --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_querywritestatus_sync] +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.QueryWriteStatusRequest; +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.StorageClient; + +public class SyncQueryWriteStatus { + + public static void main(String[] args) throws Exception { + syncQueryWriteStatus(); + } + + public static void syncQueryWriteStatus() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + QueryWriteStatusRequest request = + QueryWriteStatusRequest.newBuilder() + .setUploadId("uploadId1563990780") + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + QueryWriteStatusResponse response = storageClient.queryWriteStatus(request); + } + } +} +// [END storage_v2_generated_storageclient_querywritestatus_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.java new file mode 100644 index 0000000000..1773b3d8dc --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_querywritestatus_string_sync] +import com.google.storage.v2.QueryWriteStatusResponse; +import com.google.storage.v2.StorageClient; + +public class SyncQueryWriteStatusString { + + public static void main(String[] args) throws Exception { + syncQueryWriteStatusString(); + } + + public static void syncQueryWriteStatusString() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String uploadId = "uploadId1563990780"; + QueryWriteStatusResponse response = storageClient.queryWriteStatus(uploadId); + } + } +} +// [END storage_v2_generated_storageclient_querywritestatus_string_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/readobject/AsyncReadObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/readobject/AsyncReadObject.java new file mode 100644 index 0000000000..19e23b4b56 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/readobject/AsyncReadObject.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_readobject_async] +import com.google.api.gax.rpc.ServerStream; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ReadObjectRequest; +import com.google.storage.v2.ReadObjectResponse; +import com.google.storage.v2.StorageClient; + +public class AsyncReadObject { + + public static void main(String[] args) throws Exception { + asyncReadObject(); + } + + public static void asyncReadObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ReadObjectRequest request = + ReadObjectRequest.newBuilder() + .setBucket("bucket-1378203158") + .setObject("object-1023368385") + .setGeneration(305703192) + .setReadOffset(-715377828) + .setReadLimit(-164298798) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setReadMask(FieldMask.newBuilder().build()) + .build(); + ServerStream stream = storageClient.readObjectCallable().call(request); + for (ReadObjectResponse response : stream) { + // Do something when a response is received. + } + } + } +} +// [END storage_v2_generated_storageclient_readobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/AsyncRewriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/AsyncRewriteObject.java new file mode 100644 index 0000000000..1604bfc412 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/AsyncRewriteObject.java @@ -0,0 +1,76 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_rewriteobject_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.ByteString; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.RewriteObjectRequest; +import com.google.storage.v2.RewriteResponse; +import com.google.storage.v2.StorageClient; + +public class AsyncRewriteObject { + + public static void main(String[] args) throws Exception { + asyncRewriteObject(); + } + + public static void asyncRewriteObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + RewriteObjectRequest request = + RewriteObjectRequest.newBuilder() + .setDestinationName("destinationName-1762755655") + .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setDestinationKmsKey( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setDestination(Object.newBuilder().build()) + .setSourceBucket("sourceBucket841604581") + .setSourceObject("sourceObject1196439354") + .setSourceGeneration(1232209852) + .setRewriteToken("rewriteToken80654285") + .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setIfSourceGenerationMatch(-1427877280) + .setIfSourceGenerationNotMatch(1575612532) + .setIfSourceMetagenerationMatch(1143319909) + .setIfSourceMetagenerationNotMatch(1900822777) + .setMaxBytesRewrittenPerCall(1178170730) + .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548") + .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) + .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.rewriteObjectCallable().futureCall(request); + // Do something. + RewriteResponse response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_rewriteobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/SyncRewriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/SyncRewriteObject.java new file mode 100644 index 0000000000..3e7b7daa21 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/rewriteobject/SyncRewriteObject.java @@ -0,0 +1,73 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_rewriteobject_sync] +import com.google.protobuf.ByteString; +import com.google.storage.v2.BucketName; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.RewriteObjectRequest; +import com.google.storage.v2.RewriteResponse; +import com.google.storage.v2.StorageClient; + +public class SyncRewriteObject { + + public static void main(String[] args) throws Exception { + syncRewriteObject(); + } + + public static void syncRewriteObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + RewriteObjectRequest request = + RewriteObjectRequest.newBuilder() + .setDestinationName("destinationName-1762755655") + .setDestinationBucket(BucketName.of("[PROJECT]", "[BUCKET]").toString()) + .setDestinationKmsKey( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setDestination(Object.newBuilder().build()) + .setSourceBucket("sourceBucket841604581") + .setSourceObject("sourceObject1196439354") + .setSourceGeneration(1232209852) + .setRewriteToken("rewriteToken80654285") + .setDestinationPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setIfSourceGenerationMatch(-1427877280) + .setIfSourceGenerationNotMatch(1575612532) + .setIfSourceMetagenerationMatch(1143319909) + .setIfSourceMetagenerationNotMatch(1900822777) + .setMaxBytesRewrittenPerCall(1178170730) + .setCopySourceEncryptionAlgorithm("copySourceEncryptionAlgorithm-1524952548") + .setCopySourceEncryptionKeyBytes(ByteString.EMPTY) + .setCopySourceEncryptionKeySha256Bytes(ByteString.EMPTY) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + RewriteResponse response = storageClient.rewriteObject(request); + } + } +} +// [END storage_v2_generated_storageclient_rewriteobject_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/AsyncSetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/AsyncSetIamPolicy.java new file mode 100644 index 0000000000..1eb491322a --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/AsyncSetIamPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_setiampolicy_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class AsyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + asyncSetIamPolicy(); + } + + public static void asyncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + ApiFuture future = storageClient.setIamPolicyCallable().futureCall(request); + // Do something. + Policy response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_setiampolicy_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy.java new file mode 100644 index 0000000000..33d33e821c --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_setiampolicy_sync] +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncSetIamPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicy(); + } + + public static void syncSetIamPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .setPolicy(Policy.newBuilder().build()) + .build(); + Policy response = storageClient.setIamPolicy(request); + } + } +} +// [END storage_v2_generated_storageclient_setiampolicy_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java new file mode 100644 index 0000000000..6080756e39 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java @@ -0,0 +1,42 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_setiampolicy_resourcenamepolicy_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncSetIamPolicyResourcenamePolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicyResourcenamePolicy(); + } + + public static void syncSetIamPolicyResourcenamePolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ResourceName resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + Policy policy = Policy.newBuilder().build(); + Policy response = storageClient.setIamPolicy(resource, policy); + } + } +} +// [END storage_v2_generated_storageclient_setiampolicy_resourcenamepolicy_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.java new file mode 100644 index 0000000000..1a3e3952d6 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_setiampolicy_stringpolicy_sync] +import com.google.iam.v1.Policy; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; + +public class SyncSetIamPolicyStringPolicy { + + public static void main(String[] args) throws Exception { + syncSetIamPolicyStringPolicy(); + } + + public static void syncSetIamPolicyStringPolicy() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + Policy policy = Policy.newBuilder().build(); + Policy response = storageClient.setIamPolicy(resource, policy); + } + } +} +// [END storage_v2_generated_storageclient_setiampolicy_stringpolicy_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/AsyncStartResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/AsyncStartResumableWrite.java new file mode 100644 index 0000000000..cda98a25c3 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/AsyncStartResumableWrite.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_startresumablewrite_async] +import com.google.api.core.ApiFuture; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.StartResumableWriteRequest; +import com.google.storage.v2.StartResumableWriteResponse; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.WriteObjectSpec; + +public class AsyncStartResumableWrite { + + public static void main(String[] args) throws Exception { + asyncStartResumableWrite(); + } + + public static void asyncStartResumableWrite() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + StartResumableWriteRequest request = + StartResumableWriteRequest.newBuilder() + .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = + storageClient.startResumableWriteCallable().futureCall(request); + // Do something. + StartResumableWriteResponse response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_startresumablewrite_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/SyncStartResumableWrite.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/SyncStartResumableWrite.java new file mode 100644 index 0000000000..f42aad7ba1 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/startresumablewrite/SyncStartResumableWrite.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_startresumablewrite_sync] +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.StartResumableWriteRequest; +import com.google.storage.v2.StartResumableWriteResponse; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.WriteObjectSpec; + +public class SyncStartResumableWrite { + + public static void main(String[] args) throws Exception { + syncStartResumableWrite(); + } + + public static void syncStartResumableWrite() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + StartResumableWriteRequest request = + StartResumableWriteRequest.newBuilder() + .setWriteObjectSpec(WriteObjectSpec.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + StartResumableWriteResponse response = storageClient.startResumableWrite(request); + } + } +} +// [END storage_v2_generated_storageclient_startresumablewrite_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/AsyncTestIamPermissions.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/AsyncTestIamPermissions.java new file mode 100644 index 0000000000..35d7d6ddba --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/AsyncTestIamPermissions.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_testiampermissions_async] +import com.google.api.core.ApiFuture; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; + +public class AsyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + asyncTestIamPermissions(); + } + + public static void asyncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + ApiFuture future = + storageClient.testIamPermissionsCallable().futureCall(request); + // Do something. + TestIamPermissionsResponse response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_testiampermissions_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions.java new file mode 100644 index 0000000000..89f1c42b2f --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_testiampermissions_sync] +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; + +public class SyncTestIamPermissions { + + public static void main(String[] args) throws Exception { + syncTestIamPermissions(); + } + + public static void syncTestIamPermissions() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource( + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]") + .toString()) + .addAllPermissions(new ArrayList()) + .build(); + TestIamPermissionsResponse response = storageClient.testIamPermissions(request); + } + } +} +// [END storage_v2_generated_storageclient_testiampermissions_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.java new file mode 100644 index 0000000000..8e70be7ca6 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_testiampermissions_resourcenameliststring_sync] +import com.google.api.resourcenames.ResourceName; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncTestIamPermissionsResourcenameListstring { + + public static void main(String[] args) throws Exception { + syncTestIamPermissionsResourcenameListstring(); + } + + public static void syncTestIamPermissionsResourcenameListstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ResourceName resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]"); + List permissions = new ArrayList<>(); + TestIamPermissionsResponse response = storageClient.testIamPermissions(resource, permissions); + } + } +} +// [END storage_v2_generated_storageclient_testiampermissions_resourcenameliststring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.java new file mode 100644 index 0000000000..846349cc06 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_testiampermissions_stringliststring_sync] +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.storage.v2.CryptoKeyName; +import com.google.storage.v2.StorageClient; +import java.util.ArrayList; +import java.util.List; + +public class SyncTestIamPermissionsStringListstring { + + public static void main(String[] args) throws Exception { + syncTestIamPermissionsStringListstring(); + } + + public static void syncTestIamPermissionsStringListstring() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + String resource = + CryptoKeyName.of("[PROJECT]", "[LOCATION]", "[KEY_RING]", "[CRYPTO_KEY]").toString(); + List permissions = new ArrayList<>(); + TestIamPermissionsResponse response = storageClient.testIamPermissions(resource, permissions); + } + } +} +// [END storage_v2_generated_storageclient_testiampermissions_stringliststring_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/AsyncUpdateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/AsyncUpdateBucket.java new file mode 100644 index 0000000000..934973bfe7 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/AsyncUpdateBucket.java @@ -0,0 +1,55 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatebucket_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.PredefinedBucketAcl; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateBucketRequest; + +public class AsyncUpdateBucket { + + public static void main(String[] args) throws Exception { + asyncUpdateBucket(); + } + + public static void asyncUpdateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setBucket(Bucket.newBuilder().build()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) + .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setUpdateMask(FieldMask.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.updateBucketCallable().futureCall(request); + // Do something. + Bucket response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_updatebucket_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket.java new file mode 100644 index 0000000000..b8afbabbe8 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatebucket_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.PredefinedBucketAcl; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateBucketRequest; + +public class SyncUpdateBucket { + + public static void main(String[] args) throws Exception { + syncUpdateBucket(); + } + + public static void syncUpdateBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateBucketRequest request = + UpdateBucketRequest.newBuilder() + .setBucket(Bucket.newBuilder().build()) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setPredefinedAcl(PredefinedBucketAcl.forNumber(0)) + .setPredefinedDefaultObjectAcl(PredefinedObjectAcl.forNumber(0)) + .setUpdateMask(FieldMask.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + Bucket response = storageClient.updateBucket(request); + } + } +} +// [END storage_v2_generated_storageclient_updatebucket_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.java new file mode 100644 index 0000000000..0372766b0f --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatebucket_bucketfieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Bucket; +import com.google.storage.v2.StorageClient; + +public class SyncUpdateBucketBucketFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateBucketBucketFieldmask(); + } + + public static void syncUpdateBucketBucketFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + Bucket bucket = Bucket.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Bucket response = storageClient.updateBucket(bucket, updateMask); + } + } +} +// [END storage_v2_generated_storageclient_updatebucket_bucketfieldmask_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/AsyncUpdateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/AsyncUpdateHmacKey.java new file mode 100644 index 0000000000..d000d53b42 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/AsyncUpdateHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatehmackey_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateHmacKeyRequest; + +public class AsyncUpdateHmacKey { + + public static void main(String[] args) throws Exception { + asyncUpdateHmacKey(); + } + + public static void asyncUpdateHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateHmacKeyRequest request = + UpdateHmacKeyRequest.newBuilder() + .setHmacKey(HmacKeyMetadata.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + ApiFuture future = storageClient.updateHmacKeyCallable().futureCall(request); + // Do something. + HmacKeyMetadata response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_updatehmackey_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey.java new file mode 100644 index 0000000000..64ed3fcd93 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatehmackey_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateHmacKeyRequest; + +public class SyncUpdateHmacKey { + + public static void main(String[] args) throws Exception { + syncUpdateHmacKey(); + } + + public static void syncUpdateHmacKey() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateHmacKeyRequest request = + UpdateHmacKeyRequest.newBuilder() + .setHmacKey(HmacKeyMetadata.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + HmacKeyMetadata response = storageClient.updateHmacKey(request); + } + } +} +// [END storage_v2_generated_storageclient_updatehmackey_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.java new file mode 100644 index 0000000000..b31e510410 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updatehmackey_hmackeymetadatafieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.HmacKeyMetadata; +import com.google.storage.v2.StorageClient; + +public class SyncUpdateHmacKeyHmackeymetadataFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateHmacKeyHmackeymetadataFieldmask(); + } + + public static void syncUpdateHmacKeyHmackeymetadataFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + HmacKeyMetadata hmacKey = HmacKeyMetadata.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + HmacKeyMetadata response = storageClient.updateHmacKey(hmacKey, updateMask); + } + } +} +// [END storage_v2_generated_storageclient_updatehmackey_hmackeymetadatafieldmask_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/AsyncUpdateObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/AsyncUpdateObject.java new file mode 100644 index 0000000000..c7843492aa --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/AsyncUpdateObject.java @@ -0,0 +1,57 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updateobject_async] +import com.google.api.core.ApiFuture; +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateObjectRequest; + +public class AsyncUpdateObject { + + public static void main(String[] args) throws Exception { + asyncUpdateObject(); + } + + public static void asyncUpdateObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateObjectRequest request = + UpdateObjectRequest.newBuilder() + .setObject(Object.newBuilder().build()) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setUpdateMask(FieldMask.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + ApiFuture future = storageClient.updateObjectCallable().futureCall(request); + // Do something. + Object response = future.get(); + } + } +} +// [END storage_v2_generated_storageclient_updateobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject.java new file mode 100644 index 0000000000..c419c0997e --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject.java @@ -0,0 +1,54 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updateobject_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.Object; +import com.google.storage.v2.PredefinedObjectAcl; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.UpdateObjectRequest; + +public class SyncUpdateObject { + + public static void main(String[] args) throws Exception { + syncUpdateObject(); + } + + public static void syncUpdateObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + UpdateObjectRequest request = + UpdateObjectRequest.newBuilder() + .setObject(Object.newBuilder().build()) + .setIfGenerationMatch(-1086241088) + .setIfGenerationNotMatch(1475720404) + .setIfMetagenerationMatch(1043427781) + .setIfMetagenerationNotMatch(1025430873) + .setPredefinedAcl(PredefinedObjectAcl.forNumber(0)) + .setUpdateMask(FieldMask.newBuilder().build()) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + Object response = storageClient.updateObject(request); + } + } +} +// [END storage_v2_generated_storageclient_updateobject_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.java new file mode 100644 index 0000000000..37be7ce67e --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_updateobject_objectfieldmask_sync] +import com.google.protobuf.FieldMask; +import com.google.storage.v2.Object; +import com.google.storage.v2.StorageClient; + +public class SyncUpdateObjectObjectFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateObjectObjectFieldmask(); + } + + public static void syncUpdateObjectObjectFieldmask() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + Object object = Object.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Object response = storageClient.updateObject(object, updateMask); + } + } +} +// [END storage_v2_generated_storageclient_updateobject_objectfieldmask_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/writeobject/AsyncWriteObject.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/writeobject/AsyncWriteObject.java new file mode 100644 index 0000000000..c6c2398591 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/writeobject/AsyncWriteObject.java @@ -0,0 +1,69 @@ +/* + * 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.storage.v2.samples; + +// [START storage_v2_generated_storageclient_writeobject_async] +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.storage.v2.CommonObjectRequestParams; +import com.google.storage.v2.CommonRequestParams; +import com.google.storage.v2.ObjectChecksums; +import com.google.storage.v2.StorageClient; +import com.google.storage.v2.WriteObjectRequest; +import com.google.storage.v2.WriteObjectResponse; + +public class AsyncWriteObject { + + public static void main(String[] args) throws Exception { + asyncWriteObject(); + } + + public static void asyncWriteObject() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + try (StorageClient storageClient = StorageClient.create()) { + ApiStreamObserver responseObserver = + new ApiStreamObserver() { + @Override + public void onNext(WriteObjectResponse response) { + // Do something when a response is received. + } + + @Override + public void onError(Throwable t) { + // Add error-handling + } + + @Override + public void onCompleted() { + // Do something when complete. + } + }; + ApiStreamObserver requestObserver = + storageClient.writeObject().clientStreamingCall(responseObserver); + WriteObjectRequest request = + WriteObjectRequest.newBuilder() + .setWriteOffset(-1559543565) + .setObjectChecksums(ObjectChecksums.newBuilder().build()) + .setFinishWrite(true) + .setCommonObjectRequestParams(CommonObjectRequestParams.newBuilder().build()) + .setCommonRequestParams(CommonRequestParams.newBuilder().build()) + .build(); + requestObserver.onNext(request); + } + } +} +// [END storage_v2_generated_storageclient_writeobject_async] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.java new file mode 100644 index 0000000000..c3142e4592 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storagesettings/deletebucket/SyncDeleteBucket.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.storage.v2.samples; + +// [START storage_v2_generated_storagesettings_deletebucket_sync] +import com.google.storage.v2.StorageSettings; +import java.time.Duration; + +public class SyncDeleteBucket { + + public static void main(String[] args) throws Exception { + syncDeleteBucket(); + } + + public static void syncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StorageSettings.Builder storageSettingsBuilder = StorageSettings.newBuilder(); + storageSettingsBuilder + .deleteBucketSettings() + .setRetrySettings( + storageSettingsBuilder + .deleteBucketSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StorageSettings storageSettings = storageSettingsBuilder.build(); + } +} +// [END storage_v2_generated_storagesettings_deletebucket_sync] diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.java new file mode 100644 index 0000000000..b5a72564d3 --- /dev/null +++ b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/stub/storagestubsettings/deletebucket/SyncDeleteBucket.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.storage.v2.stub.samples; + +// [START storage_v2_generated_storagestubsettings_deletebucket_sync] +import com.google.storage.v2.stub.StorageStubSettings; +import java.time.Duration; + +public class SyncDeleteBucket { + + public static void main(String[] args) throws Exception { + syncDeleteBucket(); + } + + public static void syncDeleteBucket() throws Exception { + // This snippet has been automatically generated for illustrative purposes only. + // It may require modifications to work in your environment. + StorageStubSettings.Builder storageSettingsBuilder = StorageStubSettings.newBuilder(); + storageSettingsBuilder + .deleteBucketSettings() + .setRetrySettings( + storageSettingsBuilder + .deleteBucketSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + StorageStubSettings storageSettings = storageSettingsBuilder.build(); + } +} +// [END storage_v2_generated_storagestubsettings_deletebucket_sync] diff --git a/test/integration/goldens/storage/com/google/storage/v2/BucketName.java b/test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/BucketName.java rename to test/integration/goldens/storage/src/com/google/storage/v2/BucketName.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/CryptoKeyName.java b/test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/CryptoKeyName.java rename to test/integration/goldens/storage/src/com/google/storage/v2/CryptoKeyName.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/MockStorage.java b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/MockStorage.java rename to test/integration/goldens/storage/src/com/google/storage/v2/MockStorage.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/MockStorageImpl.java b/test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/MockStorageImpl.java rename to test/integration/goldens/storage/src/com/google/storage/v2/MockStorageImpl.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/NotificationName.java b/test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/NotificationName.java rename to test/integration/goldens/storage/src/com/google/storage/v2/NotificationName.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/ProjectName.java b/test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/ProjectName.java rename to test/integration/goldens/storage/src/com/google/storage/v2/ProjectName.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/StorageClient.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/StorageClient.java rename to test/integration/goldens/storage/src/com/google/storage/v2/StorageClient.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/StorageClientTest.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/StorageClientTest.java rename to test/integration/goldens/storage/src/com/google/storage/v2/StorageClientTest.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/StorageSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/StorageSettings.java rename to test/integration/goldens/storage/src/com/google/storage/v2/StorageSettings.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/gapic_metadata.json b/test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/gapic_metadata.json rename to test/integration/goldens/storage/src/com/google/storage/v2/gapic_metadata.json diff --git a/test/integration/goldens/storage/com/google/storage/v2/package-info.java b/test/integration/goldens/storage/src/com/google/storage/v2/package-info.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/package-info.java rename to test/integration/goldens/storage/src/com/google/storage/v2/package-info.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/stub/GrpcStorageCallableFactory.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/stub/GrpcStorageCallableFactory.java rename to test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageCallableFactory.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/stub/GrpcStorageStub.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/stub/GrpcStorageStub.java rename to test/integration/goldens/storage/src/com/google/storage/v2/stub/GrpcStorageStub.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStub.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/stub/StorageStub.java rename to test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStub.java diff --git a/test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java b/test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java similarity index 100% rename from test/integration/goldens/storage/com/google/storage/v2/stub/StorageStubSettings.java rename to test/integration/goldens/storage/src/com/google/storage/v2/stub/StorageStubSettings.java From ce46d8d445171659af27f716dbf3fab7a1dbfc89 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 5 Apr 2022 13:12:49 -0700 Subject: [PATCH 04/18] feat: sample src jar --- rules_java_gapic/java_gapic.bzl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rules_java_gapic/java_gapic.bzl b/rules_java_gapic/java_gapic.bzl index c46a47522d..a1f59ba311 100644 --- a/rules_java_gapic/java_gapic.bzl +++ b/rules_java_gapic/java_gapic.bzl @@ -21,6 +21,7 @@ def _java_gapic_postprocess_srcjar_impl(ctx): output_srcjar_name = ctx.label.name output_main = ctx.outputs.main output_test = ctx.outputs.test + output_samples = ctx.outputs.samples output_resource_name = ctx.outputs.resource_name formatter = ctx.executable.formatter @@ -58,11 +59,16 @@ def _java_gapic_postprocess_srcjar_impl(ctx): cd $WORKING_DIR/{output_dir_path}/src/test/java zip -r $WORKING_DIR/{output_srcjar_name}-tests.srcjar ./ + # Sample source files. + cd $WORKING_DIR/{output_dir_path}/samples/snippets/generated/src/main/java + zip -r $WORKING_DIR/{output_srcjar_name}-samples.srcjar ./ + cd $WORKING_DIR mv {output_srcjar_name}.srcjar {output_main} mv {output_srcjar_name}-resource-name.srcjar {output_resource_name} mv {output_srcjar_name}-tests.srcjar {output_test} + mv {output_srcjar_name}-samples.srcjar {output_samples} """.format( gapic_srcjar = gapic_srcjar.path, output_srcjar_name = output_srcjar_name, @@ -72,13 +78,14 @@ def _java_gapic_postprocess_srcjar_impl(ctx): output_main = output_main.path, output_resource_name = output_resource_name.path, output_test = output_test.path, + output_samples = output_samples.path, ) ctx.actions.run_shell( inputs = [gapic_srcjar], tools = [formatter], command = script, - outputs = [output_main, output_resource_name, output_test], + outputs = [output_main, output_resource_name, output_test, output_samples], ) _java_gapic_postprocess_srcjar = rule( @@ -94,6 +101,7 @@ _java_gapic_postprocess_srcjar = rule( "main": "%{name}.srcjar", "resource_name": "%{name}-resource-name.srcjar", "test": "%{name}-test.srcjar", + "samples": "%{name}-samples.srcjar", }, implementation = _java_gapic_postprocess_srcjar_impl, ) From 665a1d1c5b4e80977c3fe145509e22e05f5990fa Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 12 Apr 2022 17:46:03 -0700 Subject: [PATCH 05/18] feat: package tar with samples --- rules_java_gapic/java_gapic.bzl | 6 +++++- rules_java_gapic/java_gapic_pkg.bzl | 9 +++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/rules_java_gapic/java_gapic.bzl b/rules_java_gapic/java_gapic.bzl index a1f59ba311..c836a57634 100644 --- a/rules_java_gapic/java_gapic.bzl +++ b/rules_java_gapic/java_gapic.bzl @@ -37,7 +37,11 @@ def _java_gapic_postprocess_srcjar_impl(ctx): WORKING_DIR=`pwd` # Main source files. - cd {output_dir_path}/src/main/java + mkdir -p $WORKING_DIR/tmp/ + mv {output_dir_path}/src/main/java $WORKING_DIR/tmp + mkdir -p $WORKING_DIR/tmp/samples + mv $WORKING_DIR/{output_dir_path}/samples $WORKING_DIR/tmp/samples + cd $WORKING_DIR/tmp zip -r $WORKING_DIR/{output_srcjar_name}.srcjar ./ # Resource name source files. diff --git a/rules_java_gapic/java_gapic_pkg.bzl b/rules_java_gapic/java_gapic_pkg.bzl index 97438b1f3c..690954fd92 100644 --- a/rules_java_gapic/java_gapic_pkg.bzl +++ b/rules_java_gapic/java_gapic_pkg.bzl @@ -75,6 +75,11 @@ def _gapic_pkg_tar_impl(ctx): tar -xzpf $dep -C {package_dir_path} done cd {package_dir_path}/{tar_cd_suffix} + + if [ -d "{package_dir}/samples" ]; then + mv {package_dir}/samples {tar_prefix} + fi + tar -zchpf {tar_prefix}/{package_dir}.tar.gz {tar_prefix}/* cd - mv {package_dir_path}/{package_dir}.tar.gz {pkg} @@ -256,6 +261,10 @@ def _java_gapic_srcs_pkg_impl(ctx): # Remove empty files. If there are no resource names, one such file might have # been created. See java_gapic.bzl. rm $(find {package_dir_path}/src/main/java -size 0) + + if [ -d {package_dir_path}/src/main/java/samples ]; then + mv {package_dir_path}/src/main/java/samples {package_dir_path} + fi done for proto_src in {proto_srcs}; do mkdir -p {package_dir_path}/src/main/proto From 9309fd13250b5698e1579afef421047b7006b68a Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 12 Apr 2022 17:46:48 -0700 Subject: [PATCH 06/18] refactor: sample class and file names should match --- .../java/com/google/api/generator/gapic/model/Sample.java | 8 -------- .../google/api/generator/gapic/protowriter/Writer.java | 2 +- .../com/google/api/generator/test/framework/Assert.java | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/model/Sample.java b/src/main/java/com/google/api/generator/gapic/model/Sample.java index b950294c56..1fb4e578e0 100644 --- a/src/main/java/com/google/api/generator/gapic/model/Sample.java +++ b/src/main/java/com/google/api/generator/gapic/model/Sample.java @@ -95,12 +95,4 @@ private static String generateSampleClassName(RegionTag regionTag) { + regionTag.rpcName() + regionTag.overloadDisambiguation(); } - - public String generateSampleFileName() { - String name = (regionTag().isAsynchronous() ? "Async" : "Sync") + regionTag().rpcName(); - if (!regionTag().overloadDisambiguation().isEmpty()) { - name += "_" + regionTag().overloadDisambiguation(); - } - return name; - } } diff --git a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java index e953bc8ea5..ee2e8fc751 100644 --- a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java +++ b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java @@ -108,7 +108,7 @@ private static void writeSamples( clazzPath, sample.regionTag().serviceName().toLowerCase(), sample.regionTag().rpcName().toLowerCase(), - sample.generateSampleFileName())); + sample.name())); String executableSampleCode = SampleCodeWriter.writeExecutableSample(sample, pakkage); try { jos.putNextEntry(jarEntry); diff --git a/src/test/java/com/google/api/generator/test/framework/Assert.java b/src/test/java/com/google/api/generator/test/framework/Assert.java index 20bc71b9b1..276ad41d50 100644 --- a/src/test/java/com/google/api/generator/test/framework/Assert.java +++ b/src/test/java/com/google/api/generator/test/framework/Assert.java @@ -68,7 +68,7 @@ public static void assertGoldenClass(Class clazz, GapicClass gapicClass, Stri public static void assertGoldenSamples( Class clazz, String sampleDirName, String packkage, List samples) { for (Sample sample : samples) { - String fileName = sample.generateSampleFileName() + ".golden"; + String fileName = sample.name() + ".golden"; String goldenSampleDir = Utils.getGoldenDir(clazz) + "/samples/" + sampleDirName.toLowerCase() + "/"; Path goldenFilePath = Paths.get(goldenSampleDir, fileName); From a56359be5ddc2b4a1381d3a594b663f1965c404e Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 12 Apr 2022 17:51:51 -0700 Subject: [PATCH 07/18] test: unit goldens --- ...alsProvider.golden => SyncCreateSetCredentialsProvider.golden} | 0 ...SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} | 0 ...ncGetBook_IntListbook.golden => SyncGetBookIntListbook.golden} | 0 ...ook_StringListbook.golden => SyncGetBookStringListbook.golden} | 0 ...alsProvider.golden => SyncCreateSetCredentialsProvider.golden} | 0 ...SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} | 0 ...AsyncPagedExpand_Paged.golden => AsyncPagedExpandPaged.golden} | 0 ...agedExpand_Paged.golden => AsyncSimplePagedExpandPaged.golden} | 0 .../echoclient/{AsyncWait_LRO.golden => AsyncWaitLRO.golden} | 0 ...alsProvider.golden => SyncCreateSetCredentialsProvider.golden} | 0 ...SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} | 0 .../{SyncEcho_Foobarname.golden => SyncEchoFoobarname.golden} | 0 .../echoclient/{SyncEcho_Noargs.golden => SyncEchoNoargs.golden} | 0 .../{SyncEcho_Resourcename.golden => SyncEchoResourcename.golden} | 0 .../echoclient/{SyncEcho_Status.golden => SyncEchoStatus.golden} | 0 .../echoclient/{SyncEcho_String.golden => SyncEchoString.golden} | 0 .../{SyncEcho_String1.golden => SyncEchoString1.golden} | 0 .../{SyncEcho_String2.golden => SyncEchoString2.golden} | 0 ...ncEcho_StringSeverity.golden => SyncEchoStringSeverity.golden} | 0 ...gedExpand_Noargs.golden => SyncSimplePagedExpandNoargs.golden} | 0 .../{SyncWait_Duration.golden => SyncWaitDuration.golden} | 0 .../{SyncWait_Timestamp.golden => SyncWaitTimestamp.golden} | 0 .../{AsyncListUsers_Paged.golden => AsyncListUsersPaged.golden} | 0 ...alsProvider.golden => SyncCreateSetCredentialsProvider.golden} | 0 ...SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} | 0 ...tringString.golden => SyncCreateUserStringStringString.golden} | 0 ...SyncCreateUserStringStringStringIntStringBooleanDouble.golden} | 0 ...ingStringStringStringStringIntStringStringStringString.golden} | 0 .../{SyncDeleteUser_String.golden => SyncDeleteUserString.golden} | 0 ...ncDeleteUser_Username.golden => SyncDeleteUserUsername.golden} | 0 .../{SyncGetUser_String.golden => SyncGetUserString.golden} | 0 .../{SyncGetUser_Username.golden => SyncGetUserUsername.golden} | 0 .../{AsyncListBlurbs_Paged.golden => AsyncListBlurbsPaged.golden} | 0 .../{AsyncListRooms_Paged.golden => AsyncListRoomsPaged.golden} | 0 .../{AsyncSearchBlurbs_LRO.golden => AsyncSearchBlurbsLRO.golden} | 0 ...estring.golden => SyncCreateBlurbProfilenameBytestring.golden} | 0 ...enameString.golden => SyncCreateBlurbProfilenameString.golden} | 0 ...Bytestring.golden => SyncCreateBlurbRoomnameBytestring.golden} | 0 ...RoomnameString.golden => SyncCreateBlurbRoomnameString.golden} | 0 ...ngBytestring.golden => SyncCreateBlurbStringBytestring.golden} | 0 ...urb_StringString.golden => SyncCreateBlurbStringString.golden} | 0 ...Room_StringString.golden => SyncCreateRoomStringString.golden} | 0 ...alsProvider.golden => SyncCreateSetCredentialsProvider.golden} | 0 ...SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} | 0 ...leteBlurb_Blurbname.golden => SyncDeleteBlurbBlurbname.golden} | 0 ...SyncDeleteBlurb_String.golden => SyncDeleteBlurbString.golden} | 0 ...ncDeleteRoom_Roomname.golden => SyncDeleteRoomRoomname.golden} | 0 .../{SyncDeleteRoom_String.golden => SyncDeleteRoomString.golden} | 0 ...SyncGetBlurb_Blurbname.golden => SyncGetBlurbBlurbname.golden} | 0 .../{SyncGetBlurb_String.golden => SyncGetBlurbString.golden} | 0 .../{SyncGetRoom_Roomname.golden => SyncGetRoomRoomname.golden} | 0 .../{SyncGetRoom_String.golden => SyncGetRoomString.golden} | 0 ...Blurbs_Profilename.golden => SyncListBlurbsProfilename.golden} | 0 ...ncListBlurbs_Roomname.golden => SyncListBlurbsRoomname.golden} | 0 .../{SyncListBlurbs_String.golden => SyncListBlurbsString.golden} | 0 ...ncSearchBlurbs_String.golden => SyncSearchBlurbsString.golden} | 0 56 files changed, 0 insertions(+), 0 deletions(-) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/{SyncCreate_SetCredentialsProvider.golden => SyncCreateSetCredentialsProvider.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/{SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/{SyncGetBook_IntListbook.golden => SyncGetBookIntListbook.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/{SyncGetBook_StringListbook.golden => SyncGetBookStringListbook.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/{SyncCreate_SetCredentialsProvider.golden => SyncCreateSetCredentialsProvider.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/{SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{AsyncPagedExpand_Paged.golden => AsyncPagedExpandPaged.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{AsyncSimplePagedExpand_Paged.golden => AsyncSimplePagedExpandPaged.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{AsyncWait_LRO.golden => AsyncWaitLRO.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncCreate_SetCredentialsProvider.golden => SyncCreateSetCredentialsProvider.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_Foobarname.golden => SyncEchoFoobarname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_Noargs.golden => SyncEchoNoargs.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_Resourcename.golden => SyncEchoResourcename.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_Status.golden => SyncEchoStatus.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_String.golden => SyncEchoString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_String1.golden => SyncEchoString1.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_String2.golden => SyncEchoString2.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncEcho_StringSeverity.golden => SyncEchoStringSeverity.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncSimplePagedExpand_Noargs.golden => SyncSimplePagedExpandNoargs.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncWait_Duration.golden => SyncWaitDuration.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/{SyncWait_Timestamp.golden => SyncWaitTimestamp.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{AsyncListUsers_Paged.golden => AsyncListUsersPaged.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncCreate_SetCredentialsProvider.golden => SyncCreateSetCredentialsProvider.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncCreateUser_StringStringString.golden => SyncCreateUserStringStringString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncCreateUser_StringStringStringIntStringBooleanDouble.golden => SyncCreateUserStringStringStringIntStringBooleanDouble.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncCreateUser_StringStringStringStringStringIntStringStringStringString.golden => SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncDeleteUser_String.golden => SyncDeleteUserString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncDeleteUser_Username.golden => SyncDeleteUserUsername.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncGetUser_String.golden => SyncGetUserString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/{SyncGetUser_Username.golden => SyncGetUserUsername.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{AsyncListBlurbs_Paged.golden => AsyncListBlurbsPaged.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{AsyncListRooms_Paged.golden => AsyncListRoomsPaged.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{AsyncSearchBlurbs_LRO.golden => AsyncSearchBlurbsLRO.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_ProfilenameBytestring.golden => SyncCreateBlurbProfilenameBytestring.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_ProfilenameString.golden => SyncCreateBlurbProfilenameString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_RoomnameBytestring.golden => SyncCreateBlurbRoomnameBytestring.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_RoomnameString.golden => SyncCreateBlurbRoomnameString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_StringBytestring.golden => SyncCreateBlurbStringBytestring.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateBlurb_StringString.golden => SyncCreateBlurbStringString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreateRoom_StringString.golden => SyncCreateRoomStringString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreate_SetCredentialsProvider.golden => SyncCreateSetCredentialsProvider.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncCreate_SetEndpoint.golden => SyncCreateSetEndpoint.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncDeleteBlurb_Blurbname.golden => SyncDeleteBlurbBlurbname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncDeleteBlurb_String.golden => SyncDeleteBlurbString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncDeleteRoom_Roomname.golden => SyncDeleteRoomRoomname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncDeleteRoom_String.golden => SyncDeleteRoomString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncGetBlurb_Blurbname.golden => SyncGetBlurbBlurbname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncGetBlurb_String.golden => SyncGetBlurbString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncGetRoom_Roomname.golden => SyncGetRoomRoomname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncGetRoom_String.golden => SyncGetRoomString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncListBlurbs_Profilename.golden => SyncListBlurbsProfilename.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncListBlurbs_Roomname.golden => SyncListBlurbsRoomname.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncListBlurbs_String.golden => SyncListBlurbsString.golden} (100%) rename src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/{SyncSearchBlurbs_String.golden => SyncSearchBlurbsString.golden} (100%) diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreate_SetCredentialsProvider.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreate_SetCredentialsProvider.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetCredentialsProvider.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreate_SetEndpoint.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreate_SetEndpoint.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncCreateSetEndpoint.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook_IntListbook.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook_IntListbook.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookIntListbook.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook_StringListbook.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBook_StringListbook.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/bookshopclient/SyncGetBookStringListbook.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreate_SetCredentialsProvider.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreate_SetCredentialsProvider.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetCredentialsProvider.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreate_SetEndpoint.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreate_SetEndpoint.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/deprecatedserviceclient/SyncCreateSetEndpoint.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand_Paged.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpand_Paged.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncPagedExpandPaged.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand_Paged.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpand_Paged.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncSimplePagedExpandPaged.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait_LRO.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWait_LRO.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/AsyncWaitLRO.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreate_SetCredentialsProvider.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreate_SetCredentialsProvider.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetCredentialsProvider.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreate_SetEndpoint.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreate_SetEndpoint.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncCreateSetEndpoint.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Foobarname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Foobarname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoFoobarname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Noargs.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Noargs.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoNoargs.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Resourcename.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Resourcename.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoResourcename.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Status.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_Status.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStatus.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String1.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String1.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString1.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String2.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_String2.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoString2.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_StringSeverity.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEcho_StringSeverity.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncEchoStringSeverity.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand_Noargs.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpand_Noargs.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncSimplePagedExpandNoargs.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait_Duration.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait_Duration.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitDuration.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait_Timestamp.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWait_Timestamp.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/echoclient/SyncWaitTimestamp.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers_Paged.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsers_Paged.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/AsyncListUsersPaged.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreate_SetCredentialsProvider.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreate_SetCredentialsProvider.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetCredentialsProvider.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreate_SetEndpoint.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreate_SetEndpoint.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateSetEndpoint.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringStringIntStringBooleanDouble.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringStringIntStringBooleanDouble.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringIntStringBooleanDouble.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringStringStringStringIntStringStringStringString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUser_StringStringStringStringStringIntStringStringStringString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncCreateUserStringStringStringStringStringIntStringStringStringString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser_Username.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUser_Username.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncDeleteUserUsername.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser_Username.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUser_Username.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/identityclient/SyncGetUserUsername.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs_Paged.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbs_Paged.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListBlurbsPaged.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms_Paged.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRooms_Paged.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncListRoomsPaged.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs_LRO.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbs_LRO.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/AsyncSearchBlurbsLRO.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_ProfilenameBytestring.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_ProfilenameBytestring.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameBytestring.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_ProfilenameString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_ProfilenameString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbProfilenameString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_RoomnameBytestring.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_RoomnameBytestring.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameBytestring.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_RoomnameString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_RoomnameString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbRoomnameString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_StringBytestring.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_StringBytestring.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringBytestring.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_StringString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurb_StringString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateBlurbStringString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom_StringString.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoom_StringString.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateRoomStringString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreate_SetCredentialsProvider.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreate_SetCredentialsProvider.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetCredentialsProvider.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreate_SetEndpoint.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreate_SetEndpoint.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncCreateSetEndpoint.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb_Blurbname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb_Blurbname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbBlurbname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurb_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteBlurbString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom_Roomname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom_Roomname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomRoomname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoom_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncDeleteRoomString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb_Blurbname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb_Blurbname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbBlurbname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurb_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetBlurbString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom_Roomname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom_Roomname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomRoomname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoom_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncGetRoomString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_Profilename.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_Profilename.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsProfilename.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_Roomname.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_Roomname.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsRoomname.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbs_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncListBlurbsString.golden diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs_String.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden similarity index 100% rename from src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbs_String.golden rename to src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/samples/messagingclient/SyncSearchBlurbsString.golden From 8aaf96e82fefb58b61b3c74de22557a41045d75d Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 12 Apr 2022 18:02:29 -0700 Subject: [PATCH 08/18] test: golden IT --- ...grunning_LRO.java => AsyncAnalyzeIamPolicyLongrunningLRO.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 .../{SyncCreateFeed_String.java => SyncCreateFeedString.java} | 0 .../{SyncDeleteFeed_Feedname.java => SyncDeleteFeedFeedname.java} | 0 .../{SyncDeleteFeed_String.java => SyncDeleteFeedString.java} | 0 .../{AsyncExportAssets_LRO.java => AsyncExportAssetsLRO.java} | 0 .../{SyncGetFeed_Feedname.java => SyncGetFeedFeedname.java} | 0 .../getfeed/{SyncGetFeed_String.java => SyncGetFeedString.java} | 0 .../{AsyncListAssets_Paged.java => AsyncListAssetsPaged.java} | 0 ...stAssets_Resourcename.java => SyncListAssetsResourcename.java} | 0 .../{SyncListAssets_String.java => SyncListAssetsString.java} | 0 .../{SyncListFeeds_String.java => SyncListFeedsString.java} | 0 ...IamPolicies_Paged.java => AsyncSearchAllIamPoliciesPaged.java} | 0 ...tringString.java => SyncSearchAllIamPoliciesStringString.java} | 0 ...hAllResources_Paged.java => AsyncSearchAllResourcesPaged.java} | 0 ...ing.java => SyncSearchAllResourcesStringStringListstring.java} | 0 .../{SyncUpdateFeed_Feed.java => SyncUpdateFeedFeed.java} | 0 ...tateRowStringBytestringRowfilterListmutationListmutation.java} | 0 ...wStringBytestringRowfilterListmutationListmutationString.java} | 0 ...eRowTablenameBytestringRowfilterListmutationListmutation.java} | 0 ...blenameBytestringRowfilterListmutationListmutationString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...tation.java => SyncMutateRowStringBytestringListmutation.java} | 0 ....java => SyncMutateRowStringBytestringListmutationString.java} | 0 ...ion.java => SyncMutateRowTablenameBytestringListmutation.java} | 0 ...va => SyncMutateRowTablenameBytestringListmutationString.java} | 0 ...eadModifyWriteRowStringBytestringListreadmodifywriterule.java} | 0 ...ifyWriteRowStringBytestringListreadmodifywriteruleString.java} | 0 ...ModifyWriteRowTablenameBytestringListreadmodifywriterule.java} | 0 ...WriteRowTablenameBytestringListreadmodifywriteruleString.java} | 0 ...yncAggregatedList_Paged.java => AsyncAggregatedListPaged.java} | 0 ...ncAggregatedList_String.java => SyncAggregatedListString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 .../delete/{AsyncDelete_LRO.java => AsyncDeleteLRO.java} | 0 ..._StringStringString.java => SyncDeleteStringStringString.java} | 0 .../insert/{AsyncInsert_LRO.java => AsyncInsertLRO.java} | 0 ...tringStringAddress.java => SyncInsertStringStringAddress.java} | 0 .../list/{AsyncList_Paged.java => AsyncListPaged.java} | 0 ...st_StringStringString.java => SyncListStringStringString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...Get_StringStringString.java => SyncGetStringStringString.java} | 0 ...it_StringStringString.java => SyncWaitStringStringString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...ccessTokenServiceaccountnameListstringListstringDuration.java} | 0 ...yncGenerateAccessTokenStringListstringListstringDuration.java} | 0 ...GenerateIdTokenServiceaccountnameListstringStringBoolean.java} | 0 ...java => SyncGenerateIdTokenStringListstringStringBoolean.java} | 0 ...va => SyncSignBlobServiceaccountnameListstringBytestring.java} | 0 ...ytestring.java => SyncSignBlobStringListstringBytestring.java} | 0 ...ng.java => SyncSignJwtServiceaccountnameListstringString.java} | 0 ...ststringString.java => SyncSignJwtStringListstringString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...a => SyncAsymmetricDecryptCryptokeyversionnameBytestring.java} | 0 ...Bytestring.java => SyncAsymmetricDecryptStringBytestring.java} | 0 ...est.java => SyncAsymmetricSignCryptokeyversionnameDigest.java} | 0 ...Sign_StringDigest.java => SyncAsymmetricSignStringDigest.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...ey.java => SyncCreateCryptoKeyKeyringnameStringCryptokey.java} | 0 ...yptokey.java => SyncCreateCryptoKeyStringStringCryptokey.java} | 0 ... SyncCreateCryptoKeyVersionCryptokeynameCryptokeyversion.java} | 0 ...java => SyncCreateCryptoKeyVersionStringCryptokeyversion.java} | 0 ...ob.java => SyncCreateImportJobKeyringnameStringImportjob.java} | 0 ...portjob.java => SyncCreateImportJobStringStringImportjob.java} | 0 ...yring.java => SyncCreateKeyRingLocationnameStringKeyring.java} | 0 ...ringKeyring.java => SyncCreateKeyRingStringStringKeyring.java} | 0 ...ameBytestring.java => SyncDecryptCryptokeynameBytestring.java} | 0 ...ypt_StringBytestring.java => SyncDecryptStringBytestring.java} | 0 ....java => SyncDestroyCryptoKeyVersionCryptokeyversionname.java} | 0 ...Version_String.java => SyncDestroyCryptoKeyVersionString.java} | 0 ...nameBytestring.java => SyncEncryptResourcenameBytestring.java} | 0 ...ypt_StringBytestring.java => SyncEncryptStringBytestring.java} | 0 ...oKey_Cryptokeyname.java => SyncGetCryptoKeyCryptokeyname.java} | 0 .../{SyncGetCryptoKey_String.java => SyncGetCryptoKeyString.java} | 0 ...name.java => SyncGetCryptoKeyVersionCryptokeyversionname.java} | 0 ...oKeyVersion_String.java => SyncGetCryptoKeyVersionString.java} | 0 ...tJob_Importjobname.java => SyncGetImportJobImportjobname.java} | 0 .../{SyncGetImportJob_String.java => SyncGetImportJobString.java} | 0 ...GetKeyRing_Keyringname.java => SyncGetKeyRingKeyringname.java} | 0 .../{SyncGetKeyRing_String.java => SyncGetKeyRingString.java} | 0 ...versionname.java => SyncGetPublicKeyCryptokeyversionname.java} | 0 .../{SyncGetPublicKey_String.java => SyncGetPublicKeyString.java} | 0 ...yncListCryptoKeys_Paged.java => AsyncListCryptoKeysPaged.java} | 0 ...toKeys_Keyringname.java => SyncListCryptoKeysKeyringname.java} | 0 ...ncListCryptoKeys_String.java => SyncListCryptoKeysString.java} | 0 ...eyVersions_Paged.java => AsyncListCryptoKeyVersionsPaged.java} | 0 ...tokeyname.java => SyncListCryptoKeyVersionsCryptokeyname.java} | 0 ...yVersions_String.java => SyncListCryptoKeyVersionsString.java} | 0 ...yncListImportJobs_Paged.java => AsyncListImportJobsPaged.java} | 0 ...rtJobs_Keyringname.java => SyncListImportJobsKeyringname.java} | 0 ...ncListImportJobs_String.java => SyncListImportJobsString.java} | 0 .../{AsyncListKeyRings_Paged.java => AsyncListKeyRingsPaged.java} | 0 ...yRings_Locationname.java => SyncListKeyRingsLocationname.java} | 0 .../{SyncListKeyRings_String.java => SyncListKeyRingsString.java} | 0 ...AsyncListLocations_Paged.java => AsyncListLocationsPaged.java} | 0 ....java => SyncRestoreCryptoKeyVersionCryptokeyversionname.java} | 0 ...Version_String.java => SyncRestoreCryptoKeyVersionString.java} | 0 ...yFieldmask.java => SyncUpdateCryptoKeyCryptokeyFieldmask.java} | 0 ... => SyncUpdateCryptoKeyPrimaryVersionCryptokeynameString.java} | 0 ...ng.java => SyncUpdateCryptoKeyPrimaryVersionStringString.java} | 0 ...a => SyncUpdateCryptoKeyVersionCryptokeyversionFieldmask.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...teBook_ShelfnameBook.java => SyncCreateBookShelfnameBook.java} | 0 ...ncCreateBook_StringBook.java => SyncCreateBookStringBook.java} | 0 .../{SyncCreateShelf_Shelf.java => SyncCreateShelfShelf.java} | 0 .../{SyncDeleteBook_Bookname.java => SyncDeleteBookBookname.java} | 0 .../{SyncDeleteBook_String.java => SyncDeleteBookString.java} | 0 ...ncDeleteShelf_Shelfname.java => SyncDeleteShelfShelfname.java} | 0 .../{SyncDeleteShelf_String.java => SyncDeleteShelfString.java} | 0 .../{SyncGetBook_Bookname.java => SyncGetBookBookname.java} | 0 .../getbook/{SyncGetBook_String.java => SyncGetBookString.java} | 0 .../{SyncGetShelf_Shelfname.java => SyncGetShelfShelfname.java} | 0 .../{SyncGetShelf_String.java => SyncGetShelfString.java} | 0 .../{AsyncListBooks_Paged.java => AsyncListBooksPaged.java} | 0 .../{SyncListBooks_Shelfname.java => SyncListBooksShelfname.java} | 0 .../{SyncListBooks_String.java => SyncListBooksString.java} | 0 .../{AsyncListShelves_Paged.java => AsyncListShelvesPaged.java} | 0 ...nameShelfname.java => SyncMergeShelvesShelfnameShelfname.java} | 0 ..._ShelfnameString.java => SyncMergeShelvesShelfnameString.java} | 0 ..._StringShelfname.java => SyncMergeShelvesStringShelfname.java} | 0 ...helves_StringString.java => SyncMergeShelvesStringString.java} | 0 ..._BooknameShelfname.java => SyncMoveBookBooknameShelfname.java} | 0 ...veBook_BooknameString.java => SyncMoveBookBooknameString.java} | 0 ...Book_StringShelfname.java => SyncMoveBookStringShelfname.java} | 0 ...ncMoveBook_StringString.java => SyncMoveBookStringString.java} | 0 ...teBook_BookFieldmask.java => SyncUpdateBookBookFieldmask.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...ava => SyncCreateExclusionBillingaccountnameLogexclusion.java} | 0 ...lusion.java => SyncCreateExclusionFoldernameLogexclusion.java} | 0 ....java => SyncCreateExclusionOrganizationnameLogexclusion.java} | 0 ...usion.java => SyncCreateExclusionProjectnameLogexclusion.java} | 0 ...gexclusion.java => SyncCreateExclusionStringLogexclusion.java} | 0 ...eLogsink.java => SyncCreateSinkBillingaccountnameLogsink.java} | 0 ...oldernameLogsink.java => SyncCreateSinkFoldernameLogsink.java} | 0 ...ameLogsink.java => SyncCreateSinkOrganizationnameLogsink.java} | 0 ...jectnameLogsink.java => SyncCreateSinkProjectnameLogsink.java} | 0 ...teSink_StringLogsink.java => SyncCreateSinkStringLogsink.java} | 0 ...xclusionname.java => SyncDeleteExclusionLogexclusionname.java} | 0 ...DeleteExclusion_String.java => SyncDeleteExclusionString.java} | 0 ...DeleteSink_Logsinkname.java => SyncDeleteSinkLogsinkname.java} | 0 .../{SyncDeleteSink_String.java => SyncDeleteSinkString.java} | 0 ...ogexclusionname.java => SyncGetExclusionLogexclusionname.java} | 0 .../{SyncGetExclusion_String.java => SyncGetExclusionString.java} | 0 .../{SyncGetSink_Logsinkname.java => SyncGetSinkLogsinkname.java} | 0 .../getsink/{SyncGetSink_String.java => SyncGetSinkString.java} | 0 .../{AsyncListBuckets_Paged.java => AsyncListBucketsPaged.java} | 0 ...onname.java => SyncListBucketsBillingaccountlocationname.java} | 0 ...erlocationname.java => SyncListBucketsFolderlocationname.java} | 0 ...Buckets_Locationname.java => SyncListBucketsLocationname.java} | 0 ...tionname.java => SyncListBucketsOrganizationlocationname.java} | 0 .../{SyncListBuckets_String.java => SyncListBucketsString.java} | 0 ...yncListExclusions_Paged.java => AsyncListExclusionsPaged.java} | 0 ...accountname.java => SyncListExclusionsBillingaccountname.java} | 0 ...clusions_Foldername.java => SyncListExclusionsFoldername.java} | 0 ...anizationname.java => SyncListExclusionsOrganizationname.java} | 0 ...usions_Projectname.java => SyncListExclusionsProjectname.java} | 0 ...ncListExclusions_String.java => SyncListExclusionsString.java} | 0 .../{AsyncListSinks_Paged.java => AsyncListSinksPaged.java} | 0 ...llingaccountname.java => SyncListSinksBillingaccountname.java} | 0 ...SyncListSinks_Foldername.java => SyncListSinksFoldername.java} | 0 ...s_Organizationname.java => SyncListSinksOrganizationname.java} | 0 ...ncListSinks_Projectname.java => SyncListSinksProjectname.java} | 0 .../{SyncListSinks_String.java => SyncListSinksString.java} | 0 .../{AsyncListViews_Paged.java => AsyncListViewsPaged.java} | 0 .../{SyncListViews_String.java => SyncListViewsString.java} | 0 ...SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java} | 0 ...k.java => SyncUpdateExclusionStringLogexclusionFieldmask.java} | 0 ...sinknameLogsink.java => SyncUpdateSinkLogsinknameLogsink.java} | 0 ...ldmask.java => SyncUpdateSinkLogsinknameLogsinkFieldmask.java} | 0 ...teSink_StringLogsink.java => SyncUpdateSinkStringLogsink.java} | 0 ...nkFieldmask.java => SyncUpdateSinkStringLogsinkFieldmask.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 .../{SyncDeleteLog_Logname.java => SyncDeleteLogLogname.java} | 0 .../{SyncDeleteLog_String.java => SyncDeleteLogString.java} | 0 ...yncListLogEntries_Paged.java => AsyncListLogEntriesPaged.java} | 0 ...gString.java => SyncListLogEntriesListstringStringString.java} | 0 .../{AsyncListLogs_Paged.java => AsyncListLogsPaged.java} | 0 ...illingaccountname.java => SyncListLogsBillingaccountname.java} | 0 .../{SyncListLogs_Foldername.java => SyncListLogsFoldername.java} | 0 ...gs_Organizationname.java => SyncListLogsOrganizationname.java} | 0 ...SyncListLogs_Projectname.java => SyncListLogsProjectname.java} | 0 .../{SyncListLogs_String.java => SyncListLogsString.java} | 0 ...Paged.java => AsyncListMonitoredResourceDescriptorsPaged.java} | 0 ...triesLognameMonitoredresourceMapstringstringListlogentry.java} | 0 ...ntriesStringMonitoredresourceMapstringstringListlogentry.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...ogmetric.java => SyncCreateLogMetricProjectnameLogmetric.java} | 0 ...ringLogmetric.java => SyncCreateLogMetricStringLogmetric.java} | 0 ...c_Logmetricname.java => SyncDeleteLogMetricLogmetricname.java} | 0 ...DeleteLogMetric_String.java => SyncDeleteLogMetricString.java} | 0 ...tric_Logmetricname.java => SyncGetLogMetricLogmetricname.java} | 0 .../{SyncGetLogMetric_String.java => SyncGetLogMetricString.java} | 0 ...yncListLogMetrics_Paged.java => AsyncListLogMetricsPaged.java} | 0 ...etrics_Projectname.java => SyncListLogMetricsProjectname.java} | 0 ...ncListLogMetrics_String.java => SyncListLogMetricsString.java} | 0 ...metric.java => SyncUpdateLogMetricLogmetricnameLogmetric.java} | 0 ...ringLogmetric.java => SyncUpdateLogMetricStringLogmetric.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...maString.java => SyncCreateSchemaProjectnameSchemaString.java} | 0 ...gSchemaString.java => SyncCreateSchemaStringSchemaString.java} | 0 ...leteSchema_Schemaname.java => SyncDeleteSchemaSchemaname.java} | 0 .../{SyncDeleteSchema_String.java => SyncDeleteSchemaString.java} | 0 ...SyncGetSchema_Schemaname.java => SyncGetSchemaSchemaname.java} | 0 .../{SyncGetSchema_String.java => SyncGetSchemaString.java} | 0 .../{AsyncListSchemas_Paged.java => AsyncListSchemasPaged.java} | 0 ...stSchemas_Projectname.java => SyncListSchemasProjectname.java} | 0 .../{SyncListSchemas_String.java => SyncListSchemasString.java} | 0 ...ctnameSchema.java => SyncValidateSchemaProjectnameSchema.java} | 0 ...hema_StringSchema.java => SyncValidateSchemaStringSchema.java} | 0 ...StringListstring.java => SyncAcknowledgeStringListstring.java} | 0 ...string.java => SyncAcknowledgeSubscriptionnameListstring.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...tnameString.java => SyncCreateSnapshotSnapshotnameString.java} | 0 ...e.java => SyncCreateSnapshotSnapshotnameSubscriptionname.java} | 0 ...shot_StringString.java => SyncCreateSnapshotStringString.java} | 0 ...ionname.java => SyncCreateSnapshotStringSubscriptionname.java} | 0 ....java => SyncCreateSubscriptionStringStringPushconfigInt.java} | 0 ...va => SyncCreateSubscriptionStringTopicnamePushconfigInt.java} | 0 ...yncCreateSubscriptionSubscriptionnameStringPushconfigInt.java} | 0 ...CreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java} | 0 ...shot_Snapshotname.java => SyncDeleteSnapshotSnapshotname.java} | 0 ...ncDeleteSnapshot_String.java => SyncDeleteSnapshotString.java} | 0 ...Subscription_String.java => SyncDeleteSubscriptionString.java} | 0 ...ptionname.java => SyncDeleteSubscriptionSubscriptionname.java} | 0 ...napshot_Snapshotname.java => SyncGetSnapshotSnapshotname.java} | 0 .../{SyncGetSnapshot_String.java => SyncGetSnapshotString.java} | 0 ...GetSubscription_String.java => SyncGetSubscriptionString.java} | 0 ...criptionname.java => SyncGetSubscriptionSubscriptionname.java} | 0 ...AsyncListSnapshots_Paged.java => AsyncListSnapshotsPaged.java} | 0 ...apshots_Projectname.java => SyncListSnapshotsProjectname.java} | 0 ...SyncListSnapshots_String.java => SyncListSnapshotsString.java} | 0 ...tSubscriptions_Paged.java => AsyncListSubscriptionsPaged.java} | 0 ...ons_Projectname.java => SyncListSubscriptionsProjectname.java} | 0 ...Subscriptions_String.java => SyncListSubscriptionsString.java} | 0 ...ringInt.java => SyncModifyAckDeadlineStringListstringInt.java} | 0 ...va => SyncModifyAckDeadlineSubscriptionnameListstringInt.java} | 0 ...gPushconfig.java => SyncModifyPushConfigStringPushconfig.java} | 0 ...g.java => SyncModifyPushConfigSubscriptionnamePushconfig.java} | 0 ...ncPull_StringBooleanInt.java => SyncPullStringBooleanInt.java} | 0 .../pull/{SyncPull_StringInt.java => SyncPullStringInt.java} | 0 ...ameBooleanInt.java => SyncPullSubscriptionnameBooleanInt.java} | 0 ..._SubscriptionnameInt.java => SyncPullSubscriptionnameInt.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 .../{SyncCreateTopic_String.java => SyncCreateTopicString.java} | 0 ...ncCreateTopic_Topicname.java => SyncCreateTopicTopicname.java} | 0 .../{SyncDeleteTopic_String.java => SyncDeleteTopicString.java} | 0 ...ncDeleteTopic_Topicname.java => SyncDeleteTopicTopicname.java} | 0 .../{SyncGetTopic_String.java => SyncGetTopicString.java} | 0 .../{SyncGetTopic_Topicname.java => SyncGetTopicTopicname.java} | 0 .../{AsyncListTopics_Paged.java => AsyncListTopicsPaged.java} | 0 ...ListTopics_Projectname.java => SyncListTopicsProjectname.java} | 0 .../{SyncListTopics_String.java => SyncListTopicsString.java} | 0 ...opicSnapshots_Paged.java => AsyncListTopicSnapshotsPaged.java} | 0 ...picSnapshots_String.java => SyncListTopicSnapshotsString.java} | 0 ...pshots_Topicname.java => SyncListTopicSnapshotsTopicname.java} | 0 ...criptions_Paged.java => AsyncListTopicSubscriptionsPaged.java} | 0 ...riptions_String.java => SyncListTopicSubscriptionsString.java} | 0 ...ns_Topicname.java => SyncListTopicSubscriptionsTopicname.java} | 0 ...pubsubmessage.java => SyncPublishStringListpubsubmessage.java} | 0 ...submessage.java => SyncPublishTopicnameListpubsubmessage.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 .../{AsyncCreateInstance_LRO.java => AsyncCreateInstanceLRO.java} | 0 ...nce.java => SyncCreateInstanceLocationnameStringInstance.java} | 0 ...gInstance.java => SyncCreateInstanceStringStringInstance.java} | 0 .../{AsyncDeleteInstance_LRO.java => AsyncDeleteInstanceLRO.java} | 0 ...ance_Instancename.java => SyncDeleteInstanceInstancename.java} | 0 ...ncDeleteInstance_String.java => SyncDeleteInstanceString.java} | 0 .../{AsyncExportInstance_LRO.java => AsyncExportInstanceLRO.java} | 0 ...utputconfig.java => SyncExportInstanceStringOutputconfig.java} | 0 ...yncFailoverInstance_LRO.java => AsyncFailoverInstanceLRO.java} | 0 ...nceInstancenameFailoverinstancerequestdataprotectionmode.java} | 0 ...rInstanceStringFailoverinstancerequestdataprotectionmode.java} | 0 ...nstance_Instancename.java => SyncGetInstanceInstancename.java} | 0 .../{SyncGetInstance_String.java => SyncGetInstanceString.java} | 0 ...stancename.java => SyncGetInstanceAuthStringInstancename.java} | 0 ...uthString_String.java => SyncGetInstanceAuthStringString.java} | 0 .../{AsyncImportInstance_LRO.java => AsyncImportInstanceLRO.java} | 0 ...gInputconfig.java => SyncImportInstanceStringInputconfig.java} | 0 ...AsyncListInstances_Paged.java => AsyncListInstancesPaged.java} | 0 ...ances_Locationname.java => SyncListInstancesLocationname.java} | 0 ...SyncListInstances_String.java => SyncListInstancesString.java} | 0 ...uleMaintenance_LRO.java => AsyncRescheduleMaintenanceLRO.java} | 0 ...enameReschedulemaintenancerequestrescheduletypeTimestamp.java} | 0 ...tringReschedulemaintenancerequestrescheduletypeTimestamp.java} | 0 .../{AsyncUpdateInstance_LRO.java => AsyncUpdateInstanceLRO.java} | 0 ...maskInstance.java => SyncUpdateInstanceFieldmaskInstance.java} | 0 ...AsyncUpgradeInstance_LRO.java => AsyncUpgradeInstanceLRO.java} | 0 ...nameString.java => SyncUpgradeInstanceInstancenameString.java} | 0 ...nce_StringString.java => SyncUpgradeInstanceStringString.java} | 0 ...entialsProvider.java => SyncCreateSetCredentialsProvider.java} | 0 .../{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} | 0 ...etString.java => SyncCreateBucketProjectnameBucketString.java} | 0 ...gBucketString.java => SyncCreateBucketStringBucketString.java} | 0 ...ectnameString.java => SyncCreateHmacKeyProjectnameString.java} | 0 ...acKey_StringString.java => SyncCreateHmacKeyStringString.java} | 0 ...on.java => SyncCreateNotificationProjectnameNotification.java} | 0 ...ication.java => SyncCreateNotificationStringNotification.java} | 0 ...leteBucket_Bucketname.java => SyncDeleteBucketBucketname.java} | 0 .../{SyncDeleteBucket_String.java => SyncDeleteBucketString.java} | 0 ...ngProjectname.java => SyncDeleteHmacKeyStringProjectname.java} | 0 ...acKey_StringString.java => SyncDeleteHmacKeyStringString.java} | 0 ...ationname.java => SyncDeleteNotificationNotificationname.java} | 0 ...Notification_String.java => SyncDeleteNotificationString.java} | 0 ...Object_StringString.java => SyncDeleteObjectStringString.java} | 0 ...tringStringLong.java => SyncDeleteObjectStringStringLong.java} | 0 ...SyncGetBucket_Bucketname.java => SyncGetBucketBucketname.java} | 0 .../{SyncGetBucket_String.java => SyncGetBucketString.java} | 0 ...tringProjectname.java => SyncGetHmacKeyStringProjectname.java} | 0 ...tHmacKey_StringString.java => SyncGetHmacKeyStringString.java} | 0 ...Policy_Resourcename.java => SyncGetIamPolicyResourcename.java} | 0 .../{SyncGetIamPolicy_String.java => SyncGetIamPolicyString.java} | 0 ...ication_Bucketname.java => SyncGetNotificationBucketname.java} | 0 ...GetNotification_String.java => SyncGetNotificationString.java} | 0 ...GetObject_StringString.java => SyncGetObjectStringString.java} | 0 ...t_StringStringLong.java => SyncGetObjectStringStringLong.java} | 0 ...unt_Projectname.java => SyncGetServiceAccountProjectname.java} | 0 ...erviceAccount_String.java => SyncGetServiceAccountString.java} | 0 .../{AsyncListBuckets_Paged.java => AsyncListBucketsPaged.java} | 0 ...stBuckets_Projectname.java => SyncListBucketsProjectname.java} | 0 .../{SyncListBuckets_String.java => SyncListBucketsString.java} | 0 .../{AsyncListHmacKeys_Paged.java => AsyncListHmacKeysPaged.java} | 0 ...HmacKeys_Projectname.java => SyncListHmacKeysProjectname.java} | 0 .../{SyncListHmacKeys_String.java => SyncListHmacKeysString.java} | 0 ...tNotifications_Paged.java => AsyncListNotificationsPaged.java} | 0 ...ons_Projectname.java => SyncListNotificationsProjectname.java} | 0 ...Notifications_String.java => SyncListNotificationsString.java} | 0 .../{AsyncListObjects_Paged.java => AsyncListObjectsPaged.java} | 0 ...stObjects_Projectname.java => SyncListObjectsProjectname.java} | 0 .../{SyncListObjects_String.java => SyncListObjectsString.java} | 0 ...cketname.java => SyncLockBucketRetentionPolicyBucketname.java} | 0 ...olicy_String.java => SyncLockBucketRetentionPolicyString.java} | 0 ...eryWriteStatus_String.java => SyncQueryWriteStatusString.java} | 0 ...rcenamePolicy.java => SyncSetIamPolicyResourcenamePolicy.java} | 0 ...Policy_StringPolicy.java => SyncSetIamPolicyStringPolicy.java} | 0 ...ing.java => SyncTestIamPermissionsResourcenameListstring.java} | 0 ...iststring.java => SyncTestIamPermissionsStringListstring.java} | 0 ..._BucketFieldmask.java => SyncUpdateBucketBucketFieldmask.java} | 0 ...ldmask.java => SyncUpdateHmacKeyHmackeymetadataFieldmask.java} | 0 ..._ObjectFieldmask.java => SyncUpdateObjectObjectFieldmask.java} | 0 353 files changed, 0 insertions(+), 0 deletions(-) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/{AsyncAnalyzeIamPolicyLongrunning_LRO.java => AsyncAnalyzeIamPolicyLongrunningLRO.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/{SyncCreateFeed_String.java => SyncCreateFeedString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/{SyncDeleteFeed_Feedname.java => SyncDeleteFeedFeedname.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/{SyncDeleteFeed_String.java => SyncDeleteFeedString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/{AsyncExportAssets_LRO.java => AsyncExportAssetsLRO.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/{SyncGetFeed_Feedname.java => SyncGetFeedFeedname.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/{SyncGetFeed_String.java => SyncGetFeedString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/{AsyncListAssets_Paged.java => AsyncListAssetsPaged.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/{SyncListAssets_Resourcename.java => SyncListAssetsResourcename.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/{SyncListAssets_String.java => SyncListAssetsString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/{SyncListFeeds_String.java => SyncListFeedsString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/{AsyncSearchAllIamPolicies_Paged.java => AsyncSearchAllIamPoliciesPaged.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/{SyncSearchAllIamPolicies_StringString.java => SyncSearchAllIamPoliciesStringString.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/{AsyncSearchAllResources_Paged.java => AsyncSearchAllResourcesPaged.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/{SyncSearchAllResources_StringStringListstring.java => SyncSearchAllResourcesStringStringListstring.java} (100%) rename test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/{SyncUpdateFeed_Feed.java => SyncUpdateFeedFeed.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/{SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java => SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/{SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java => SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/{SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java => SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/{SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java => SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/{SyncMutateRow_StringBytestringListmutation.java => SyncMutateRowStringBytestringListmutation.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/{SyncMutateRow_StringBytestringListmutationString.java => SyncMutateRowStringBytestringListmutationString.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/{SyncMutateRow_TablenameBytestringListmutation.java => SyncMutateRowTablenameBytestringListmutation.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/{SyncMutateRow_TablenameBytestringListmutationString.java => SyncMutateRowTablenameBytestringListmutationString.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/{SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java => SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/{SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java => SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/{SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java => SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java} (100%) rename test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/{SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java => SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/{AsyncAggregatedList_Paged.java => AsyncAggregatedListPaged.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/{SyncAggregatedList_String.java => SyncAggregatedListString.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/{AsyncDelete_LRO.java => AsyncDeleteLRO.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/{SyncDelete_StringStringString.java => SyncDeleteStringStringString.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/{AsyncInsert_LRO.java => AsyncInsertLRO.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/{SyncInsert_StringStringAddress.java => SyncInsertStringStringAddress.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/{AsyncList_Paged.java => AsyncListPaged.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/{SyncList_StringStringString.java => SyncListStringStringString.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/{SyncGet_StringStringString.java => SyncGetStringStringString.java} (100%) rename test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/{SyncWait_StringStringString.java => SyncWaitStringStringString.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/{SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java => SyncGenerateAccessTokenServiceaccountnameListstringListstringDuration.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/{SyncGenerateAccessToken_StringListstringListstringDuration.java => SyncGenerateAccessTokenStringListstringListstringDuration.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/{SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java => SyncGenerateIdTokenServiceaccountnameListstringStringBoolean.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/{SyncGenerateIdToken_StringListstringStringBoolean.java => SyncGenerateIdTokenStringListstringStringBoolean.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/{SyncSignBlob_ServiceaccountnameListstringBytestring.java => SyncSignBlobServiceaccountnameListstringBytestring.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/{SyncSignBlob_StringListstringBytestring.java => SyncSignBlobStringListstringBytestring.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/{SyncSignJwt_ServiceaccountnameListstringString.java => SyncSignJwtServiceaccountnameListstringString.java} (100%) rename test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/{SyncSignJwt_StringListstringString.java => SyncSignJwtStringListstringString.java} (100%) rename test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/{SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java => SyncAsymmetricDecryptCryptokeyversionnameBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/{SyncAsymmetricDecrypt_StringBytestring.java => SyncAsymmetricDecryptStringBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/{SyncAsymmetricSign_CryptokeyversionnameDigest.java => SyncAsymmetricSignCryptokeyversionnameDigest.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/{SyncAsymmetricSign_StringDigest.java => SyncAsymmetricSignStringDigest.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/{SyncCreateCryptoKey_KeyringnameStringCryptokey.java => SyncCreateCryptoKeyKeyringnameStringCryptokey.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/{SyncCreateCryptoKey_StringStringCryptokey.java => SyncCreateCryptoKeyStringStringCryptokey.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/{SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java => SyncCreateCryptoKeyVersionCryptokeynameCryptokeyversion.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/{SyncCreateCryptoKeyVersion_StringCryptokeyversion.java => SyncCreateCryptoKeyVersionStringCryptokeyversion.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/{SyncCreateImportJob_KeyringnameStringImportjob.java => SyncCreateImportJobKeyringnameStringImportjob.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/{SyncCreateImportJob_StringStringImportjob.java => SyncCreateImportJobStringStringImportjob.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/{SyncCreateKeyRing_LocationnameStringKeyring.java => SyncCreateKeyRingLocationnameStringKeyring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/{SyncCreateKeyRing_StringStringKeyring.java => SyncCreateKeyRingStringStringKeyring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/{SyncDecrypt_CryptokeynameBytestring.java => SyncDecryptCryptokeynameBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/{SyncDecrypt_StringBytestring.java => SyncDecryptStringBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/{SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java => SyncDestroyCryptoKeyVersionCryptokeyversionname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/{SyncDestroyCryptoKeyVersion_String.java => SyncDestroyCryptoKeyVersionString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/{SyncEncrypt_ResourcenameBytestring.java => SyncEncryptResourcenameBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/{SyncEncrypt_StringBytestring.java => SyncEncryptStringBytestring.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/{SyncGetCryptoKey_Cryptokeyname.java => SyncGetCryptoKeyCryptokeyname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/{SyncGetCryptoKey_String.java => SyncGetCryptoKeyString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/{SyncGetCryptoKeyVersion_Cryptokeyversionname.java => SyncGetCryptoKeyVersionCryptokeyversionname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/{SyncGetCryptoKeyVersion_String.java => SyncGetCryptoKeyVersionString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/{SyncGetImportJob_Importjobname.java => SyncGetImportJobImportjobname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/{SyncGetImportJob_String.java => SyncGetImportJobString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/{SyncGetKeyRing_Keyringname.java => SyncGetKeyRingKeyringname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/{SyncGetKeyRing_String.java => SyncGetKeyRingString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/{SyncGetPublicKey_Cryptokeyversionname.java => SyncGetPublicKeyCryptokeyversionname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/{SyncGetPublicKey_String.java => SyncGetPublicKeyString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/{AsyncListCryptoKeys_Paged.java => AsyncListCryptoKeysPaged.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/{SyncListCryptoKeys_Keyringname.java => SyncListCryptoKeysKeyringname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/{SyncListCryptoKeys_String.java => SyncListCryptoKeysString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/{AsyncListCryptoKeyVersions_Paged.java => AsyncListCryptoKeyVersionsPaged.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/{SyncListCryptoKeyVersions_Cryptokeyname.java => SyncListCryptoKeyVersionsCryptokeyname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/{SyncListCryptoKeyVersions_String.java => SyncListCryptoKeyVersionsString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/{AsyncListImportJobs_Paged.java => AsyncListImportJobsPaged.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/{SyncListImportJobs_Keyringname.java => SyncListImportJobsKeyringname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/{SyncListImportJobs_String.java => SyncListImportJobsString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/{AsyncListKeyRings_Paged.java => AsyncListKeyRingsPaged.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/{SyncListKeyRings_Locationname.java => SyncListKeyRingsLocationname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/{SyncListKeyRings_String.java => SyncListKeyRingsString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/{AsyncListLocations_Paged.java => AsyncListLocationsPaged.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/{SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java => SyncRestoreCryptoKeyVersionCryptokeyversionname.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/{SyncRestoreCryptoKeyVersion_String.java => SyncRestoreCryptoKeyVersionString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/{SyncUpdateCryptoKey_CryptokeyFieldmask.java => SyncUpdateCryptoKeyCryptokeyFieldmask.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/{SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java => SyncUpdateCryptoKeyPrimaryVersionCryptokeynameString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/{SyncUpdateCryptoKeyPrimaryVersion_StringString.java => SyncUpdateCryptoKeyPrimaryVersionStringString.java} (100%) rename test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/{SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java => SyncUpdateCryptoKeyVersionCryptokeyversionFieldmask.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/{SyncCreateBook_ShelfnameBook.java => SyncCreateBookShelfnameBook.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/{SyncCreateBook_StringBook.java => SyncCreateBookStringBook.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/{SyncCreateShelf_Shelf.java => SyncCreateShelfShelf.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/{SyncDeleteBook_Bookname.java => SyncDeleteBookBookname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/{SyncDeleteBook_String.java => SyncDeleteBookString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/{SyncDeleteShelf_Shelfname.java => SyncDeleteShelfShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/{SyncDeleteShelf_String.java => SyncDeleteShelfString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/{SyncGetBook_Bookname.java => SyncGetBookBookname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/{SyncGetBook_String.java => SyncGetBookString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/{SyncGetShelf_Shelfname.java => SyncGetShelfShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/{SyncGetShelf_String.java => SyncGetShelfString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/{AsyncListBooks_Paged.java => AsyncListBooksPaged.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/{SyncListBooks_Shelfname.java => SyncListBooksShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/{SyncListBooks_String.java => SyncListBooksString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/{AsyncListShelves_Paged.java => AsyncListShelvesPaged.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/{SyncMergeShelves_ShelfnameShelfname.java => SyncMergeShelvesShelfnameShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/{SyncMergeShelves_ShelfnameString.java => SyncMergeShelvesShelfnameString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/{SyncMergeShelves_StringShelfname.java => SyncMergeShelvesStringShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/{SyncMergeShelves_StringString.java => SyncMergeShelvesStringString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/{SyncMoveBook_BooknameShelfname.java => SyncMoveBookBooknameShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/{SyncMoveBook_BooknameString.java => SyncMoveBookBooknameString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/{SyncMoveBook_StringShelfname.java => SyncMoveBookStringShelfname.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/{SyncMoveBook_StringString.java => SyncMoveBookStringString.java} (100%) rename test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/{SyncUpdateBook_BookFieldmask.java => SyncUpdateBookBookFieldmask.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/{SyncCreateExclusion_BillingaccountnameLogexclusion.java => SyncCreateExclusionBillingaccountnameLogexclusion.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/{SyncCreateExclusion_FoldernameLogexclusion.java => SyncCreateExclusionFoldernameLogexclusion.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/{SyncCreateExclusion_OrganizationnameLogexclusion.java => SyncCreateExclusionOrganizationnameLogexclusion.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/{SyncCreateExclusion_ProjectnameLogexclusion.java => SyncCreateExclusionProjectnameLogexclusion.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/{SyncCreateExclusion_StringLogexclusion.java => SyncCreateExclusionStringLogexclusion.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/{SyncCreateSink_BillingaccountnameLogsink.java => SyncCreateSinkBillingaccountnameLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/{SyncCreateSink_FoldernameLogsink.java => SyncCreateSinkFoldernameLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/{SyncCreateSink_OrganizationnameLogsink.java => SyncCreateSinkOrganizationnameLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/{SyncCreateSink_ProjectnameLogsink.java => SyncCreateSinkProjectnameLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/{SyncCreateSink_StringLogsink.java => SyncCreateSinkStringLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/{SyncDeleteExclusion_Logexclusionname.java => SyncDeleteExclusionLogexclusionname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/{SyncDeleteExclusion_String.java => SyncDeleteExclusionString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/{SyncDeleteSink_Logsinkname.java => SyncDeleteSinkLogsinkname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/{SyncDeleteSink_String.java => SyncDeleteSinkString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/{SyncGetExclusion_Logexclusionname.java => SyncGetExclusionLogexclusionname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/{SyncGetExclusion_String.java => SyncGetExclusionString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/{SyncGetSink_Logsinkname.java => SyncGetSinkLogsinkname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/{SyncGetSink_String.java => SyncGetSinkString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{AsyncListBuckets_Paged.java => AsyncListBucketsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{SyncListBuckets_Billingaccountlocationname.java => SyncListBucketsBillingaccountlocationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{SyncListBuckets_Folderlocationname.java => SyncListBucketsFolderlocationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{SyncListBuckets_Locationname.java => SyncListBucketsLocationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{SyncListBuckets_Organizationlocationname.java => SyncListBucketsOrganizationlocationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/{SyncListBuckets_String.java => SyncListBucketsString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{AsyncListExclusions_Paged.java => AsyncListExclusionsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{SyncListExclusions_Billingaccountname.java => SyncListExclusionsBillingaccountname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{SyncListExclusions_Foldername.java => SyncListExclusionsFoldername.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{SyncListExclusions_Organizationname.java => SyncListExclusionsOrganizationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{SyncListExclusions_Projectname.java => SyncListExclusionsProjectname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/{SyncListExclusions_String.java => SyncListExclusionsString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{AsyncListSinks_Paged.java => AsyncListSinksPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{SyncListSinks_Billingaccountname.java => SyncListSinksBillingaccountname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{SyncListSinks_Foldername.java => SyncListSinksFoldername.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{SyncListSinks_Organizationname.java => SyncListSinksOrganizationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{SyncListSinks_Projectname.java => SyncListSinksProjectname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/{SyncListSinks_String.java => SyncListSinksString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/{AsyncListViews_Paged.java => AsyncListViewsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/{SyncListViews_String.java => SyncListViewsString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/{SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java => SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/{SyncUpdateExclusion_StringLogexclusionFieldmask.java => SyncUpdateExclusionStringLogexclusionFieldmask.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/{SyncUpdateSink_LogsinknameLogsink.java => SyncUpdateSinkLogsinknameLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/{SyncUpdateSink_LogsinknameLogsinkFieldmask.java => SyncUpdateSinkLogsinknameLogsinkFieldmask.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/{SyncUpdateSink_StringLogsink.java => SyncUpdateSinkStringLogsink.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/{SyncUpdateSink_StringLogsinkFieldmask.java => SyncUpdateSinkStringLogsinkFieldmask.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/{SyncDeleteLog_Logname.java => SyncDeleteLogLogname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/{SyncDeleteLog_String.java => SyncDeleteLogString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/{AsyncListLogEntries_Paged.java => AsyncListLogEntriesPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/{SyncListLogEntries_ListstringStringString.java => SyncListLogEntriesListstringStringString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{AsyncListLogs_Paged.java => AsyncListLogsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{SyncListLogs_Billingaccountname.java => SyncListLogsBillingaccountname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{SyncListLogs_Foldername.java => SyncListLogsFoldername.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{SyncListLogs_Organizationname.java => SyncListLogsOrganizationname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{SyncListLogs_Projectname.java => SyncListLogsProjectname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/{SyncListLogs_String.java => SyncListLogsString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/{AsyncListMonitoredResourceDescriptors_Paged.java => AsyncListMonitoredResourceDescriptorsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/{SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java => SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/{SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java => SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/{SyncCreateLogMetric_ProjectnameLogmetric.java => SyncCreateLogMetricProjectnameLogmetric.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/{SyncCreateLogMetric_StringLogmetric.java => SyncCreateLogMetricStringLogmetric.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/{SyncDeleteLogMetric_Logmetricname.java => SyncDeleteLogMetricLogmetricname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/{SyncDeleteLogMetric_String.java => SyncDeleteLogMetricString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/{SyncGetLogMetric_Logmetricname.java => SyncGetLogMetricLogmetricname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/{SyncGetLogMetric_String.java => SyncGetLogMetricString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/{AsyncListLogMetrics_Paged.java => AsyncListLogMetricsPaged.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/{SyncListLogMetrics_Projectname.java => SyncListLogMetricsProjectname.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/{SyncListLogMetrics_String.java => SyncListLogMetricsString.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/{SyncUpdateLogMetric_LogmetricnameLogmetric.java => SyncUpdateLogMetricLogmetricnameLogmetric.java} (100%) rename test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/{SyncUpdateLogMetric_StringLogmetric.java => SyncUpdateLogMetricStringLogmetric.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/{SyncCreateSchema_ProjectnameSchemaString.java => SyncCreateSchemaProjectnameSchemaString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/{SyncCreateSchema_StringSchemaString.java => SyncCreateSchemaStringSchemaString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/{SyncDeleteSchema_Schemaname.java => SyncDeleteSchemaSchemaname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/{SyncDeleteSchema_String.java => SyncDeleteSchemaString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/{SyncGetSchema_Schemaname.java => SyncGetSchemaSchemaname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/{SyncGetSchema_String.java => SyncGetSchemaString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/{AsyncListSchemas_Paged.java => AsyncListSchemasPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/{SyncListSchemas_Projectname.java => SyncListSchemasProjectname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/{SyncListSchemas_String.java => SyncListSchemasString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/{SyncValidateSchema_ProjectnameSchema.java => SyncValidateSchemaProjectnameSchema.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/{SyncValidateSchema_StringSchema.java => SyncValidateSchemaStringSchema.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/{SyncAcknowledge_StringListstring.java => SyncAcknowledgeStringListstring.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/{SyncAcknowledge_SubscriptionnameListstring.java => SyncAcknowledgeSubscriptionnameListstring.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/{SyncCreateSnapshot_SnapshotnameString.java => SyncCreateSnapshotSnapshotnameString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/{SyncCreateSnapshot_SnapshotnameSubscriptionname.java => SyncCreateSnapshotSnapshotnameSubscriptionname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/{SyncCreateSnapshot_StringString.java => SyncCreateSnapshotStringString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/{SyncCreateSnapshot_StringSubscriptionname.java => SyncCreateSnapshotStringSubscriptionname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/{SyncCreateSubscription_StringStringPushconfigInt.java => SyncCreateSubscriptionStringStringPushconfigInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/{SyncCreateSubscription_StringTopicnamePushconfigInt.java => SyncCreateSubscriptionStringTopicnamePushconfigInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/{SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java => SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/{SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java => SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/{SyncDeleteSnapshot_Snapshotname.java => SyncDeleteSnapshotSnapshotname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/{SyncDeleteSnapshot_String.java => SyncDeleteSnapshotString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/{SyncDeleteSubscription_String.java => SyncDeleteSubscriptionString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/{SyncDeleteSubscription_Subscriptionname.java => SyncDeleteSubscriptionSubscriptionname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/{SyncGetSnapshot_Snapshotname.java => SyncGetSnapshotSnapshotname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/{SyncGetSnapshot_String.java => SyncGetSnapshotString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/{SyncGetSubscription_String.java => SyncGetSubscriptionString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/{SyncGetSubscription_Subscriptionname.java => SyncGetSubscriptionSubscriptionname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/{AsyncListSnapshots_Paged.java => AsyncListSnapshotsPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/{SyncListSnapshots_Projectname.java => SyncListSnapshotsProjectname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/{SyncListSnapshots_String.java => SyncListSnapshotsString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/{AsyncListSubscriptions_Paged.java => AsyncListSubscriptionsPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/{SyncListSubscriptions_Projectname.java => SyncListSubscriptionsProjectname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/{SyncListSubscriptions_String.java => SyncListSubscriptionsString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/{SyncModifyAckDeadline_StringListstringInt.java => SyncModifyAckDeadlineStringListstringInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/{SyncModifyAckDeadline_SubscriptionnameListstringInt.java => SyncModifyAckDeadlineSubscriptionnameListstringInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/{SyncModifyPushConfig_StringPushconfig.java => SyncModifyPushConfigStringPushconfig.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/{SyncModifyPushConfig_SubscriptionnamePushconfig.java => SyncModifyPushConfigSubscriptionnamePushconfig.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/{SyncPull_StringBooleanInt.java => SyncPullStringBooleanInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/{SyncPull_StringInt.java => SyncPullStringInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/{SyncPull_SubscriptionnameBooleanInt.java => SyncPullSubscriptionnameBooleanInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/{SyncPull_SubscriptionnameInt.java => SyncPullSubscriptionnameInt.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/{SyncCreateTopic_String.java => SyncCreateTopicString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/{SyncCreateTopic_Topicname.java => SyncCreateTopicTopicname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/{SyncDeleteTopic_String.java => SyncDeleteTopicString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/{SyncDeleteTopic_Topicname.java => SyncDeleteTopicTopicname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/{SyncGetTopic_String.java => SyncGetTopicString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/{SyncGetTopic_Topicname.java => SyncGetTopicTopicname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/{AsyncListTopics_Paged.java => AsyncListTopicsPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/{SyncListTopics_Projectname.java => SyncListTopicsProjectname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/{SyncListTopics_String.java => SyncListTopicsString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/{AsyncListTopicSnapshots_Paged.java => AsyncListTopicSnapshotsPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/{SyncListTopicSnapshots_String.java => SyncListTopicSnapshotsString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/{SyncListTopicSnapshots_Topicname.java => SyncListTopicSnapshotsTopicname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/{AsyncListTopicSubscriptions_Paged.java => AsyncListTopicSubscriptionsPaged.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/{SyncListTopicSubscriptions_String.java => SyncListTopicSubscriptionsString.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/{SyncListTopicSubscriptions_Topicname.java => SyncListTopicSubscriptionsTopicname.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/{SyncPublish_StringListpubsubmessage.java => SyncPublishStringListpubsubmessage.java} (100%) rename test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/{SyncPublish_TopicnameListpubsubmessage.java => SyncPublishTopicnameListpubsubmessage.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/{AsyncCreateInstance_LRO.java => AsyncCreateInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/{SyncCreateInstance_LocationnameStringInstance.java => SyncCreateInstanceLocationnameStringInstance.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/{SyncCreateInstance_StringStringInstance.java => SyncCreateInstanceStringStringInstance.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/{AsyncDeleteInstance_LRO.java => AsyncDeleteInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/{SyncDeleteInstance_Instancename.java => SyncDeleteInstanceInstancename.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/{SyncDeleteInstance_String.java => SyncDeleteInstanceString.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/{AsyncExportInstance_LRO.java => AsyncExportInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/{SyncExportInstance_StringOutputconfig.java => SyncExportInstanceStringOutputconfig.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/{AsyncFailoverInstance_LRO.java => AsyncFailoverInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/{SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java => SyncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/{SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java => SyncFailoverInstanceStringFailoverinstancerequestdataprotectionmode.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/{SyncGetInstance_Instancename.java => SyncGetInstanceInstancename.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/{SyncGetInstance_String.java => SyncGetInstanceString.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/{SyncGetInstanceAuthString_Instancename.java => SyncGetInstanceAuthStringInstancename.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/{SyncGetInstanceAuthString_String.java => SyncGetInstanceAuthStringString.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/{AsyncImportInstance_LRO.java => AsyncImportInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/{SyncImportInstance_StringInputconfig.java => SyncImportInstanceStringInputconfig.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/{AsyncListInstances_Paged.java => AsyncListInstancesPaged.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/{SyncListInstances_Locationname.java => SyncListInstancesLocationname.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/{SyncListInstances_String.java => SyncListInstancesString.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/{AsyncRescheduleMaintenance_LRO.java => AsyncRescheduleMaintenanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/{SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java => SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/{SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java => SyncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/{AsyncUpdateInstance_LRO.java => AsyncUpdateInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/{SyncUpdateInstance_FieldmaskInstance.java => SyncUpdateInstanceFieldmaskInstance.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/{AsyncUpgradeInstance_LRO.java => AsyncUpgradeInstanceLRO.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/{SyncUpgradeInstance_InstancenameString.java => SyncUpgradeInstanceInstancenameString.java} (100%) rename test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/{SyncUpgradeInstance_StringString.java => SyncUpgradeInstanceStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/{SyncCreate_SetCredentialsProvider.java => SyncCreateSetCredentialsProvider.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/{SyncCreate_SetEndpoint.java => SyncCreateSetEndpoint.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/{SyncCreateBucket_ProjectnameBucketString.java => SyncCreateBucketProjectnameBucketString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/{SyncCreateBucket_StringBucketString.java => SyncCreateBucketStringBucketString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/{SyncCreateHmacKey_ProjectnameString.java => SyncCreateHmacKeyProjectnameString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/{SyncCreateHmacKey_StringString.java => SyncCreateHmacKeyStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/{SyncCreateNotification_ProjectnameNotification.java => SyncCreateNotificationProjectnameNotification.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/{SyncCreateNotification_StringNotification.java => SyncCreateNotificationStringNotification.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/{SyncDeleteBucket_Bucketname.java => SyncDeleteBucketBucketname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/{SyncDeleteBucket_String.java => SyncDeleteBucketString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/{SyncDeleteHmacKey_StringProjectname.java => SyncDeleteHmacKeyStringProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/{SyncDeleteHmacKey_StringString.java => SyncDeleteHmacKeyStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/{SyncDeleteNotification_Notificationname.java => SyncDeleteNotificationNotificationname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/{SyncDeleteNotification_String.java => SyncDeleteNotificationString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/{SyncDeleteObject_StringString.java => SyncDeleteObjectStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/{SyncDeleteObject_StringStringLong.java => SyncDeleteObjectStringStringLong.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/{SyncGetBucket_Bucketname.java => SyncGetBucketBucketname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/{SyncGetBucket_String.java => SyncGetBucketString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/{SyncGetHmacKey_StringProjectname.java => SyncGetHmacKeyStringProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/{SyncGetHmacKey_StringString.java => SyncGetHmacKeyStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/{SyncGetIamPolicy_Resourcename.java => SyncGetIamPolicyResourcename.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/{SyncGetIamPolicy_String.java => SyncGetIamPolicyString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/{SyncGetNotification_Bucketname.java => SyncGetNotificationBucketname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/{SyncGetNotification_String.java => SyncGetNotificationString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/{SyncGetObject_StringString.java => SyncGetObjectStringString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/{SyncGetObject_StringStringLong.java => SyncGetObjectStringStringLong.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/{SyncGetServiceAccount_Projectname.java => SyncGetServiceAccountProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/{SyncGetServiceAccount_String.java => SyncGetServiceAccountString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/{AsyncListBuckets_Paged.java => AsyncListBucketsPaged.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/{SyncListBuckets_Projectname.java => SyncListBucketsProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/{SyncListBuckets_String.java => SyncListBucketsString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/{AsyncListHmacKeys_Paged.java => AsyncListHmacKeysPaged.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/{SyncListHmacKeys_Projectname.java => SyncListHmacKeysProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/{SyncListHmacKeys_String.java => SyncListHmacKeysString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/{AsyncListNotifications_Paged.java => AsyncListNotificationsPaged.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/{SyncListNotifications_Projectname.java => SyncListNotificationsProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/{SyncListNotifications_String.java => SyncListNotificationsString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/{AsyncListObjects_Paged.java => AsyncListObjectsPaged.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/{SyncListObjects_Projectname.java => SyncListObjectsProjectname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/{SyncListObjects_String.java => SyncListObjectsString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/{SyncLockBucketRetentionPolicy_Bucketname.java => SyncLockBucketRetentionPolicyBucketname.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/{SyncLockBucketRetentionPolicy_String.java => SyncLockBucketRetentionPolicyString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/{SyncQueryWriteStatus_String.java => SyncQueryWriteStatusString.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/{SyncSetIamPolicy_ResourcenamePolicy.java => SyncSetIamPolicyResourcenamePolicy.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/{SyncSetIamPolicy_StringPolicy.java => SyncSetIamPolicyStringPolicy.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/{SyncTestIamPermissions_ResourcenameListstring.java => SyncTestIamPermissionsResourcenameListstring.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/{SyncTestIamPermissions_StringListstring.java => SyncTestIamPermissionsStringListstring.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/{SyncUpdateBucket_BucketFieldmask.java => SyncUpdateBucketBucketFieldmask.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/{SyncUpdateHmacKey_HmackeymetadataFieldmask.java => SyncUpdateHmacKeyHmackeymetadataFieldmask.java} (100%) rename test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/{SyncUpdateObject_ObjectFieldmask.java => SyncUpdateObjectObjectFieldmask.java} (100%) diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunning_LRO.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/analyzeiampolicylongrunning/AsyncAnalyzeIamPolicyLongrunningLRO.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeedString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeed_String.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/createfeed/SyncCreateFeedString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeedFeedname.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_Feedname.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeedFeedname.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeedString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeed_String.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/deletefeed/SyncDeleteFeedString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssetsLRO.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssets_LRO.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/exportassets/AsyncExportAssetsLRO.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeedFeedname.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_Feedname.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeedFeedname.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeedString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeed_String.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/getfeed/SyncGetFeedString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssetsPaged.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssets_Paged.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/AsyncListAssetsPaged.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssetsResourcename.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_Resourcename.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssetsResourcename.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssetsString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssets_String.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listassets/SyncListAssetsString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeedsString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeeds_String.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/listfeeds/SyncListFeedsString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPolicies_Paged.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/AsyncSearchAllIamPoliciesPaged.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPolicies_StringString.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchalliampolicies/SyncSearchAllIamPoliciesStringString.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResourcesPaged.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResources_Paged.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/AsyncSearchAllResourcesPaged.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResourcesStringStringListstring.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResources_StringStringListstring.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/searchallresources/SyncSearchAllResourcesStringStringListstring.java diff --git a/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.java b/test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeedFeed.java similarity index 100% rename from test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeed_Feed.java rename to test/integration/goldens/asset/samples/snippets/generated/main/java/com/google/cloud/asset/v1/assetserviceclient/updatefeed/SyncUpdateFeedFeed.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutation.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutation.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_StringBytestringRowfilterListmutationListmutationString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowStringBytestringRowfilterListmutationListmutationString.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutation.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutation.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRow_TablenameBytestringRowfilterListmutationListmutationString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/checkandmutaterow/SyncCheckAndMutateRowTablenameBytestringRowfilterListmutationListmutationString.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowStringBytestringListmutation.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutation.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowStringBytestringListmutation.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowStringBytestringListmutationString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_StringBytestringListmutationString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowStringBytestringListmutationString.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowTablenameBytestringListmutation.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutation.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowTablenameBytestringListmutation.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRow_TablenameBytestringListmutationString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/mutaterow/SyncMutateRowTablenameBytestringListmutationString.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriterule.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriterule.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_StringBytestringListreadmodifywriteruleString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowStringBytestringListreadmodifywriteruleString.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriterule.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriterule.java diff --git a/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java b/test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java similarity index 100% rename from test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRow_TablenameBytestringListreadmodifywriteruleString.java rename to test/integration/goldens/bigtable/samples/snippets/generated/main/java/com/google/cloud/bigtable/data/v2/basebigtabledataclient/readmodifywriterow/SyncReadModifyWriteRowTablenameBytestringListreadmodifywriteruleString.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedListPaged.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedList_Paged.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/AsyncAggregatedListPaged.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedListString.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedList_String.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/aggregatedlist/SyncAggregatedListString.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDeleteLRO.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDelete_LRO.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/AsyncDeleteLRO.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDeleteStringStringString.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDelete_StringStringString.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/delete/SyncDeleteStringStringString.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsertLRO.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsert_LRO.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/AsyncInsertLRO.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsertStringStringAddress.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsert_StringStringAddress.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/insert/SyncInsertStringStringAddress.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncListPaged.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncList_Paged.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/AsyncListPaged.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncListStringStringString.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncList_StringStringString.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/addressesclient/list/SyncListStringStringString.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGetStringStringString.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGet_StringStringString.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/get/SyncGetStringStringString.java diff --git a/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.java b/test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWaitStringStringString.java similarity index 100% rename from test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWait_StringStringString.java rename to test/integration/goldens/compute/samples/snippets/generated/main/java/com/google/cloud/compute/v1small/regionoperationsclient/wait/SyncWaitStringStringString.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessTokenServiceaccountnameListstringListstringDuration.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_ServiceaccountnameListstringListstringDuration.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessTokenServiceaccountnameListstringListstringDuration.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessTokenStringListstringListstringDuration.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessToken_StringListstringListstringDuration.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateaccesstoken/SyncGenerateAccessTokenStringListstringListstringDuration.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdTokenServiceaccountnameListstringStringBoolean.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_ServiceaccountnameListstringStringBoolean.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdTokenServiceaccountnameListstringStringBoolean.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdTokenStringListstringStringBoolean.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdToken_StringListstringStringBoolean.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/generateidtoken/SyncGenerateIdTokenStringListstringStringBoolean.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlobServiceaccountnameListstringBytestring.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_ServiceaccountnameListstringBytestring.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlobServiceaccountnameListstringBytestring.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlobStringListstringBytestring.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlob_StringListstringBytestring.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signblob/SyncSignBlobStringListstringBytestring.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwtServiceaccountnameListstringString.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_ServiceaccountnameListstringString.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwtServiceaccountnameListstringString.java diff --git a/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.java b/test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwtStringListstringString.java similarity index 100% rename from test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwt_StringListstringString.java rename to test/integration/goldens/credentials/samples/snippets/generated/main/java/com/google/cloud/iam/credentials/v1/iamcredentialsclient/signjwt/SyncSignJwtStringListstringString.java diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/iam/samples/snippets/generated/main/java/com/google/iam/v1/iampolicyclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecryptCryptokeyversionnameBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_CryptokeyversionnameBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecryptCryptokeyversionnameBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecryptStringBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecrypt_StringBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricdecrypt/SyncAsymmetricDecryptStringBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSignCryptokeyversionnameDigest.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_CryptokeyversionnameDigest.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSignCryptokeyversionnameDigest.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSignStringDigest.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSign_StringDigest.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/asymmetricsign/SyncAsymmetricSignStringDigest.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKeyKeyringnameStringCryptokey.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_KeyringnameStringCryptokey.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKeyKeyringnameStringCryptokey.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKeyStringStringCryptokey.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKey_StringStringCryptokey.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokey/SyncCreateCryptoKeyStringStringCryptokey.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersionCryptokeynameCryptokeyversion.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_CryptokeynameCryptokeyversion.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersionCryptokeynameCryptokeyversion.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersionStringCryptokeyversion.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersion_StringCryptokeyversion.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createcryptokeyversion/SyncCreateCryptoKeyVersionStringCryptokeyversion.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJobKeyringnameStringImportjob.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_KeyringnameStringImportjob.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJobKeyringnameStringImportjob.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJobStringStringImportjob.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJob_StringStringImportjob.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createimportjob/SyncCreateImportJobStringStringImportjob.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRingLocationnameStringKeyring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_LocationnameStringKeyring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRingLocationnameStringKeyring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRingStringStringKeyring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRing_StringStringKeyring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/createkeyring/SyncCreateKeyRingStringStringKeyring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecryptCryptokeynameBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_CryptokeynameBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecryptCryptokeynameBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecryptStringBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecrypt_StringBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/decrypt/SyncDecryptStringBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersionCryptokeyversionname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_Cryptokeyversionname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersionCryptokeyversionname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersionString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersion_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/destroycryptokeyversion/SyncDestroyCryptoKeyVersionString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncryptResourcenameBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_ResourcenameBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncryptResourcenameBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncryptStringBytestring.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncrypt_StringBytestring.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/encrypt/SyncEncryptStringBytestring.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKeyCryptokeyname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_Cryptokeyname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKeyCryptokeyname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKeyString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKey_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokey/SyncGetCryptoKeyString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersionCryptokeyversionname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_Cryptokeyversionname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersionCryptokeyversionname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersionString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersion_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getcryptokeyversion/SyncGetCryptoKeyVersionString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJobImportjobname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_Importjobname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJobImportjobname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJobString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJob_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getimportjob/SyncGetImportJobString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRingKeyringname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_Keyringname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRingKeyringname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRingString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRing_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getkeyring/SyncGetKeyRingString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKeyCryptokeyversionname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_Cryptokeyversionname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKeyCryptokeyversionname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKeyString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKey_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/getpublickey/SyncGetPublicKeyString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeysPaged.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeys_Paged.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/AsyncListCryptoKeysPaged.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeysKeyringname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_Keyringname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeysKeyringname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeysString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeys_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeys/SyncListCryptoKeysString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersionsPaged.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersions_Paged.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/AsyncListCryptoKeyVersionsPaged.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersionsCryptokeyname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_Cryptokeyname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersionsCryptokeyname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersionsString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersions_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listcryptokeyversions/SyncListCryptoKeyVersionsString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobsPaged.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobs_Paged.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/AsyncListImportJobsPaged.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobsKeyringname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_Keyringname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobsKeyringname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobsString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobs_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listimportjobs/SyncListImportJobsString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRingsPaged.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRings_Paged.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/AsyncListKeyRingsPaged.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRingsLocationname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_Locationname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRingsLocationname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRingsString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRings_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listkeyrings/SyncListKeyRingsString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocationsPaged.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocations_Paged.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/listlocations/AsyncListLocationsPaged.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersionCryptokeyversionname.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_Cryptokeyversionname.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersionCryptokeyversionname.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersionString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersion_String.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/restorecryptokeyversion/SyncRestoreCryptoKeyVersionString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKeyCryptokeyFieldmask.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKey_CryptokeyFieldmask.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokey/SyncUpdateCryptoKeyCryptokeyFieldmask.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersionCryptokeynameString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_CryptokeynameString.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersionCryptokeynameString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersionStringString.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersion_StringString.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyprimaryversion/SyncUpdateCryptoKeyPrimaryVersionStringString.java diff --git a/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java b/test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersionCryptokeyversionFieldmask.java similarity index 100% rename from test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersion_CryptokeyversionFieldmask.java rename to test/integration/goldens/kms/samples/snippets/generated/main/java/com/google/cloud/kms/v1/keymanagementserviceclient/updatecryptokeyversion/SyncUpdateCryptoKeyVersionCryptokeyversionFieldmask.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBookShelfnameBook.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_ShelfnameBook.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBookShelfnameBook.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBookStringBook.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBook_StringBook.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createbook/SyncCreateBookStringBook.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelfShelf.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelf_Shelf.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/createshelf/SyncCreateShelfShelf.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBookBookname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_Bookname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBookBookname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBookString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBook_String.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deletebook/SyncDeleteBookString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelfShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_Shelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelfShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelfString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelf_String.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/deleteshelf/SyncDeleteShelfString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBookBookname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_Bookname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBookBookname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBookString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBook_String.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getbook/SyncGetBookString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelfShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_Shelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelfShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelfString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelf_String.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/getshelf/SyncGetShelfString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooksPaged.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooks_Paged.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/AsyncListBooksPaged.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooksShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_Shelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooksShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooksString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooks_String.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listbooks/SyncListBooksString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelvesPaged.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelves_Paged.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/listshelves/AsyncListShelvesPaged.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesShelfnameShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameShelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesShelfnameShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesShelfnameString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_ShelfnameString.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesShelfnameString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesStringShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringShelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesStringShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesStringString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelves_StringString.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/mergeshelves/SyncMergeShelvesStringString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookBooknameShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameShelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookBooknameShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookBooknameString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_BooknameString.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookBooknameString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookStringShelfname.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringShelfname.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookStringShelfname.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookStringString.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBook_StringString.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/movebook/SyncMoveBookStringString.java diff --git a/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.java b/test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBookBookFieldmask.java similarity index 100% rename from test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBook_BookFieldmask.java rename to test/integration/goldens/library/samples/snippets/generated/main/java/com/google/cloud/example/library/v1/libraryserviceclient/updatebook/SyncUpdateBookBookFieldmask.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_BillingaccountnameLogexclusion.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionBillingaccountnameLogexclusion.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_FoldernameLogexclusion.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionFoldernameLogexclusion.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_OrganizationnameLogexclusion.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionOrganizationnameLogexclusion.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_ProjectnameLogexclusion.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionProjectnameLogexclusion.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionStringLogexclusion.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusion_StringLogexclusion.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createexclusion/SyncCreateExclusionStringLogexclusion.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkBillingaccountnameLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_BillingaccountnameLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkBillingaccountnameLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkFoldernameLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_FoldernameLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkFoldernameLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkOrganizationnameLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_OrganizationnameLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkOrganizationnameLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkProjectnameLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_ProjectnameLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkProjectnameLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkStringLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSink_StringLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/createsink/SyncCreateSinkStringLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusionLogexclusionname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_Logexclusionname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusionLogexclusionname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusionString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusion_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deleteexclusion/SyncDeleteExclusionString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSinkLogsinkname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_Logsinkname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSinkLogsinkname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSinkString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSink_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/deletesink/SyncDeleteSinkString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusionLogexclusionname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_Logexclusionname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusionLogexclusionname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusionString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusion_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getexclusion/SyncGetExclusionString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSinkLogsinkname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_Logsinkname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSinkLogsinkname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSinkString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSink_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/getsink/SyncGetSinkString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBucketsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBuckets_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/AsyncListBucketsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsBillingaccountlocationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Billingaccountlocationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsBillingaccountlocationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsFolderlocationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Folderlocationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsFolderlocationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsLocationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Locationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsLocationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsOrganizationlocationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_Organizationlocationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsOrganizationlocationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBuckets_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listbuckets/SyncListBucketsString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusionsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusions_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/AsyncListExclusionsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsBillingaccountname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Billingaccountname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsBillingaccountname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsFoldername.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Foldername.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsFoldername.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsOrganizationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Organizationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsOrganizationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsProjectname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_Projectname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsProjectname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusions_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listexclusions/SyncListExclusionsString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinksPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinks_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/AsyncListSinksPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksBillingaccountname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Billingaccountname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksBillingaccountname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksFoldername.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Foldername.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksFoldername.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksOrganizationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Organizationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksOrganizationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksProjectname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_Projectname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksProjectname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinks_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listsinks/SyncListSinksString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViewsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViews_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/AsyncListViewsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViewsString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViews_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/listviews/SyncListViewsString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_LogexclusionnameLogexclusionFieldmask.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusionLogexclusionnameLogexclusionFieldmask.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusion_StringLogexclusionFieldmask.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updateexclusion/SyncUpdateExclusionStringLogexclusionFieldmask.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkLogsinknameLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkLogsinknameLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_LogsinknameLogsinkFieldmask.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkLogsinknameLogsinkFieldmask.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkStringLogsink.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsink.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkStringLogsink.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSink_StringLogsinkFieldmask.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/configclient/updatesink/SyncUpdateSinkStringLogsinkFieldmask.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLogLogname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_Logname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLogLogname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLogString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLog_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/deletelog/SyncDeleteLogString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntriesPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntries_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/AsyncListLogEntriesPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntriesListstringStringString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntries_ListstringStringString.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogentries/SyncListLogEntriesListstringStringString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogs_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/AsyncListLogsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsBillingaccountname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Billingaccountname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsBillingaccountname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsFoldername.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Foldername.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsFoldername.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsOrganizationname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Organizationname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsOrganizationname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsProjectname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_Projectname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsProjectname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogs_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listlogs/SyncListLogsString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptors_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/listmonitoredresourcedescriptors/AsyncListMonitoredResourceDescriptorsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_LognameMonitoredresourceMapstringstringListlogentry.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntriesLognameMonitoredresourceMapstringstringListlogentry.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntries_StringMonitoredresourceMapstringstringListlogentry.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/loggingclient/writelogentries/SyncWriteLogEntriesStringMonitoredresourceMapstringstringListlogentry.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_ProjectnameLogmetric.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetricProjectnameLogmetric.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetricStringLogmetric.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetric_StringLogmetric.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/createlogmetric/SyncCreateLogMetricStringLogmetric.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetricLogmetricname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_Logmetricname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetricLogmetricname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetricString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetric_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/deletelogmetric/SyncDeleteLogMetricString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetricLogmetricname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_Logmetricname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetricLogmetricname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetricString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetric_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/getlogmetric/SyncGetLogMetricString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetricsPaged.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetrics_Paged.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/AsyncListLogMetricsPaged.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetricsProjectname.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_Projectname.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetricsProjectname.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetricsString.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetrics_String.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/listlogmetrics/SyncListLogMetricsString.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_LogmetricnameLogmetric.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetricLogmetricnameLogmetric.java diff --git a/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.java b/test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java similarity index 100% rename from test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetric_StringLogmetric.java rename to test/integration/goldens/logging/samples/snippets/generated/main/java/com/google/cloud/logging/v2/metricsclient/updatelogmetric/SyncUpdateLogMetricStringLogmetric.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchemaProjectnameSchemaString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_ProjectnameSchemaString.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchemaProjectnameSchemaString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchemaStringSchemaString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchema_StringSchemaString.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/createschema/SyncCreateSchemaStringSchemaString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchemaSchemaname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_Schemaname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchemaSchemaname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchemaString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchema_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/deleteschema/SyncDeleteSchemaString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchemaSchemaname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_Schemaname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchemaSchemaname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchemaString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchema_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/getschema/SyncGetSchemaString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemasPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemas_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/AsyncListSchemasPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemasProjectname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_Projectname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemasProjectname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemasString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemas_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/listschemas/SyncListSchemasString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchemaProjectnameSchema.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_ProjectnameSchema.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchemaProjectnameSchema.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchemaStringSchema.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchema_StringSchema.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/schemaserviceclient/validateschema/SyncValidateSchemaStringSchema.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledgeStringListstring.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_StringListstring.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledgeStringListstring.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledge_SubscriptionnameListstring.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/acknowledge/SyncAcknowledgeSubscriptionnameListstring.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotSnapshotnameString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameString.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotSnapshotnameString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_SnapshotnameSubscriptionname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotSnapshotnameSubscriptionname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotStringString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringString.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotStringString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshot_StringSubscriptionname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsnapshot/SyncCreateSnapshotStringSubscriptionname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringStringPushconfigInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionStringStringPushconfigInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_StringTopicnamePushconfigInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionStringTopicnamePushconfigInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameStringPushconfigInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionSubscriptionnameStringPushconfigInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscription_SubscriptionnameTopicnamePushconfigInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/createsubscription/SyncCreateSubscriptionSubscriptionnameTopicnamePushconfigInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshotSnapshotname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_Snapshotname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshotSnapshotname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshotString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshot_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesnapshot/SyncDeleteSnapshotString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscriptionString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscriptionString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscription_Subscriptionname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/deletesubscription/SyncDeleteSubscriptionSubscriptionname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshotSnapshotname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_Snapshotname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshotSnapshotname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshotString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshot_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsnapshot/SyncGetSnapshotString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscriptionString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscriptionString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscriptionSubscriptionname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscription_Subscriptionname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/getsubscription/SyncGetSubscriptionSubscriptionname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshotsPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshots_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/AsyncListSnapshotsPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshotsProjectname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_Projectname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshotsProjectname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshotsString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshots_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsnapshots/SyncListSnapshotsString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptionsPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptions_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/AsyncListSubscriptionsPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptionsProjectname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_Projectname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptionsProjectname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptionsString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptions_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/listsubscriptions/SyncListSubscriptionsString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_StringListstringInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadlineStringListstringInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadline_SubscriptionnameListstringInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifyackdeadline/SyncModifyAckDeadlineSubscriptionnameListstringInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfigStringPushconfig.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_StringPushconfig.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfigStringPushconfig.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfig_SubscriptionnamePushconfig.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/modifypushconfig/SyncModifyPushConfigSubscriptionnamePushconfig.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullStringBooleanInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringBooleanInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullStringBooleanInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullStringInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_StringInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullStringInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullSubscriptionnameBooleanInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameBooleanInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullSubscriptionnameBooleanInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullSubscriptionnameInt.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPull_SubscriptionnameInt.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/subscriptionadminclient/pull/SyncPullSubscriptionnameInt.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopicString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopicString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopicTopicname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopic_Topicname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/createtopic/SyncCreateTopicTopicname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopicString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopicString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopicTopicname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopic_Topicname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/deletetopic/SyncDeleteTopicTopicname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopicString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopicString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopicTopicname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopic_Topicname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/gettopic/SyncGetTopicTopicname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopicsPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopics_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/AsyncListTopicsPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopicsProjectname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_Projectname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopicsProjectname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopicsString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopics_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopics/SyncListTopicsString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshots_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/AsyncListTopicSnapshotsPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshotsString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshotsString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshots_Topicname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsnapshots/SyncListTopicSnapshotsTopicname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptions_Paged.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/AsyncListTopicSubscriptionsPaged.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptionsString.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_String.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptionsString.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptions_Topicname.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/listtopicsubscriptions/SyncListTopicSubscriptionsTopicname.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublishStringListpubsubmessage.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_StringListpubsubmessage.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublishStringListpubsubmessage.java diff --git a/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.java b/test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublishTopicnameListpubsubmessage.java similarity index 100% rename from test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublish_TopicnameListpubsubmessage.java rename to test/integration/goldens/pubsub/samples/snippets/generated/main/java/com/google/cloud/pubsub/v1/topicadminclient/publish/SyncPublishTopicnameListpubsubmessage.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/AsyncCreateInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstanceLocationnameStringInstance.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_LocationnameStringInstance.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstanceLocationnameStringInstance.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstanceStringStringInstance.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstance_StringStringInstance.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/createinstance/SyncCreateInstanceStringStringInstance.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/AsyncDeleteInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstanceInstancename.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_Instancename.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstanceInstancename.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstanceString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstance_String.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/deleteinstance/SyncDeleteInstanceString.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/AsyncExportInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstanceStringOutputconfig.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstance_StringOutputconfig.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/exportinstance/SyncExportInstanceStringOutputconfig.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/AsyncFailoverInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_InstancenameFailoverinstancerequestdataprotectionmode.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstanceInstancenameFailoverinstancerequestdataprotectionmode.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstanceStringFailoverinstancerequestdataprotectionmode.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstance_StringFailoverinstancerequestdataprotectionmode.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/failoverinstance/SyncFailoverInstanceStringFailoverinstancerequestdataprotectionmode.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstanceInstancename.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_Instancename.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstanceInstancename.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstanceString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstance_String.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstance/SyncGetInstanceString.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthStringInstancename.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_Instancename.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthStringInstancename.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthStringString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthString_String.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/getinstanceauthstring/SyncGetInstanceAuthStringString.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/AsyncImportInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstanceStringInputconfig.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstance_StringInputconfig.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/importinstance/SyncImportInstanceStringInputconfig.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstancesPaged.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstances_Paged.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/AsyncListInstancesPaged.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstancesLocationname.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_Locationname.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstancesLocationname.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstancesString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstances_String.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/listinstances/SyncListInstancesString.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/AsyncRescheduleMaintenanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_InstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenanceInstancenameReschedulemaintenancerequestrescheduletypeTimestamp.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenance_StringReschedulemaintenancerequestrescheduletypeTimestamp.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/reschedulemaintenance/SyncRescheduleMaintenanceStringReschedulemaintenancerequestrescheduletypeTimestamp.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/AsyncUpdateInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstanceFieldmaskInstance.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstance_FieldmaskInstance.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/updateinstance/SyncUpdateInstanceFieldmaskInstance.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstanceLRO.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstance_LRO.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/AsyncUpgradeInstanceLRO.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstanceInstancenameString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_InstancenameString.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstanceInstancenameString.java diff --git a/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.java b/test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstanceStringString.java similarity index 100% rename from test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstance_StringString.java rename to test/integration/goldens/redis/samples/snippets/generated/main/java/com/google/cloud/redis/v1beta1/cloudredisclient/upgradeinstance/SyncUpgradeInstanceStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreateSetCredentialsProvider.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetCredentialsProvider.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreateSetCredentialsProvider.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreateSetEndpoint.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreate_SetEndpoint.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/create/SyncCreateSetEndpoint.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucketProjectnameBucketString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_ProjectnameBucketString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucketProjectnameBucketString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucketStringBucketString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucket_StringBucketString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createbucket/SyncCreateBucketStringBucketString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKeyProjectnameString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_ProjectnameString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKeyProjectnameString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKeyStringString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKey_StringString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createhmackey/SyncCreateHmacKeyStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotificationProjectnameNotification.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_ProjectnameNotification.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotificationProjectnameNotification.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotificationStringNotification.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotification_StringNotification.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/createnotification/SyncCreateNotificationStringNotification.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucketBucketname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_Bucketname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucketBucketname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucketString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucket_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletebucket/SyncDeleteBucketString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKeyStringProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringProjectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKeyStringProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKeyStringString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKey_StringString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletehmackey/SyncDeleteHmacKeyStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotificationNotificationname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_Notificationname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotificationNotificationname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotificationString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotification_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deletenotification/SyncDeleteNotificationString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObjectStringString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObjectStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObjectStringStringLong.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObject_StringStringLong.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/deleteobject/SyncDeleteObjectStringStringLong.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucketBucketname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_Bucketname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucketBucketname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucketString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucket_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getbucket/SyncGetBucketString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKeyStringProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringProjectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKeyStringProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKeyStringString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKey_StringString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/gethmackey/SyncGetHmacKeyStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicyResourcename.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_Resourcename.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicyResourcename.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicyString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicy_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getiampolicy/SyncGetIamPolicyString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotificationBucketname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_Bucketname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotificationBucketname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotificationString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotification_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getnotification/SyncGetNotificationString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObjectStringString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringString.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObjectStringString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObjectStringStringLong.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObject_StringStringLong.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getobject/SyncGetObjectStringStringLong.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccountProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_Projectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccountProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccountString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccount_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/getserviceaccount/SyncGetServiceAccountString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBucketsPaged.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBuckets_Paged.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/AsyncListBucketsPaged.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBucketsProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_Projectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBucketsProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBucketsString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBuckets_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listbuckets/SyncListBucketsString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeysPaged.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeys_Paged.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/AsyncListHmacKeysPaged.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeysProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_Projectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeysProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeysString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeys_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listhmackeys/SyncListHmacKeysString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotificationsPaged.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotifications_Paged.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/AsyncListNotificationsPaged.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotificationsProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_Projectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotificationsProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotificationsString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotifications_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listnotifications/SyncListNotificationsString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjectsPaged.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjects_Paged.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/AsyncListObjectsPaged.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjectsProjectname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_Projectname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjectsProjectname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjectsString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjects_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/listobjects/SyncListObjectsString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_Bucketname.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyBucketname.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicy_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/lockbucketretentionpolicy/SyncLockBucketRetentionPolicyString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatusString.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatus_String.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/querywritestatus/SyncQueryWriteStatusString.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_ResourcenamePolicy.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicyResourcenamePolicy.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicyStringPolicy.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicy_StringPolicy.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/setiampolicy/SyncSetIamPolicyStringPolicy.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_ResourcenameListstring.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissionsResourcenameListstring.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissionsStringListstring.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissions_StringListstring.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/testiampermissions/SyncTestIamPermissionsStringListstring.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucketBucketFieldmask.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucket_BucketFieldmask.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatebucket/SyncUpdateBucketBucketFieldmask.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKey_HmackeymetadataFieldmask.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updatehmackey/SyncUpdateHmacKeyHmackeymetadataFieldmask.java diff --git a/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.java b/test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObjectObjectFieldmask.java similarity index 100% rename from test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObject_ObjectFieldmask.java rename to test/integration/goldens/storage/samples/snippets/generated/main/java/com/google/storage/v2/storageclient/updateobject/SyncUpdateObjectObjectFieldmask.java From 9df65564df6217d9fa97b6fe26b716309c10fb19 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 14 Apr 2022 18:55:33 -0700 Subject: [PATCH 09/18] refactor: keep samples seperate from gapic jar --- rules_java_gapic/java_gapic.bzl | 67 ++++++++++++++++++++++++++--- rules_java_gapic/java_gapic_pkg.bzl | 27 +++++++++--- 2 files changed, 82 insertions(+), 12 deletions(-) diff --git a/rules_java_gapic/java_gapic.bzl b/rules_java_gapic/java_gapic.bzl index c836a57634..cf5f1f6d55 100644 --- a/rules_java_gapic/java_gapic.bzl +++ b/rules_java_gapic/java_gapic.bzl @@ -37,11 +37,7 @@ def _java_gapic_postprocess_srcjar_impl(ctx): WORKING_DIR=`pwd` # Main source files. - mkdir -p $WORKING_DIR/tmp/ - mv {output_dir_path}/src/main/java $WORKING_DIR/tmp - mkdir -p $WORKING_DIR/tmp/samples - mv $WORKING_DIR/{output_dir_path}/samples $WORKING_DIR/tmp/samples - cd $WORKING_DIR/tmp + cd {output_dir_path}/src/main/java zip -r $WORKING_DIR/{output_srcjar_name}.srcjar ./ # Resource name source files. @@ -110,6 +106,61 @@ _java_gapic_postprocess_srcjar = rule( implementation = _java_gapic_postprocess_srcjar_impl, ) +def _java_gapic_samples_srcjar_impl(ctx): + gapic_srcjar = ctx.file.gapic_srcjar + output_srcjar_name = ctx.label.name + output_samples = ctx.outputs.samples + formatter = ctx.executable.formatter + + output_dir_name = ctx.label.name + output_dir_path = "%s/%s" % (output_samples.dirname, output_dir_name) + + script = """ + unzip -q {gapic_srcjar} + # Sync'd to the output file name in Writer.java. + unzip -q temp-codegen.srcjar -d {output_dir_path} + # This may fail if there are spaces and/or too many files (exceed max length of command length). + {formatter} --replace $(find {output_dir_path} -type f -printf "%p ") + WORKING_DIR=`pwd` + + # Sample source files. + cd $WORKING_DIR/{output_dir_path}/samples/snippets/generated/src/main/java + zip -r $WORKING_DIR/{output_srcjar_name}-samples.srcjar ./ + + cd $WORKING_DIR + + mv {output_srcjar_name}-samples.srcjar {output_samples} + """.format( + gapic_srcjar = gapic_srcjar.path, + output_srcjar_name = output_srcjar_name, + formatter = formatter, + output_dir_name = output_dir_name, + output_dir_path = output_dir_path, + output_samples = output_samples.path, + ) + + ctx.actions.run_shell( + inputs = [gapic_srcjar], + tools = [formatter], + command = script, + outputs = [output_samples], + ) + +_java_gapic_samples_srcjar = rule( + attrs = { + "gapic_srcjar": attr.label(mandatory = True, allow_single_file = True), + "formatter": attr.label( + default = Label("//:google_java_format_binary"), + executable = True, + cfg = "host", + ), + }, + outputs = { + "samples": "%{name}-samples.srcjar", + }, + implementation = _java_gapic_samples_srcjar_impl, +) + def _extract_common_proto_dep(dep): return dep[dep.index("/"):] if "//google" in dep else dep @@ -210,6 +261,12 @@ def java_gapic_library( **kwargs ) + _java_gapic_samples_srcjar( + name = "%s_samples" % name, + gapic_srcjar = "%s.srcjar" % raw_srcjar_name, + **kwargs + ) + resource_name_name = "%s_resource_name" % name resource_name_deps = [resource_name_name] native.java_library( diff --git a/rules_java_gapic/java_gapic_pkg.bzl b/rules_java_gapic/java_gapic_pkg.bzl index 690954fd92..cb51482300 100644 --- a/rules_java_gapic/java_gapic_pkg.bzl +++ b/rules_java_gapic/java_gapic_pkg.bzl @@ -63,6 +63,11 @@ def _gapic_pkg_tar_impl(ctx): for f in dep.files.to_list(): deps.append(f) + samples =[] + for s in ctx.attr.samples: + for f in s.files.to_list(): + samples.append(f) + paths = _construct_package_dir_paths( ctx.attr.package_dir, ctx.outputs.pkg, @@ -70,16 +75,17 @@ def _gapic_pkg_tar_impl(ctx): ) script = """ + for s in {samples}; do + mkdir -p {package_dir_path}/{tar_cd_suffix}/{tar_prefix}/samples/snippets/generated/ + unzip -q ./$s -d {package_dir_path}/{tar_cd_suffix}/{tar_prefix}/samples/snippets/generated/ + done + mkdir -p {package_dir_path} for dep in {deps}; do tar -xzpf $dep -C {package_dir_path} done cd {package_dir_path}/{tar_cd_suffix} - if [ -d "{package_dir}/samples" ]; then - mv {package_dir}/samples {tar_prefix} - fi - tar -zchpf {tar_prefix}/{package_dir}.tar.gz {tar_prefix}/* cd - mv {package_dir_path}/{package_dir}.tar.gz {pkg} @@ -88,13 +94,14 @@ def _gapic_pkg_tar_impl(ctx): deps = " ".join(["'%s'" % d.path for d in deps]), package_dir_path = paths.package_dir_path, package_dir = paths.package_dir, + samples = " ".join(["'%s'" % s.path for s in samples]), pkg = ctx.outputs.pkg.path, tar_cd_suffix = paths.tar_cd_suffix, tar_prefix = paths.tar_prefix, ) ctx.actions.run_shell( - inputs = deps, + inputs = deps + samples, command = script, outputs = [ctx.outputs.pkg], ) @@ -106,6 +113,7 @@ def _gapic_pkg_tar_impl(ctx): gapic_pkg_tar = rule( attrs = { "deps": attr.label_list(mandatory = True), + "samples": attr.label_list(mandatory = False), "package_dir": attr.string(mandatory = False, default = ""), "extension": attr.string(mandatory = False, default = "tar.gz"), }, @@ -328,11 +336,14 @@ def java_gapic_assembly_gradle_pkg( client_test_deps = [] grpc_deps = [] proto_deps = [] + samples = [] processed_deps = {} #there is no proper Set in Starlark for dep in deps: # Use contains instead of endswith since microgenerator testing may use differently-named targets. - if "_java_gapic" in dep: + if "samples" in dep: + samples.append(dep) + elif "_java_gapic" in dep: _put_dep_in_a_bucket(dep, client_deps, processed_deps) _put_dep_in_a_bucket("%s_test" % dep, client_test_deps, processed_deps) _put_dep_in_a_bucket("%s_resource_name" % dep, proto_deps, processed_deps) @@ -380,6 +391,7 @@ def java_gapic_assembly_gradle_pkg( name = name, assembly_name = package_dir, deps = proto_target_dep + grpc_target_dep + client_target_dep, + samples = samples, ) def _java_gapic_gradle_pkg( @@ -425,7 +437,7 @@ def _java_gapic_gradle_pkg( **kwargs ) -def _java_gapic_assembly_gradle_pkg(name, assembly_name, deps, visibility = None): +def _java_gapic_assembly_gradle_pkg(name, assembly_name, deps, samples = None, visibility = None): resource_target_name = "%s-resources" % assembly_name java_gapic_build_configs_pkg( name = resource_target_name, @@ -443,6 +455,7 @@ def _java_gapic_assembly_gradle_pkg(name, assembly_name, deps, visibility = None Label("//rules_java_gapic:gradlew"), resource_target_name, ] + deps, + samples = samples, package_dir = assembly_name, visibility = visibility, ) From 1574de6ca4ec926b2683318090171d413eb2cc09 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Fri, 15 Apr 2022 12:07:08 -0700 Subject: [PATCH 10/18] test: ComposerTest --- .../generator/gapic/composer/Composer.java | 3 +- .../gapic/composer/ComposerTest.java | 94 +++++++++++++++---- 2 files changed, 79 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index 0297e84741..e09247ebeb 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -188,7 +188,8 @@ public static List generateTestClasses(GapicContext context) { return clazzes; } - private static List composeSamples(List clazzes, String protoPackage) { + @VisibleForTesting + static List composeSamples(List clazzes, String protoPackage) { // parse protoPackage for apiVersion and apiShortName String[] pakkage = protoPackage.split("\\."); String apiVersion; diff --git a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index d4ceeabce2..2a77035514 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -17,32 +17,92 @@ import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.writer.JavaWriterVisitor; +import com.google.api.generator.gapic.composer.comment.CommentComposer; +import com.google.api.generator.gapic.composer.grpc.GrpcServiceCallableFactoryClassComposer; +import com.google.api.generator.gapic.composer.grpc.GrpcTestProtoLoader; +import com.google.api.generator.gapic.composer.grpc.ServiceClientTestClassComposer; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; +import com.google.api.generator.gapic.model.GapicContext; +import com.google.api.generator.gapic.model.Sample; +import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.framework.Utils; + import java.nio.file.Path; import java.nio.file.Paths; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class ComposerTest { - @Test - public void gapicClass_addApacheLicense() { - ClassDefinition classDef = - ClassDefinition.builder() - .setPackageString("com.google.showcase.v1beta1.stub") - .setName("ComposerPostProcOnFooBar") - .setScope(ScopeNode.PUBLIC) - .build(); - List gapicClassWithHeaderList = - Composer.addApacheLicense(Arrays.asList(GapicClass.create(Kind.TEST, classDef))); - JavaWriterVisitor visitor = new JavaWriterVisitor(); - gapicClassWithHeaderList.get(0).classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); - Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); - Assert.assertCodeEquals(goldenFilePath, visitor.write()); - } + private final GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); + private final Service echoProtoService = context.services().get(0); + private final List clazzes = Arrays.asList(GrpcServiceCallableFactoryClassComposer.instance().generate(context, echoProtoService)); + private final String protoPackage = context.gapicMetadata().getProtoPackage(); + private final List samples = clazzes.get(0).samples(); + + @Test + public void gapicClass_addApacheLicense() { + ClassDefinition classDef = + ClassDefinition.builder() + .setPackageString("com.google.showcase.v1beta1.stub") + .setName("ComposerPostProcOnFooBar") + .setScope(ScopeNode.PUBLIC) + .build(); + List gapicClassWithHeaderList = + Composer.addApacheLicense(Arrays.asList(GapicClass.create(Kind.TEST, classDef))); + JavaWriterVisitor visitor = new JavaWriterVisitor(); + gapicClassWithHeaderList.get(0).classDefinition().accept(visitor); + Utils.saveCodegenToFile(this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); + Path goldenFilePath = + Paths.get(Utils.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } + + @Test + public void composeSamples_showcase() { + for (Sample sample : samples) { + assertEquals("File header will be empty before composing samples", sample.fileHeader(), ""); + assertEquals("ApiShortName will be empty before composing samples", sample.regionTag().apiShortName(), ""); + assertEquals("ApiVersion will be empty before composing samples", sample.regionTag().apiVersion(), ""); + } + + List composedSamples = Composer.composeSamples(clazzes, protoPackage).get(0).samples(); + + for (Sample sample : composedSamples) { + assertEquals("File header should be apache", sample.fileHeader(), Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)); + assertEquals("ApiShortName should be showcase", sample.regionTag().apiShortName(), "showcase"); + assertEquals("ApiVersion should be v1beta1", sample.regionTag().apiVersion(), "v1beta1"); + } + } + + @Test + public void composeSamples_parseProtoPackage() { + String protoPack = "google.cloud.accessapproval.v1"; + List composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + + for (Sample sample : composedSamples) { + assertEquals("ApiShortName should be accessapproval", sample.regionTag().apiShortName(), "accessapproval"); + assertEquals("ApiVersion should be v1", sample.regionTag().apiVersion(), "v1"); + } + + protoPack = "google.cloud.vision.v1p1beta1"; + composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + for (Sample sample : composedSamples) { + assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); + assertEquals("ApiVersion should be v1p1beta1", sample.regionTag().apiVersion(), "v1p1beta1"); + } + + protoPack = "google.cloud.vision"; + composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + for (Sample sample : composedSamples) { + assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); + assertEquals("ApiVersion should be empty", sample.regionTag().apiVersion(), ""); + } + } } From 38301a28313b2ce30e6be644ff32e1f13a84deef Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Fri, 15 Apr 2022 13:09:17 -0700 Subject: [PATCH 11/18] formatting --- .../gapic/composer/ComposerTest.java | 131 ++++++++++-------- 1 file changed, 70 insertions(+), 61 deletions(-) diff --git a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index 2a77035514..f1176046b7 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -14,13 +14,14 @@ package com.google.api.generator.gapic.composer; +import static org.junit.Assert.assertEquals; + import com.google.api.generator.engine.ast.ClassDefinition; import com.google.api.generator.engine.ast.ScopeNode; import com.google.api.generator.engine.writer.JavaWriterVisitor; import com.google.api.generator.gapic.composer.comment.CommentComposer; import com.google.api.generator.gapic.composer.grpc.GrpcServiceCallableFactoryClassComposer; import com.google.api.generator.gapic.composer.grpc.GrpcTestProtoLoader; -import com.google.api.generator.gapic.composer.grpc.ServiceClientTestClassComposer; import com.google.api.generator.gapic.model.GapicClass; import com.google.api.generator.gapic.model.GapicClass.Kind; import com.google.api.generator.gapic.model.GapicContext; @@ -28,81 +29,89 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.framework.Utils; - import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; - import org.junit.Test; -import static org.junit.Assert.assertEquals; - public class ComposerTest { - private final GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); - private final Service echoProtoService = context.services().get(0); - private final List clazzes = Arrays.asList(GrpcServiceCallableFactoryClassComposer.instance().generate(context, echoProtoService)); - private final String protoPackage = context.gapicMetadata().getProtoPackage(); - private final List samples = clazzes.get(0).samples(); + private final GapicContext context = GrpcTestProtoLoader.instance().parseShowcaseEcho(); + private final Service echoProtoService = context.services().get(0); + private final List clazzes = + Arrays.asList( + GrpcServiceCallableFactoryClassComposer.instance().generate(context, echoProtoService)); + private final String protoPackage = context.gapicMetadata().getProtoPackage(); + private final List samples = clazzes.get(0).samples(); - @Test - public void gapicClass_addApacheLicense() { - ClassDefinition classDef = - ClassDefinition.builder() - .setPackageString("com.google.showcase.v1beta1.stub") - .setName("ComposerPostProcOnFooBar") - .setScope(ScopeNode.PUBLIC) - .build(); - List gapicClassWithHeaderList = - Composer.addApacheLicense(Arrays.asList(GapicClass.create(Kind.TEST, classDef))); - JavaWriterVisitor visitor = new JavaWriterVisitor(); - gapicClassWithHeaderList.get(0).classDefinition().accept(visitor); - Utils.saveCodegenToFile(this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); - Path goldenFilePath = - Paths.get(Utils.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); - Assert.assertCodeEquals(goldenFilePath, visitor.write()); - } + @Test + public void gapicClass_addApacheLicense() { + ClassDefinition classDef = + ClassDefinition.builder() + .setPackageString("com.google.showcase.v1beta1.stub") + .setName("ComposerPostProcOnFooBar") + .setScope(ScopeNode.PUBLIC) + .build(); + List gapicClassWithHeaderList = + Composer.addApacheLicense(Arrays.asList(GapicClass.create(Kind.TEST, classDef))); + JavaWriterVisitor visitor = new JavaWriterVisitor(); + gapicClassWithHeaderList.get(0).classDefinition().accept(visitor); + Utils.saveCodegenToFile(this.getClass(), "ComposerPostProcOnFooBar.golden", visitor.write()); + Path goldenFilePath = + Paths.get(Utils.getGoldenDir(this.getClass()), "ComposerPostProcOnFooBar.golden"); + Assert.assertCodeEquals(goldenFilePath, visitor.write()); + } - @Test - public void composeSamples_showcase() { - for (Sample sample : samples) { - assertEquals("File header will be empty before composing samples", sample.fileHeader(), ""); - assertEquals("ApiShortName will be empty before composing samples", sample.regionTag().apiShortName(), ""); - assertEquals("ApiVersion will be empty before composing samples", sample.regionTag().apiVersion(), ""); - } + @Test + public void composeSamples_showcase() { + for (Sample sample : samples) { + assertEquals("File header will be empty before composing samples", sample.fileHeader(), ""); + assertEquals( + "ApiShortName will be empty before composing samples", + sample.regionTag().apiShortName(), + ""); + assertEquals( + "ApiVersion will be empty before composing samples", sample.regionTag().apiVersion(), ""); + } - List composedSamples = Composer.composeSamples(clazzes, protoPackage).get(0).samples(); + List composedSamples = Composer.composeSamples(clazzes, protoPackage).get(0).samples(); - for (Sample sample : composedSamples) { - assertEquals("File header should be apache", sample.fileHeader(), Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)); - assertEquals("ApiShortName should be showcase", sample.regionTag().apiShortName(), "showcase"); - assertEquals("ApiVersion should be v1beta1", sample.regionTag().apiVersion(), "v1beta1"); - } + for (Sample sample : composedSamples) { + assertEquals( + "File header should be apache", + sample.fileHeader(), + Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)); + assertEquals( + "ApiShortName should be showcase", sample.regionTag().apiShortName(), "showcase"); + assertEquals("ApiVersion should be v1beta1", sample.regionTag().apiVersion(), "v1beta1"); } + } - @Test - public void composeSamples_parseProtoPackage() { - String protoPack = "google.cloud.accessapproval.v1"; - List composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + @Test + public void composeSamples_parseProtoPackage() { + String protoPack = "google.cloud.accessapproval.v1"; + List composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); - for (Sample sample : composedSamples) { - assertEquals("ApiShortName should be accessapproval", sample.regionTag().apiShortName(), "accessapproval"); - assertEquals("ApiVersion should be v1", sample.regionTag().apiVersion(), "v1"); - } + for (Sample sample : composedSamples) { + assertEquals( + "ApiShortName should be accessapproval", + sample.regionTag().apiShortName(), + "accessapproval"); + assertEquals("ApiVersion should be v1", sample.regionTag().apiVersion(), "v1"); + } - protoPack = "google.cloud.vision.v1p1beta1"; - composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); - for (Sample sample : composedSamples) { - assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); - assertEquals("ApiVersion should be v1p1beta1", sample.regionTag().apiVersion(), "v1p1beta1"); - } + protoPack = "google.cloud.vision.v1p1beta1"; + composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + for (Sample sample : composedSamples) { + assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); + assertEquals("ApiVersion should be v1p1beta1", sample.regionTag().apiVersion(), "v1p1beta1"); + } - protoPack = "google.cloud.vision"; - composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); - for (Sample sample : composedSamples) { - assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); - assertEquals("ApiVersion should be empty", sample.regionTag().apiVersion(), ""); - } + protoPack = "google.cloud.vision"; + composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + for (Sample sample : composedSamples) { + assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); + assertEquals("ApiVersion should be empty", sample.regionTag().apiVersion(), ""); } + } } From 98ef29d099918f5b2452eec70e25e2cdd06c91e4 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Fri, 15 Apr 2022 13:21:04 -0700 Subject: [PATCH 12/18] fix test --- .../google/api/generator/gapic/composer/ComposerTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index f1176046b7..826ba21c8f 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -29,6 +29,7 @@ import com.google.api.generator.gapic.model.Service; import com.google.api.generator.test.framework.Assert; import com.google.api.generator.test.framework.Utils; +import com.google.common.collect.ImmutableList; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; @@ -65,7 +66,10 @@ public void gapicClass_addApacheLicense() { @Test public void composeSamples_showcase() { for (Sample sample : samples) { - assertEquals("File header will be empty before composing samples", sample.fileHeader(), ""); + assertEquals( + "File header will be empty before composing samples", + sample.fileHeader(), + ImmutableList.of()); assertEquals( "ApiShortName will be empty before composing samples", sample.regionTag().apiShortName(), From 352d7d68a31ac71b880223acb1a3b52090fe7c2c Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 26 Apr 2022 13:30:43 -0700 Subject: [PATCH 13/18] refactor: updateSample naming --- .../com/google/api/generator/gapic/composer/Composer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index e09247ebeb..fc5e065559 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -208,14 +208,14 @@ static List composeSamples(List clazzes, String protoPac gapicClass -> { List samples = gapicClass.samples().stream() - .map(sample -> updateSample(sample, apiShortName, apiVersion)) + .map(sample -> addRegionTagAndHeaderToSample(sample, apiShortName, apiVersion)) .collect(Collectors.toList()); return gapicClass.withSamples(samples); }) .collect(Collectors.toList()); } - private static Sample updateSample(Sample sample, String apiShortName, String apiVersion) { + private static Sample addRegionTagAndHeaderToSample(Sample sample, String apiShortName, String apiVersion) { return sample .withHeader(Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)) .withRegionTag( From d06de38dd30ecffb2b12e19ce62ee7fdf7ef9b38 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 26 Apr 2022 13:51:13 -0700 Subject: [PATCH 14/18] refactor: include cause with GapicWriterException --- .../api/generator/gapic/composer/Composer.java | 6 ++++-- .../generator/gapic/protowriter/Writer.java | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index fc5e065559..36e1cbdc1c 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -208,14 +208,16 @@ static List composeSamples(List clazzes, String protoPac gapicClass -> { List samples = gapicClass.samples().stream() - .map(sample -> addRegionTagAndHeaderToSample(sample, apiShortName, apiVersion)) + .map( + sample -> addRegionTagAndHeaderToSample(sample, apiShortName, apiVersion)) .collect(Collectors.toList()); return gapicClass.withSamples(samples); }) .collect(Collectors.toList()); } - private static Sample addRegionTagAndHeaderToSample(Sample sample, String apiShortName, String apiVersion) { + private static Sample addRegionTagAndHeaderToSample( + Sample sample, String apiShortName, String apiVersion) { return sample .withHeader(Arrays.asList(CommentComposer.APACHE_LICENSE_COMMENT)) .withRegionTag( diff --git a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java index ee2e8fc751..35f9f21fdb 100644 --- a/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java +++ b/src/main/java/com/google/api/generator/gapic/protowriter/Writer.java @@ -36,6 +36,10 @@ static class GapicWriterException extends RuntimeException { public GapicWriterException(String errorMessage) { super(errorMessage); } + + public GapicWriterException(String errorMessage, Throwable cause) { + super(errorMessage, cause); + } } public static CodeGeneratorResponse write( @@ -49,7 +53,7 @@ public static CodeGeneratorResponse write( try { jos = new JarOutputStream(output); } catch (IOException e) { - throw new GapicWriterException(e.getMessage()); + throw new GapicWriterException(e.getMessage(), e); } for (GapicClass gapicClazz : clazzes) { @@ -63,7 +67,7 @@ public static CodeGeneratorResponse write( jos.finish(); jos.flush(); } catch (IOException e) { - throw new GapicWriterException(e.getMessage()); + throw new GapicWriterException(e.getMessage(), e); } CodeGeneratorResponse.Builder response = CodeGeneratorResponse.newBuilder(); @@ -93,7 +97,8 @@ private static String writeClazz( throw new GapicWriterException( String.format( "Could not write code for class %s.%s: %s", - clazz.packageString(), clazz.classIdentifier().name(), e.getMessage())); + clazz.packageString(), clazz.classIdentifier().name(), e.getMessage()), + e); } return path; } @@ -117,7 +122,8 @@ private static void writeSamples( throw new GapicWriterException( String.format( "Could not write sample code for %s/%s.: %s", - clazzPath, sample.name(), e.getMessage())); + clazzPath, sample.name(), e.getMessage()), + e); } } } @@ -135,7 +141,7 @@ private static String writePackageInfo( jos.putNextEntry(jarEntry); jos.write(code.getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { - throw new GapicWriterException("Could not write code for package-info.java"); + throw new GapicWriterException("Could not write code for package-info.java", e); } return packagePath; } @@ -148,7 +154,7 @@ private static void writeMetadataFile(GapicContext context, String path, JarOutp jos.write( JsonFormat.printer().print(context.gapicMetadata()).getBytes(StandardCharsets.UTF_8)); } catch (IOException e) { - throw new GapicWriterException("Could not write gapic_metadata.json"); + throw new GapicWriterException("Could not write gapic_metadata.json", e); } } } From ace454159ac18250a3344f0504aa7cd1012b829a Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Tue, 26 Apr 2022 14:08:59 -0700 Subject: [PATCH 15/18] ignore test files in snippetbot check --- .github/snippet-bot.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/snippet-bot.yml b/.github/snippet-bot.yml index a2abce6eda..045191b04a 100644 --- a/.github/snippet-bot.yml +++ b/.github/snippet-bot.yml @@ -2,3 +2,4 @@ aggregateChecks: false alwaysCreateStatusCheck: false ignoreFiles: - src/test/** + - test/** From fd1ec872d3c4837e679351b7278fd25b3fa304c5 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Wed, 27 Apr 2022 09:07:36 -0700 Subject: [PATCH 16/18] update composeSamples name --- .../com/google/api/generator/gapic/composer/Composer.java | 4 ++-- .../google/api/generator/gapic/composer/ComposerTest.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index 36e1cbdc1c..8348971709 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -47,7 +47,7 @@ public static List composeServiceClasses(GapicContext context) { clazzes.addAll(generateServiceClasses(context)); clazzes.addAll(generateMockClasses(context, context.mixinServices())); clazzes.addAll(generateResourceNameHelperClasses(context)); - return addApacheLicense(composeSamples(clazzes, context.gapicMetadata().getProtoPackage())); + return addApacheLicense(prepareExecutableSamples(clazzes, context.gapicMetadata().getProtoPackage())); } public static GapicPackageInfo composePackageInfo(GapicContext context) { @@ -189,7 +189,7 @@ public static List generateTestClasses(GapicContext context) { } @VisibleForTesting - static List composeSamples(List clazzes, String protoPackage) { + static List prepareExecutableSamples(List clazzes, String protoPackage) { // parse protoPackage for apiVersion and apiShortName String[] pakkage = protoPackage.split("\\."); String apiVersion; diff --git a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index 826ba21c8f..ecf9173fd1 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -78,7 +78,7 @@ public void composeSamples_showcase() { "ApiVersion will be empty before composing samples", sample.regionTag().apiVersion(), ""); } - List composedSamples = Composer.composeSamples(clazzes, protoPackage).get(0).samples(); + List composedSamples = Composer.prepareExecutableSamples(clazzes, protoPackage).get(0).samples(); for (Sample sample : composedSamples) { assertEquals( @@ -94,7 +94,7 @@ public void composeSamples_showcase() { @Test public void composeSamples_parseProtoPackage() { String protoPack = "google.cloud.accessapproval.v1"; - List composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + List composedSamples = Composer.prepareExecutableSamples(clazzes, protoPack).get(0).samples(); for (Sample sample : composedSamples) { assertEquals( @@ -105,14 +105,14 @@ public void composeSamples_parseProtoPackage() { } protoPack = "google.cloud.vision.v1p1beta1"; - composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + composedSamples = Composer.prepareExecutableSamples(clazzes, protoPack).get(0).samples(); for (Sample sample : composedSamples) { assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); assertEquals("ApiVersion should be v1p1beta1", sample.regionTag().apiVersion(), "v1p1beta1"); } protoPack = "google.cloud.vision"; - composedSamples = Composer.composeSamples(clazzes, protoPack).get(0).samples(); + composedSamples = Composer.prepareExecutableSamples(clazzes, protoPack).get(0).samples(); for (Sample sample : composedSamples) { assertEquals("ApiShortName should be vision", sample.regionTag().apiShortName(), "vision"); assertEquals("ApiVersion should be empty", sample.regionTag().apiVersion(), ""); From 5abb7a319ebe7313832e0bfcf3e4d416efb3a5d3 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Wed, 27 Apr 2022 13:12:28 -0700 Subject: [PATCH 17/18] include javadoc comments --- .../generator/gapic/composer/Composer.java | 3 ++- .../api/generator/gapic/model/RegionTag.java | 27 +++++++++++++++++++ .../api/generator/gapic/model/Sample.java | 16 +++++++++++ .../gapic/composer/ComposerTest.java | 6 +++-- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/composer/Composer.java b/src/main/java/com/google/api/generator/gapic/composer/Composer.java index 8348971709..8306930de1 100644 --- a/src/main/java/com/google/api/generator/gapic/composer/Composer.java +++ b/src/main/java/com/google/api/generator/gapic/composer/Composer.java @@ -47,7 +47,8 @@ public static List composeServiceClasses(GapicContext context) { clazzes.addAll(generateServiceClasses(context)); clazzes.addAll(generateMockClasses(context, context.mixinServices())); clazzes.addAll(generateResourceNameHelperClasses(context)); - return addApacheLicense(prepareExecutableSamples(clazzes, context.gapicMetadata().getProtoPackage())); + return addApacheLicense( + prepareExecutableSamples(clazzes, context.gapicMetadata().getProtoPackage())); } public static GapicPackageInfo composePackageInfo(GapicContext context) { diff --git a/src/main/java/com/google/api/generator/gapic/model/RegionTag.java b/src/main/java/com/google/api/generator/gapic/model/RegionTag.java index a6292fe956..0ac3e125ca 100644 --- a/src/main/java/com/google/api/generator/gapic/model/RegionTag.java +++ b/src/main/java/com/google/api/generator/gapic/model/RegionTag.java @@ -20,6 +20,10 @@ import com.google.auto.value.AutoValue; import com.google.common.base.Preconditions; +/** + * This model represents a code sample region tag. Matching region start and end region tag + * comments are used to determine the boundaries of code snippets to be used in documentation. + */ @AutoValue public abstract class RegionTag { public abstract String apiShortName(); @@ -44,14 +48,32 @@ public static Builder builder() { public abstract RegionTag.Builder toBuilder(); + /** + * Helper method to easily update region tag apiVersion. + * + * @param apiVersion String to replace region tag apiVersion + * @return RegionTag with updated apiVersion + */ public final RegionTag withApiVersion(String apiVersion) { return toBuilder().setApiVersion(apiVersion).build(); } + /** + * Helper method to easily update region tag apiShortName. + * + * @param apiShortName String to replace region tag apiShortName + * @return RegionTag with updated apiShortName + */ public final RegionTag withApiShortName(String apiShortName) { return toBuilder().setApiShortName(apiShortName).build(); } + /** + * Helper method to easily update region tag overloadDisambiguation. + * + * @param overloadDisambiguation String to replace region tag overloadDisambiguation + * @return RegionTag with updated overloadDisambiguation + */ public final RegionTag withOverloadDisambiguation(String overloadDisambiguation) { return toBuilder().setOverloadDisambiguation(overloadDisambiguation).build(); } @@ -101,6 +123,11 @@ public enum RegionTagRegion { END } + /** + * Method to generate region tag comment text + * + * @return region tag comment text + */ public String generate() { Preconditions.checkState(!apiShortName().isEmpty(), "apiShortName can't be empty"); Preconditions.checkState(!serviceName().isEmpty(), "serviceName can't be empty"); diff --git a/src/main/java/com/google/api/generator/gapic/model/Sample.java b/src/main/java/com/google/api/generator/gapic/model/Sample.java index 1fb4e578e0..27a999853a 100644 --- a/src/main/java/com/google/api/generator/gapic/model/Sample.java +++ b/src/main/java/com/google/api/generator/gapic/model/Sample.java @@ -21,6 +21,10 @@ import com.google.common.collect.ImmutableList; import java.util.List; +/** + * This model represents a generated code sample. It contains the information needed to generate a + * sample file. + */ @AutoValue public abstract class Sample { public abstract List body(); @@ -45,10 +49,22 @@ public static Builder builder() { public abstract Builder toBuilder(); + /** + * Helper method to easily update Sample's license header. + * + * @param header List of {@link CommentStatement} to replace Sample's header + * @return Sample with updated header + */ public final Sample withHeader(List header) { return toBuilder().setFileHeader(header).build(); } + /** + * Helper method to easily update Sample's region tag. + * + * @param regionTag {@link RegionTag} to replace Sample's header + * @return Sample with updated region tag. + */ public final Sample withRegionTag(RegionTag regionTag) { if (isCanonical() && !regionTag.overloadDisambiguation().isEmpty()) { // don't set overload on canonical samples diff --git a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java index ecf9173fd1..4bbc779dcf 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java +++ b/src/test/java/com/google/api/generator/gapic/composer/ComposerTest.java @@ -78,7 +78,8 @@ public void composeSamples_showcase() { "ApiVersion will be empty before composing samples", sample.regionTag().apiVersion(), ""); } - List composedSamples = Composer.prepareExecutableSamples(clazzes, protoPackage).get(0).samples(); + List composedSamples = + Composer.prepareExecutableSamples(clazzes, protoPackage).get(0).samples(); for (Sample sample : composedSamples) { assertEquals( @@ -94,7 +95,8 @@ public void composeSamples_showcase() { @Test public void composeSamples_parseProtoPackage() { String protoPack = "google.cloud.accessapproval.v1"; - List composedSamples = Composer.prepareExecutableSamples(clazzes, protoPack).get(0).samples(); + List composedSamples = + Composer.prepareExecutableSamples(clazzes, protoPack).get(0).samples(); for (Sample sample : composedSamples) { assertEquals( From c1633a0c6c279069f5cea8414aae1ab79fafb2ea Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Wed, 27 Apr 2022 13:23:54 -0700 Subject: [PATCH 18/18] formatting --- .../java/com/google/api/generator/gapic/model/RegionTag.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/google/api/generator/gapic/model/RegionTag.java b/src/main/java/com/google/api/generator/gapic/model/RegionTag.java index 0ac3e125ca..d98212ef6b 100644 --- a/src/main/java/com/google/api/generator/gapic/model/RegionTag.java +++ b/src/main/java/com/google/api/generator/gapic/model/RegionTag.java @@ -21,8 +21,8 @@ import com.google.common.base.Preconditions; /** - * This model represents a code sample region tag. Matching region start and end region tag - * comments are used to determine the boundaries of code snippets to be used in documentation. + * This model represents a code sample region tag. Matching region start and end region tag comments + * are used to determine the boundaries of code snippets to be used in documentation. */ @AutoValue public abstract class RegionTag {