From caf61a815177577279bccf206228108b5a2db559 Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:39:04 -0400 Subject: [PATCH] feat: organize with Older and prerelease packages (#192) * feat: organize with Older and prerelease packages * chore: clarity and use 'equals' * chore: explicit recommendation error conditions * chore: add 2-release test case to ApiVersionTest --- .../com/google/docfx/doclet/ApiVersion.java | 17 + .../com/microsoft/build/YmlFilesBuilder.java | 129 +-- .../com/microsoft/lookup/PackageLookup.java | 123 +++ .../java/com/microsoft/model/TocFile.java | 3 +- .../java/com/microsoft/model/TocItem.java | 6 + .../microsoft/doclet/DocletRunnerTest.java | 33 +- .../microsoft/lookup/PackageLookupTest.java | 140 ++- .../java/com/microsoft/model/TocFileTest.java | 16 +- .../samples/google/v1/SpeechClient.java | 404 +++++++++ .../com/microsoft/util/ApiVersionTest.java | 36 + ...crosoft.samples.google.v1.SpeechClient.yml | 833 ++++++++++++++++++ .../com.microsoft.samples.google.v1.yml | 20 + .../expected-generated-files/overview.yml | 13 +- .../expected-generated-files/toc.yml | 39 +- 14 files changed, 1723 insertions(+), 89 deletions(-) create mode 100644 third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/SpeechClient.java create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.SpeechClient.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.yml diff --git a/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/ApiVersion.java b/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/ApiVersion.java index c577cb22..51867f09 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/ApiVersion.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/ApiVersion.java @@ -1,6 +1,8 @@ package com.google.docfx.doclet; import com.google.common.base.MoreObjects; +import java.util.Collection; +import java.util.Comparator; import java.util.Objects; import java.util.Optional; import java.util.regex.Matcher; @@ -52,6 +54,21 @@ private static int safeParseInt(@Nullable String input) { return Integer.parseInt(input); } + public static ApiVersion getRecommended(Collection versions) { + if (versions.size() == 1) { + return versions.iterator().next(); + } + + Optional latestReleaseVersion = + versions.stream().filter(ApiVersion::isStable).max(Comparator.naturalOrder()); + + return latestReleaseVersion.orElseGet( + () -> // No (stable) release version found + versions.stream() + .max(Comparator.naturalOrder()) // Select latest prerelease version + .orElseThrow(() -> new IllegalArgumentException("Versions must not be empty."))); + } + private final int major; private final int minor; private final String stability; diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java index 7e0d1f66..bef901ed 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/YmlFilesBuilder.java @@ -2,9 +2,12 @@ import static com.microsoft.build.BuilderUtil.populateUidValues; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableListMultimap; import com.microsoft.lookup.ClassItemsLookup; import com.microsoft.lookup.ClassLookup; import com.microsoft.lookup.PackageLookup; +import com.microsoft.lookup.PackageLookup.PackageGroup; import com.microsoft.model.MetadataFile; import com.microsoft.model.MetadataFileItem; import com.microsoft.model.TocFile; @@ -19,16 +22,18 @@ import jdk.javadoc.doclet.DocletEnvironment; public class YmlFilesBuilder { - private DocletEnvironment environment; - private String outputPath; - private ElementUtil elementUtil; - private PackageLookup packageLookup; - private String projectName; - private boolean disableChangelog; - private ProjectBuilder projectBuilder; - private PackageBuilder packageBuilder; - private ClassBuilder classBuilder; - private ReferenceBuilder referenceBuilder; + private static final String OLDER_AND_PRERELEASE = "Older and prerelease packages"; + + private final DocletEnvironment environment; + private final String outputPath; + private final ElementUtil elementUtil; + private final PackageLookup packageLookup; + private final String projectName; + private final boolean disableChangelog; + private final ProjectBuilder projectBuilder; + private final PackageBuilder packageBuilder; + private final ClassBuilder classBuilder; + private final ReferenceBuilder referenceBuilder; public YmlFilesBuilder( DocletEnvironment environment, @@ -57,60 +62,84 @@ public YmlFilesBuilder( } public boolean build() { + Processor processor = new Processor(); + processor.process(); + + // write to yaml files + FileUtil.dumpToFile(processor.projectMetadataFile); + processor.packageMetadataFiles.forEach(FileUtil::dumpToFile); + processor.classMetadataFiles.forEach(FileUtil::dumpToFile); + FileUtil.dumpToFile(processor.tocFile); + + return true; + } + + @VisibleForTesting + class Processor { // table of contents - TocFile tocFile = new TocFile(outputPath, projectName, disableChangelog); + final TocFile tocFile = new TocFile(outputPath, projectName, disableChangelog); // overview page - MetadataFile projectMetadataFile = new MetadataFile(outputPath, "overview.yml"); + final MetadataFile projectMetadataFile = new MetadataFile(outputPath, "overview.yml"); // package summary pages - List packageMetadataFiles = new ArrayList<>(); + final List packageMetadataFiles = new ArrayList<>(); // packages - List packageItems = new ArrayList<>(); + final List packageItems = new ArrayList<>(); // class/enum/interface/etc. pages - List classMetadataFiles = new ArrayList<>(); + final List classMetadataFiles = new ArrayList<>(); - for (PackageElement packageElement : - elementUtil.extractPackageElements(environment.getIncludedElements())) { - String packageUid = packageLookup.extractUid(packageElement); - String packageStatus = packageLookup.extractStatus(packageElement); - TocItem packageTocItem = new TocItem(packageUid, packageUid, packageStatus); - // build package summary - packageMetadataFiles.add(packageBuilder.buildPackageMetadataFile(packageElement)); - // add package summary to toc - packageTocItem.getItems().add(new TocItem(packageUid, "Package summary")); - tocFile.addTocItem(packageTocItem); + @VisibleForTesting + void process() { + ImmutableListMultimap organizedPackages = + packageLookup.organize( + elementUtil.extractPackageElements(environment.getIncludedElements())); - // build classes/interfaces/enums/exceptions/annotations - TocTypeMap typeMap = new TocTypeMap(); - classBuilder.buildFilesForInnerClasses(packageElement, typeMap, classMetadataFiles); - packageTocItem.getItems().addAll(joinTocTypeItems(typeMap)); - } + for (PackageElement element : organizedPackages.get(PackageGroup.VISIBLE)) { + tocFile.addTocItem(buildPackage(element)); + } - for (MetadataFile packageFile : packageMetadataFiles) { - packageItems.addAll(packageFile.getItems()); - String packageFileName = packageFile.getFileName(); - for (MetadataFile classFile : classMetadataFiles) { - String classFileName = classFile.getFileName(); - if (packageFileName.equalsIgnoreCase(classFileName)) { - packageFile.setFileName(packageFileName.replaceAll("\\.yml$", "(package).yml")); - classFile.setFileName(classFileName.replaceAll("\\.yml$", "(class).yml")); - break; + TocItem older = new TocItem(OLDER_AND_PRERELEASE, OLDER_AND_PRERELEASE, null); + for (PackageElement element : organizedPackages.get(PackageGroup.OLDER_AND_PRERELEASE)) { + older.getItems().add(buildPackage(element)); + } + tocFile.addTocItem(older); + + for (MetadataFile packageFile : packageMetadataFiles) { + packageItems.addAll(packageFile.getItems()); + String packageFileName = packageFile.getFileName(); + for (MetadataFile classFile : classMetadataFiles) { + String classFileName = classFile.getFileName(); + if (packageFileName.equalsIgnoreCase(classFileName)) { + packageFile.setFileName(packageFileName.replaceAll("\\.yml$", "(package).yml")); + classFile.setFileName(classFileName.replaceAll("\\.yml$", "(class).yml")); + break; + } } } + // build project summary page + projectBuilder.buildProjectMetadataFile(packageItems, projectMetadataFile); + + // post-processing + populateUidValues(packageMetadataFiles, classMetadataFiles); + referenceBuilder.updateExternalReferences(classMetadataFiles); } - // build project summary page - projectBuilder.buildProjectMetadataFile(packageItems, projectMetadataFile); - // post-processing - populateUidValues(packageMetadataFiles, classMetadataFiles); - referenceBuilder.updateExternalReferences(classMetadataFiles); + private TocItem buildPackage(PackageElement element) { + String packageUid = packageLookup.extractUid(element); + String packageStatus = packageLookup.extractStatus(element); - // write to yaml files - FileUtil.dumpToFile(projectMetadataFile); - packageMetadataFiles.forEach(FileUtil::dumpToFile); - classMetadataFiles.forEach(FileUtil::dumpToFile); - FileUtil.dumpToFile(tocFile); + TocItem packageTocItem = new TocItem(packageUid, packageUid, packageStatus); + packageTocItem.getItems().add(new TocItem(packageUid, "Package summary")); - return true; + // build package summary + packageMetadataFiles.add(packageBuilder.buildPackageMetadataFile(element)); + + // build classes/interfaces/enums/exceptions/annotations + TocTypeMap typeMap = new TocTypeMap(); + classBuilder.buildFilesForInnerClasses(element, typeMap, classMetadataFiles); + packageTocItem.getItems().addAll(joinTocTypeItems(typeMap)); + + return packageTocItem; + } } List joinTocTypeItems(TocTypeMap tocTypeMap) { diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java index a5953895..05d1a964 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/PackageLookup.java @@ -1,7 +1,22 @@ package com.microsoft.lookup; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.common.collect.MultimapBuilder; +import com.google.common.collect.Multimaps; +import com.google.docfx.doclet.ApiVersion; import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.Status; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; import javax.lang.model.element.PackageElement; import jdk.javadoc.doclet.DocletEnvironment; @@ -51,4 +66,112 @@ public String extractJavaType(PackageElement element) { } return null; } + + /** Compare PackageElements by their parsed ApiVersion */ + private final Comparator byComparingApiVersion = + Comparator.comparing(pkg -> extractApiVersion(pkg).orElse(ApiVersion.NONE)); + + public Optional extractApiVersion(PackageElement pkg) { + String name = String.valueOf(pkg.getQualifiedName()); + int lastPackageIndex = name.lastIndexOf('.'); + String leafPackage = name.substring(lastPackageIndex + 1); + return ApiVersion.parse(leafPackage); + } + + public enum PackageGroup { + VISIBLE, + OLDER_AND_PRERELEASE + } + + /** + * Organize packages into PackageGroups, making some VISIBLE the rest hidden under the + * OLDER_AND_PRERELEASE category. + */ + public ImmutableListMultimap organize( + List packages) { + + ListMultimap organized = + MultimapBuilder.enumKeys(PackageGroup.class).arrayListValues().build(); + + Multimap packagesGroups = groupVersions(packages); + ImmutableList alphabetizedPackageGroups = + packagesGroups.keySet().stream().sorted().collect(ImmutableList.toImmutableList()); + + for (String name : alphabetizedPackageGroups) { + Collection versions = packagesGroups.get(name); + + // The recommended package of each group is made visible. + PackageElement recommendedVersion = getRecommended(versions); + organized.put(PackageGroup.VISIBLE, recommendedVersion); + + // All others are added to "Older and prerelease versions" + versions.stream() + .filter(version -> !version.equals(recommendedVersion)) + .sorted(byComparingApiVersion) + .forEach( + version -> { + organized.put(PackageGroup.OLDER_AND_PRERELEASE, version); + }); + } + + return ImmutableListMultimap.copyOf(organized); + } + + /** + * This 'grouping' logic combines all versioned packages together in a single `a.b.c.v#` group. + * + *

For example: a.b.v1 and a.b.v2 will be in the same group, but a.b and a.b.c will be in their + * own groups. + * + *

When packages are grouped, only one package within the group will be VISIBLE and the rest + * will be placed in the OLDER_AND_PRERELEASE category. + */ + @VisibleForTesting + Multimap groupVersions(List packages) { + return Multimaps.index( + packages, + (pkg) -> { + String name = String.valueOf(pkg.getQualifiedName()); + int lastPackageIndex = name.lastIndexOf('.'); + String leafPackage = name.substring(lastPackageIndex + 1); + // For package a.b.c.d, the value of leafPackage is 'd'. + + boolean packageIsApiVersion = ApiVersion.parse(leafPackage).isPresent(); + if (packageIsApiVersion) { + String packageWithoutVersion = name.substring(0, lastPackageIndex); + // For package a.b.c.v1, the value of packageWithoutVersion is a.b.c + return packageWithoutVersion + ".v#"; // Use "v#" package to group all versions + } + // Using 'name' ensures this package is placed in a group of size 1. + return name; + }); + } + + /** + * @throws java.lang.IllegalStateException if the collections has multiple entries, and any of the + * packages are not versioned. + * @throws java.lang.IllegalArgumentException if the collection is empty or contains entries with + * duplicate API versions. + */ + @VisibleForTesting + PackageElement getRecommended(Collection packages) { + Preconditions.checkArgument(!packages.isEmpty(), "Packages must not be empty."); + + if (packages.size() == 1) { + return packages.iterator().next(); + } + + ImmutableMap versions = + Maps.uniqueIndex( + packages, + (pkg) -> + extractApiVersion(pkg) + .orElseThrow( + () -> + new IllegalStateException( + "Unable to parse version from package " + pkg))); + + ApiVersion recommended = ApiVersion.getRecommended(versions.keySet()); + return versions.get(recommended); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocFile.java index 765c015a..c8a51810 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocFile.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocFile.java @@ -4,7 +4,6 @@ import java.io.File; import java.util.ArrayList; import java.util.Collections; -import java.util.Comparator; import java.util.List; public class TocFile extends ArrayList implements YmlFile { @@ -26,7 +25,7 @@ public void addTocItem(TocItem packageTocItem) { } protected void sortByUid() { - Collections.sort(this, Comparator.comparing(TocItem::getUid)); + Collections.sort(this, (a, b) -> a.getUid().compareToIgnoreCase(b.getUid())); } @Override diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocItem.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocItem.java index 948503e7..1dde6e6e 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocItem.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocItem.java @@ -1,5 +1,6 @@ package com.microsoft.model; +import com.google.common.base.MoreObjects; import java.util.ArrayList; import java.util.List; @@ -45,4 +46,9 @@ public String getStatus() { public String getHeading() { return heading; } + + @Override + public String toString() { + return MoreObjects.toStringHelper(TocItem.class).add("uid", uid).toString(); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java index 1974c5cb..2b1c28f7 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocletRunnerTest.java @@ -1,5 +1,7 @@ package com.microsoft.doclet; +import static com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -68,9 +70,11 @@ public void testFilesGeneration() throws IOException { DocletRunner.main(new String[] {PARAMS_DIR}); List expectedFilePaths = - Files.list(Path.of(EXPECTED_GENERATED_FILES_DIR)).collect(Collectors.toList()); - List generatedFilePaths = Files.list(Path.of(OUTPUT_DIR)).collect(Collectors.toList()); - assertEquals("Wrong files count", generatedFilePaths.size(), expectedFilePaths.size()); + Files.list(Path.of(EXPECTED_GENERATED_FILES_DIR)).sorted().collect(Collectors.toList()); + List generatedFilePaths = + Files.list(Path.of(OUTPUT_DIR)).sorted().collect(Collectors.toList()); + + assertSameFileNames(expectedFilePaths, generatedFilePaths); for (Path expectedFilePath : expectedFilePaths) { Path generatedFilePath = Path.of(OUTPUT_DIR, expectedFilePath.getFileName().toString()); @@ -94,4 +98,27 @@ public void testFilesGeneration() throws IOException { } } } + + public void assertSameFileNames(List expected, List generated) { + List expectedFilenames = + expected.stream().map(Path::getFileName).map(Path::toString).collect(Collectors.toList()); + List generatedFilenames = + generated.stream().map(Path::getFileName).map(Path::toString).collect(Collectors.toList()); + + assertWithMessage("Expected files were not generated.") + .that( + expectedFilenames.stream() + .filter(file -> !generatedFilenames.contains(file)) + .collect(Collectors.toList())) + .isEmpty(); + + assertWithMessage("Files were generated that should not have been.") + .that( + generatedFilenames.stream() + .filter(file -> !expectedFilenames.contains(file)) + .collect(Collectors.toList())) + .isEmpty(); + + assertThat(expected.size()).isEqualTo(generated.size()); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java index 0cdbbf10..f175f18e 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/PackageLookupTest.java @@ -1,9 +1,17 @@ package com.microsoft.lookup; +import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.Multimap; import com.google.testing.compile.CompilationRule; +import com.microsoft.lookup.PackageLookup.PackageGroup; import com.microsoft.model.Status; +import java.util.List; +import java.util.stream.Collectors; import javax.lang.model.element.PackageElement; import javax.lang.model.util.Elements; import jdk.javadoc.doclet.DocletEnvironment; @@ -40,15 +48,17 @@ public void extractPackageContent() { @Test public void extractPackageStatus() { - PackageElement elementBeta = elements.getPackageElement("com.microsoft.samples.google.v1beta"); - PackageElement elementAlpha = - elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"); + PackageElement beta = elements.getPackageElement("com.microsoft.samples.google.v1beta"); + PackageElement alpha = elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"); + PackageElement v1 = elements.getPackageElement("com.microsoft.samples.google.v1"); - String resultA = packageLookup.extractStatus(elementAlpha); - String resultB = packageLookup.extractStatus(elementBeta); + String resultA = packageLookup.extractStatus(alpha); + String resultB = packageLookup.extractStatus(beta); + String resultV1 = packageLookup.extractStatus(v1); - assertEquals("Wrong result", resultA, Status.ALPHA.toString()); - assertEquals("Wrong result", resultB, Status.BETA.toString()); + assertThat(resultA).isEqualTo(Status.ALPHA.toString()); + assertThat(resultB).isEqualTo(Status.BETA.toString()); + assertThat(resultV1).isNull(); } @Test @@ -57,4 +67,120 @@ public void testExtractJavaType() { elements.getPackageElement("com.microsoft.samples.google.v1beta"); assertEquals("Wrong javaType", packageLookup.extractJavaType(packageElement), "package"); } + + @Test + public void testGroupVersions() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"), + elements.getPackageElement("com.microsoft.samples.google.v1beta"), + elements.getPackageElement("com.microsoft.samples.google.v1"), + elements.getPackageElement("com.microsoft.samples.google"), + elements.getPackageElement("com.microsoft.samples")); + + Multimap groupedPackages = packageLookup.groupVersions(packages); + + assertThat(groupedPackages.keys()).hasCount("com.microsoft.samples.google.v#", 3); + assertThat(groupedPackages.keys()).hasCount("com.microsoft.samples.google", 1); + assertThat(groupedPackages.keys()).hasCount("com.microsoft.samples", 1); + } + + @Test + public void testRecommendation() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"), + elements.getPackageElement("com.microsoft.samples.google.v1beta")); + + PackageElement recommended = packageLookup.getRecommended(packages); + + assertThat(String.valueOf(recommended.getQualifiedName())) + .isEqualTo("com.microsoft.samples.google.v1p1alpha"); + } + + @Test + public void testRecommendation_SinglePackage() { + ImmutableList packages = + ImmutableList.of(elements.getPackageElement("com.microsoft.samples.google.v1beta")); + + PackageElement recommended = packageLookup.getRecommended(packages); + + assertThat(String.valueOf(recommended.getQualifiedName())) + .isEqualTo("com.microsoft.samples.google.v1beta"); + } + + @Test + public void testRecommendation_WithUnversionedPackageCollection() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google"), + elements.getPackageElement("com.microsoft.samples")); + + assertThrows(IllegalStateException.class, () -> packageLookup.getRecommended(packages)); + } + + @Test + public void testRecommendation_WithDuplicates() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1beta"), + elements.getPackageElement("com.microsoft.samples.google.v1beta")); + + assertThrows(IllegalArgumentException.class, () -> packageLookup.getRecommended(packages)); + } + + @Test + public void testOrganize() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"), + elements.getPackageElement("com.microsoft.samples.google.v1beta"), + elements.getPackageElement("com.microsoft.samples.google.v1"), + elements.getPackageElement("com.microsoft.samples.google"), + elements.getPackageElement("com.microsoft.samples")); + + ImmutableListMultimap organized = + packageLookup.organize(packages); + + assertThat(organized.keys()).hasCount(PackageGroup.VISIBLE, 3); + assertThat(organized.keys()).hasCount(PackageGroup.OLDER_AND_PRERELEASE, 2); + + assertThat(toPackageNames(organized.get(PackageGroup.VISIBLE))) + .containsExactly( + "com.microsoft.samples", + "com.microsoft.samples.google", + "com.microsoft.samples.google.v1"); + + assertThat(toPackageNames(organized.get(PackageGroup.OLDER_AND_PRERELEASE))) + .containsExactly( + "com.microsoft.samples.google.v1beta", "com.microsoft.samples.google.v1p1alpha"); + } + + @Test + public void testOrganize_WithoutReleasePackage() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"), + elements.getPackageElement("com.microsoft.samples.google.v1beta"), + elements.getPackageElement("com.microsoft.samples.google"), + elements.getPackageElement("com.microsoft.samples")); + + ImmutableListMultimap organized = + packageLookup.organize(packages); + + assertThat(toPackageNames(organized.get(PackageGroup.VISIBLE))) + .containsExactly( + "com.microsoft.samples", + "com.microsoft.samples.google", + "com.microsoft.samples.google.v1p1alpha"); + + assertThat(toPackageNames(organized.get(PackageGroup.OLDER_AND_PRERELEASE))) + .containsExactly("com.microsoft.samples.google.v1beta"); + } + + private List toPackageNames(List packages) { + return packages.stream() + .map(pkg -> String.valueOf(pkg.getQualifiedName())) + .collect(Collectors.toList()); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocFileTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocFileTest.java index 990b4e11..cd0281ed 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocFileTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocFileTest.java @@ -16,7 +16,7 @@ package com.microsoft.model; -import static org.junit.Assert.assertEquals; +import static com.google.common.truth.Truth.assertThat; import org.junit.Test; @@ -25,22 +25,20 @@ public class TocFileTest { @Test public void sortsByUid() { TocFile tocFile = new TocFile("outputPath", "google-cloud-project", false); - TocItem tocItemA = new TocItem("A.uid.package.class", "name"); + TocItem tocItemA = new TocItem("a.uid.package.class", "name"); TocItem tocItemB = new TocItem("B.uid.package.class", "name"); - TocItem tocItemC = new TocItem("C.uid.package.class", "name"); + TocItem tocItemC = new TocItem("c.uid.package.class", "name"); + TocItem olderItem = new TocItem("Older and prerelease packages", "name"); tocFile.addTocItem(tocItemC); tocFile.addTocItem(tocItemA); + tocFile.addTocItem(olderItem); tocFile.addTocItem(tocItemB); - assertEquals("Should be out of uid order", tocFile.get(0), tocItemC); - assertEquals("Should be out of uid order", tocFile.get(1), tocItemA); - assertEquals("Should be out of uid order", tocFile.get(2), tocItemB); + assertThat(tocFile).containsExactly(tocItemC, tocItemA, olderItem, tocItemB).inOrder(); tocFile.sortByUid(); - assertEquals("Should sort toc by uid", tocFile.get(0), tocItemA); - assertEquals("Should sort toc by uid", tocFile.get(1), tocItemB); - assertEquals("Should sort toc by uid", tocFile.get(2), tocItemC); + assertThat(tocFile).containsExactly(tocItemA, tocItemB, tocItemC, olderItem).inOrder(); } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/SpeechClient.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/SpeechClient.java new file mode 100644 index 00000000..b727e35a --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/SpeechClient.java @@ -0,0 +1,404 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.microsoft.samples.google.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.*; +import com.google.cloud.speech.v1p1beta1.stub.SpeechStub; +import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. + +/** + * Service Description: Service that implements Google Cloud Speech API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+ *   RecognizeResponse response = speechClient.recognize(config, audio);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the SpeechClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of SpeechSettings to create(). + * For example: + * + *

To customize credentials: + * + *

{@code
+ * SpeechSettings speechSettings =
+ *     SpeechSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * SpeechClient speechClient = SpeechClient.create(speechSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class SpeechClient implements BackgroundResource { + private final com.microsoft.samples.google.SpeechSettings settings; + private final SpeechStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of SpeechClient with default settings. */ + public static final SpeechClient create() throws IOException { + return create(com.microsoft.samples.google.SpeechSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final SpeechClient create(com.microsoft.samples.google.SpeechSettings settings) + throws IOException { + return new SpeechClient(settings); + } + + /** + * Constructs an instance of SpeechClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(SpeechSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final SpeechClient create(SpeechStub stub) { + return new SpeechClient(stub); + } + + /** + * Constructs an instance of SpeechClient, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected SpeechClient(com.microsoft.samples.google.SpeechSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected SpeechClient(SpeechStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final com.microsoft.samples.google.SpeechSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public SpeechStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   RecognizeResponse response = speechClient.recognize(config, audio);
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio) { + RecognizeRequest request = + RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return recognize(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   RecognizeResponse response = speechClient.recognize(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RecognizeResponse recognize(RecognizeRequest request) { + return recognizeCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs synchronous speech recognition: receive results after all audio has been sent and + * processed. + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognizeRequest request =
+   *       RecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.recognizeCallable().futureCall(request);
+   *   // Do something.
+   *   RecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable recognizeCallable() { + return stub.recognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   RecognitionConfig config = RecognitionConfig.newBuilder().build();
+   *   RecognitionAudio audio = RecognitionAudio.newBuilder().build();
+   *   LongRunningRecognizeResponse response =
+   *       speechClient.longRunningRecognizeAsync(config, audio).get();
+   * }
+   * }
+ * + * @param config Required. Provides information to the recognizer that specifies how to process + * the request. + * @param audio Required. The audio data to be recognized. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio) { + LongRunningRecognizeRequest request = + LongRunningRecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build(); + return longRunningRecognizeAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture + longRunningRecognizeAsync(LongRunningRecognizeRequest request) { + return longRunningRecognizeOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   OperationFuture future =
+   *       speechClient.longRunningRecognizeOperationCallable().futureCall(request);
+   *   // Do something.
+   *   LongRunningRecognizeResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return stub.longRunningRecognizeOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs asynchronous speech recognition: receive results via the google.longrunning.Operations + * interface. Returns either an `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. For more information on asynchronous speech + * recognition, see the [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   LongRunningRecognizeRequest request =
+   *       LongRunningRecognizeRequest.newBuilder()
+   *           .setConfig(RecognitionConfig.newBuilder().build())
+   *           .setAudio(RecognitionAudio.newBuilder().build())
+   *           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = speechClient.longRunningRecognizeCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + longRunningRecognizeCallable() { + return stub.longRunningRecognizeCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Performs bidirectional streaming speech recognition: receive results while sending audio. This + * method is only available via the gRPC API (not REST). + * + *

Sample code: + * + *

{@code
+   * try (SpeechClient speechClient = SpeechClient.create()) {
+   *   BidiStream bidiStream =
+   *       speechClient.streamingRecognizeCallable().call();
+   *   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();
+   *   bidiStream.send(request);
+   *   for (StreamingRecognizeResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable + streamingRecognizeCallable() { + return stub.streamingRecognizeCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ApiVersionTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ApiVersionTest.java index aaa67c29..2be79e0d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ApiVersionTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ApiVersionTest.java @@ -2,9 +2,12 @@ import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertThrows; import static org.junit.Assert.assertTrue; +import com.google.common.collect.ImmutableList; import com.google.docfx.doclet.ApiVersion; +import java.util.Collections; import org.junit.Test; public class ApiVersionTest { @@ -70,4 +73,37 @@ public void equals() { private ApiVersion parse(String s) { return ApiVersion.parse(s).orElseThrow(() -> new IllegalStateException("Unable to parse " + s)); } + + @Test + public void testRecommendation_PrioritizesReleaseVersions() { + ImmutableList versions = + ImmutableList.of(parse("v101beta"), parse("v2p1"), parse("v1p14alpha15"), parse("v1")); + + ApiVersion recommended = ApiVersion.getRecommended(versions); + assertThat(recommended).isEqualTo(parse("v2p1")); + } + + @Test + public void testRecommendation_ChoosesLatestPrerelease_WhenNoReleaseVersionsAvailable() { + ImmutableList versions = + ImmutableList.of( + parse("v101beta"), parse("v1p14alpha15"), parse("v102alpha"), parse("v1p2beta3")); + + ApiVersion recommended = ApiVersion.getRecommended(versions); + assertThat(recommended).isEqualTo(parse("v102alpha")); + } + + @Test + public void testRecommendation_SingleOption() { + ImmutableList versions = ImmutableList.of(parse("v1p14alpha15")); + + ApiVersion recommended = ApiVersion.getRecommended(versions); + assertThat(recommended).isEqualTo(parse("v1p14alpha15")); + } + + @Test + public void testRecommendation_doesNotAllowEmptyInput() { + assertThrows( + IllegalArgumentException.class, () -> ApiVersion.getRecommended(Collections.emptyList())); + } } diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.SpeechClient.yml new file mode 100644 index 00000000..1bbac731 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.SpeechClient.yml @@ -0,0 +1,833 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.SpeechClient" + id: "SpeechClient" + parent: "com.microsoft.samples.google.v1" + children: + - "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + - "com.microsoft.samples.google.v1.SpeechClient.close()" + - "com.microsoft.samples.google.v1.SpeechClient.create()" + - "com.microsoft.samples.google.v1.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient()" + - "com.microsoft.samples.google.v1.SpeechClient.getSettings()" + - "com.microsoft.samples.google.v1.SpeechClient.getStub()" + - "com.microsoft.samples.google.v1.SpeechClient.isShutdown()" + - "com.microsoft.samples.google.v1.SpeechClient.isTerminated()" + - "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + - "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + - "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable()" + - "com.microsoft.samples.google.v1.SpeechClient.shutdown()" + - "com.microsoft.samples.google.v1.SpeechClient.shutdownNow()" + - "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable()" + langs: + - "java" + name: "SpeechClient" + nameWithType: "SpeechClient" + fullName: "com.microsoft.samples.google.v1.SpeechClient" + type: "Class" + package: "com.microsoft.samples.google.v1" + summary: "Service Description: Service that implements Google Cloud Speech API.\n\n

This class provides the ability to make remote calls to the backing service through method\n calls that map to API methods. Sample code to get started:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   RecognitionConfig config = RecognitionConfig.newBuilder().build();\n   RecognitionAudio audio = RecognitionAudio.newBuilder().build();\n   RecognizeResponse response = speechClient.recognize(config, audio);\n }\n 
\n\n

Note: close() needs to be called on the SpeechClient object to clean up resources such as\n threads. In the example above, try-with-resources is used, which automatically calls close().\n\n

The surface of this class includes several types of Java methods for each of the API's\n methods:\n\n

    \n
  1. A \"flattened\" method. With this type of method, the fields of the request type have been\n converted into function parameters. It may be the case that not all fields are available as\n parameters, and not every API method will have a flattened method entry point.\n
  2. A \"request object\" method. This type of method only takes one parameter, a request object,\n which must be constructed before the call. Not every API method will have a request object\n method.\n
  3. A \"callable\" method. This type of method takes no parameters and returns an immutable API\n callable object, which can be used to initiate calls to the service.\n
\n\n

See the individual methods for example code.\n\n

Many parameters require resource names to be formatted in a particular way. To assist with\n these names, this class includes a format method for each type of name, and additionally a parse\n method to extract the individual identifiers contained within names that are returned.\n\n

This class can be customized by passing in a custom instance of SpeechSettings to create().\n For example:\n\n

To customize credentials:\n\n

\n SpeechSettings speechSettings =\n     SpeechSettings.newBuilder()\n         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))\n         .build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n 
\n\n

To customize the endpoint:\n\n

\n SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n 
\n\n

Please refer to the GitHub repository's samples for more quickstart code snippets." + syntax: + content: "public class SpeechClient implements BackgroundResource" + inheritance: + - "java.lang.Object" + implements: + - "com.google.api.gax.core.BackgroundResource" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + id: "SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "SpeechClient(SpeechStub stub)" + nameWithType: "SpeechClient.SpeechClient(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(SpeechStub stub)" + overload: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1" + syntax: + content: "protected SpeechClient(SpeechStub stub)" + parameters: + - id: "stub" + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- uid: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" + id: "SpeechClient(com.microsoft.samples.google.SpeechSettings)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "SpeechClient(SpeechSettings settings)" + nameWithType: "SpeechClient.SpeechClient(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient(SpeechSettings settings)" + overload: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1" + summary: "Constructs an instance of SpeechClient, using the given settings. This is protected so that it\n is easy to make a subclass, but otherwise, the static factory methods should be preferred." + syntax: + content: "protected SpeechClient(SpeechSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + id: "awaitTermination(long,java.util.concurrent.TimeUnit)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "awaitTermination(long duration, TimeUnit unit)" + nameWithType: "SpeechClient.awaitTermination(long duration, TimeUnit unit)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.awaitTermination(long duration, TimeUnit unit)" + overload: "com.microsoft.samples.google.v1.SpeechClient.awaitTermination*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public boolean awaitTermination(long duration, TimeUnit unit)" + parameters: + - id: "duration" + type: "long" + - id: "unit" + type: "java.util.concurrent.TimeUnit" + return: + type: "boolean" + exceptions: + - type: "java.lang.InterruptedException" +- uid: "com.microsoft.samples.google.v1.SpeechClient.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "close()" + nameWithType: "SpeechClient.close()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.close()" + overload: "com.microsoft.samples.google.v1.SpeechClient.close*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public final void close()" +- uid: "com.microsoft.samples.google.v1.SpeechClient.create()" + id: "create()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "create()" + nameWithType: "SpeechClient.create()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.create()" + overload: "com.microsoft.samples.google.v1.SpeechClient.create*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Constructs an instance of SpeechClient with default settings." + syntax: + content: "public static final SpeechClient create()" + return: + type: "com.microsoft.samples.google.v1.SpeechClient" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + id: "create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "create(SpeechStub stub)" + nameWithType: "SpeechClient.create(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.create(SpeechStub stub)" + overload: "com.microsoft.samples.google.v1.SpeechClient.create*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Constructs an instance of SpeechClient, using the given stub for making calls. This is for\n advanced usage - prefer using create(SpeechSettings)." + syntax: + content: "public static final SpeechClient create(SpeechStub stub)" + parameters: + - id: "stub" + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + return: + type: "com.microsoft.samples.google.v1.SpeechClient" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" + id: "create(com.microsoft.samples.google.SpeechSettings)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "create(SpeechSettings settings)" + nameWithType: "SpeechClient.create(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.create(SpeechSettings settings)" + overload: "com.microsoft.samples.google.v1.SpeechClient.create*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Constructs an instance of SpeechClient, using the given settings. The channels are created\n based on the settings passed in, or defaults for any settings that are not set." + syntax: + content: "public static final SpeechClient create(SpeechSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.SpeechSettings" + return: + type: "com.microsoft.samples.google.v1.SpeechClient" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient()" + id: "getOperationsClient()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "getOperationsClient()" + nameWithType: "SpeechClient.getOperationsClient()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient()" + overload: "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Returns the OperationsClient that can be used to query the status of a long-running operation\n returned by another API method call." + syntax: + content: "public final OperationsClient getOperationsClient()" + return: + type: "com.google.longrunning.OperationsClient" +- uid: "com.microsoft.samples.google.v1.SpeechClient.getSettings()" + id: "getSettings()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "getSettings()" + nameWithType: "SpeechClient.getSettings()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getSettings()" + overload: "com.microsoft.samples.google.v1.SpeechClient.getSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public final SpeechSettings getSettings()" + return: + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1.SpeechClient.getStub()" + id: "getStub()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "getStub()" + nameWithType: "SpeechClient.getStub()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getStub()" + overload: "com.microsoft.samples.google.v1.SpeechClient.getStub*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public SpeechStub getStub()" + return: + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- uid: "com.microsoft.samples.google.v1.SpeechClient.isShutdown()" + id: "isShutdown()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "isShutdown()" + nameWithType: "SpeechClient.isShutdown()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.isShutdown()" + overload: "com.microsoft.samples.google.v1.SpeechClient.isShutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public boolean isShutdown()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.SpeechClient.isTerminated()" + id: "isTerminated()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "isTerminated()" + nameWithType: "SpeechClient.isTerminated()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.isTerminated()" + overload: "com.microsoft.samples.google.v1.SpeechClient.isTerminated*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public boolean isTerminated()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + id: "longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + overload: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   LongRunningRecognizeResponse response = speechClient.longRunningRecognizeAsync(request).get();\n }\n 
" + syntax: + content: "public final OperationFuture longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + parameters: + - id: "request" + type: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + description: "The request object containing all of the parameters for the API call." + return: + type: "com.google.api.gax.longrunning.OperationFuture" +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + id: "longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + overload: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   RecognitionConfig config = RecognitionConfig.newBuilder().build();\n   RecognitionAudio audio = RecognitionAudio.newBuilder().build();\n   LongRunningRecognizeResponse response =\n       speechClient.longRunningRecognizeAsync(config, audio).get();\n }\n 
" + syntax: + content: "public final OperationFuture longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + parameters: + - id: "config" + type: "com.google.cloud.speech.v1p1beta1.RecognitionConfig" + description: "Required. Provides information to the recognizer that specifies how to process\n the request." + - id: "audio" + type: "com.google.cloud.speech.v1p1beta1.RecognitionAudio" + description: "Required. The audio data to be recognized." + return: + type: "com.google.api.gax.longrunning.OperationFuture" +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "SpeechClient.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   ApiFuture<Operation> future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + syntax: + content: "public final UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable()" + overload: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs asynchronous speech recognition: receive results via the google.longrunning.Operations\n interface. Returns either an Operation.error or an Operation.response which contains a\n LongRunningRecognizeResponse message. For more information on asynchronous speech\n recognition, see the how-to.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   LongRunningRecognizeRequest request =\n       LongRunningRecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .setOutputConfig(TranscriptOutputConfig.newBuilder().build())\n           .build();\n   OperationFuture<LongRunningRecognizeResponse, LongRunningRecognizeMetadata> future =\n       speechClient.longRunningRecognizeOperationCallable().futureCall(request);\n   // Do something.\n   LongRunningRecognizeResponse response = future.get();\n }\n 
" + syntax: + content: "public final OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + id: "recognize(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "recognize(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + overload: "com.microsoft.samples.google.v1.SpeechClient.recognize*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs synchronous speech recognition: receive results after all audio has been sent and\n processed.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   RecognitionConfig config = RecognitionConfig.newBuilder().build();\n   RecognitionAudio audio = RecognitionAudio.newBuilder().build();\n   RecognizeResponse response = speechClient.recognize(config, audio);\n }\n 
" + syntax: + content: "public final RecognizeResponse recognize(RecognitionConfig config, RecognitionAudio audio)" + parameters: + - id: "config" + type: "com.google.cloud.speech.v1p1beta1.RecognitionConfig" + description: "Required. Provides information to the recognizer that specifies how to process\n the request." + - id: "audio" + type: "com.google.cloud.speech.v1p1beta1.RecognitionAudio" + description: "Required. The audio data to be recognized." + return: + type: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" +- uid: "com.microsoft.samples.google.v1.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + id: "recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "recognize(RecognizeRequest request)" + nameWithType: "SpeechClient.recognize(RecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1.SpeechClient.recognize(RecognizeRequest request)" + overload: "com.microsoft.samples.google.v1.SpeechClient.recognize*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs synchronous speech recognition: receive results after all audio has been sent and\n processed.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   RecognizeRequest request =\n       RecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .build();\n   RecognizeResponse response = speechClient.recognize(request);\n }\n 
" + syntax: + content: "public final RecognizeResponse recognize(RecognizeRequest request)" + parameters: + - id: "request" + type: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + description: "The request object containing all of the parameters for the API call." + return: + type: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" +- uid: "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "SpeechClient.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable()" + overload: "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs synchronous speech recognition: receive results after all audio has been sent and\n processed.\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   RecognizeRequest request =\n       RecognizeRequest.newBuilder()\n           .setConfig(RecognitionConfig.newBuilder().build())\n           .setAudio(RecognitionAudio.newBuilder().build())\n           .build();\n   ApiFuture<RecognizeResponse> future = speechClient.recognizeCallable().futureCall(request);\n   // Do something.\n   RecognizeResponse response = future.get();\n }\n 
" + syntax: + content: "public final UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.SpeechClient.shutdown()" + id: "shutdown()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "shutdown()" + nameWithType: "SpeechClient.shutdown()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.shutdown()" + overload: "com.microsoft.samples.google.v1.SpeechClient.shutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public void shutdown()" +- uid: "com.microsoft.samples.google.v1.SpeechClient.shutdownNow()" + id: "shutdownNow()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "shutdownNow()" + nameWithType: "SpeechClient.shutdownNow()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.shutdownNow()" + overload: "com.microsoft.samples.google.v1.SpeechClient.shutdownNow*" + type: "Method" + package: "com.microsoft.samples.google.v1" + syntax: + content: "public void shutdownNow()" +- uid: "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "SpeechClient.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1" + summary: "Performs bidirectional streaming speech recognition: receive results while sending audio. This\n method is only available via the gRPC API (not REST).\n\n

Sample code:\n\n

\n try (SpeechClient speechClient = SpeechClient.create()) {\n   BidiStream<StreamingRecognizeRequest, StreamingRecognizeResponse> bidiStream =\n       speechClient.streamingRecognizeCallable().call();\n   StreamingRecognizeRequest request = StreamingRecognizeRequest.newBuilder().build();\n   bidiStream.send(request);\n   for (StreamingRecognizeResponse response : bidiStream) {\n     // Do something when a response is received.\n   }\n }\n 
" + syntax: + content: "public final BidiStreamingCallable streamingRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.BidiStreamingCallable" +references: +- uid: "com.microsoft.samples.google.SpeechSettings" + name: "SpeechSettings" + nameWithType: "SpeechSettings" + fullName: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient*" + name: "SpeechClient" + nameWithType: "SpeechClient.SpeechClient" + fullName: "com.microsoft.samples.google.v1.SpeechClient.SpeechClient" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + name: "SpeechStub" + fullName: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + isExternal: false +- uid: "java.io.IOException" + href: "https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" + spec.java: + - uid: "java.io.IOException" + name: "IOException" + fullName: "java.io.IOException" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html" +- uid: "com.microsoft.samples.google.v1.SpeechClient.create*" + name: "create" + nameWithType: "SpeechClient.create" + fullName: "com.microsoft.samples.google.v1.SpeechClient.create" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.getSettings*" + name: "getSettings" + nameWithType: "SpeechClient.getSettings" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getSettings" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.getStub*" + name: "getStub" + nameWithType: "SpeechClient.getStub" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getStub" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.longrunning.OperationsClient" + isExternal: true + spec.java: + - uid: "com.google.longrunning.OperationsClient" + name: "OperationsClient" + fullName: "com.google.longrunning.OperationsClient" + isExternal: true +- uid: "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient*" + name: "getOperationsClient" + nameWithType: "SpeechClient.getOperationsClient" + fullName: "com.microsoft.samples.google.v1.SpeechClient.getOperationsClient" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.cloud.speech.v1p1beta1.RecognitionConfig" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.RecognitionConfig" + name: "RecognitionConfig" + fullName: "com.google.cloud.speech.v1p1beta1.RecognitionConfig" + isExternal: false +- uid: "com.google.cloud.speech.v1p1beta1.RecognitionAudio" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.RecognitionAudio" + name: "RecognitionAudio" + fullName: "com.google.cloud.speech.v1p1beta1.RecognitionAudio" + isExternal: false +- uid: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" + name: "RecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.recognize*" + name: "recognize" + nameWithType: "SpeechClient.recognize" + fullName: "com.microsoft.samples.google.v1.SpeechClient.recognize" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + name: "RecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + isExternal: false +- uid: "com.google.api.gax.rpc.UnaryCallable" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallable" + name: "UnaryCallable" + fullName: "com.google.api.gax.rpc.UnaryCallable" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + name: "RecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.RecognizeRequest" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" + name: "RecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.RecognizeResponse" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "SpeechClient.recognizeCallable" + fullName: "com.microsoft.samples.google.v1.SpeechClient.recognizeCallable" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.api.gax.longrunning.OperationFuture" + isExternal: true + spec.java: + - uid: "com.google.api.gax.longrunning.OperationFuture" + name: "OperationFuture" + fullName: "com.google.api.gax.longrunning.OperationFuture" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" + name: "LongRunningRecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + name: "LongRunningRecognizeMetadata" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync*" + name: "longRunningRecognizeAsync" + nameWithType: "SpeechClient.longRunningRecognizeAsync" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeAsync" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + spec.java: + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + name: "LongRunningRecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + isExternal: false +- uid: "com.google.api.gax.rpc.OperationCallable" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.OperationCallable" + name: "OperationCallable" + fullName: "com.google.api.gax.rpc.OperationCallable" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + name: "LongRunningRecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" + name: "LongRunningRecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + name: "LongRunningRecognizeMetadata" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.api.gax.rpc.UnaryCallable" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallable" + name: "UnaryCallable" + fullName: "com.google.api.gax.rpc.UnaryCallable" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + name: "LongRunningRecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.longrunning.Operation" + name: "Operation" + fullName: "com.google.longrunning.Operation" + isExternal: true + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "SpeechClient.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.SpeechClient.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.api.gax.rpc.BidiStreamingCallable" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.BidiStreamingCallable" + name: "BidiStreamingCallable" + fullName: "com.google.api.gax.rpc.BidiStreamingCallable" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest" + name: "StreamingRecognizeRequest" + fullName: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" + name: "StreamingRecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "SpeechClient.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.SpeechClient.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.close*" + name: "close" + nameWithType: "SpeechClient.close" + fullName: "com.microsoft.samples.google.v1.SpeechClient.close" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.shutdown*" + name: "shutdown" + nameWithType: "SpeechClient.shutdown" + fullName: "com.microsoft.samples.google.v1.SpeechClient.shutdown" + package: "com.microsoft.samples.google.v1" +- uid: "boolean" + href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" + spec.java: + - uid: "boolean" + name: "boolean" + fullName: "boolean" + isExternal: false +- uid: "com.microsoft.samples.google.v1.SpeechClient.isShutdown*" + name: "isShutdown" + nameWithType: "SpeechClient.isShutdown" + fullName: "com.microsoft.samples.google.v1.SpeechClient.isShutdown" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.isTerminated*" + name: "isTerminated" + nameWithType: "SpeechClient.isTerminated" + fullName: "com.microsoft.samples.google.v1.SpeechClient.isTerminated" + package: "com.microsoft.samples.google.v1" +- uid: "com.microsoft.samples.google.v1.SpeechClient.shutdownNow*" + name: "shutdownNow" + nameWithType: "SpeechClient.shutdownNow" + fullName: "com.microsoft.samples.google.v1.SpeechClient.shutdownNow" + package: "com.microsoft.samples.google.v1" +- uid: "java.lang.InterruptedException" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html" + spec.java: + - uid: "java.lang.InterruptedException" + name: "InterruptedException" + fullName: "java.lang.InterruptedException" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html" +- uid: "long" + href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" + spec.java: + - uid: "long" + name: "long" + fullName: "long" + isExternal: false +- uid: "java.util.concurrent.TimeUnit" + href: "https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html" + spec.java: + - uid: "java.util.concurrent.TimeUnit" + name: "TimeUnit" + fullName: "java.util.concurrent.TimeUnit" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html" +- uid: "com.microsoft.samples.google.v1.SpeechClient.awaitTermination*" + name: "awaitTermination" + nameWithType: "SpeechClient.awaitTermination" + fullName: "com.microsoft.samples.google.v1.SpeechClient.awaitTermination" + package: "com.microsoft.samples.google.v1" +- uid: "com.google.api.gax.core.BackgroundResource" + isExternal: true + name: "BackgroundResource" + nameWithType: "BackgroundResource" + fullName: "com.google.api.gax.core.BackgroundResource" +- uid: "java.lang.Object.notify()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" + name: "Object.notify()" + nameWithType: "Object.notify()" + fullName: "java.lang.Object.notify()" +- uid: "java.lang.Object.wait()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" + name: "Object.wait()" + nameWithType: "Object.wait()" + fullName: "java.lang.Object.wait()" +- uid: "java.lang.Object.finalize()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--" + name: "Object.finalize()" + nameWithType: "Object.finalize()" + fullName: "java.lang.Object.finalize()" +- uid: "java.lang.Object.clone()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--" + name: "Object.clone()" + nameWithType: "Object.clone()" + fullName: "java.lang.Object.clone()" +- uid: "java.lang.Object.notifyAll()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" + name: "Object.notifyAll()" + nameWithType: "Object.notifyAll()" + fullName: "java.lang.Object.notifyAll()" +- uid: "java.lang.Object.equals(java.lang.Object)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" + name: "Object.equals(Object)" + nameWithType: "Object.equals(Object)" + fullName: "java.lang.Object.equals(java.lang.Object)" +- uid: "java.lang.Object.getClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" + name: "Object.getClass()" + nameWithType: "Object.getClass()" + fullName: "java.lang.Object.getClass()" +- uid: "java.lang.Object.wait(long)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" + name: "Object.wait(long)" + nameWithType: "Object.wait(long)" + fullName: "java.lang.Object.wait(long)" +- uid: "java.lang.Object.hashCode()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" + name: "Object.hashCode()" + nameWithType: "Object.hashCode()" + fullName: "java.lang.Object.hashCode()" +- uid: "java.lang.Object.wait(long,int)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" + name: "Object.wait(long,int)" + nameWithType: "Object.wait(long,int)" + fullName: "java.lang.Object.wait(long,int)" +- uid: "java.lang.Object.toString()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" + name: "Object.toString()" + nameWithType: "Object.toString()" + fullName: "java.lang.Object.toString()" +- uid: "com.google.api.gax.rpc.UnaryCallable" + isExternal: true + name: "UnaryCallable" + nameWithType: "UnaryCallable" + fullName: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.google.cloud.speech.v1p1beta1.RecognizeRequest,com.google.cloud.speech.v1p1beta1.RecognizeResponse" + name: "RecognizeRequest,RecognizeResponse" + nameWithType: "RecognizeRequest,RecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.RecognizeRequest,com.google.cloud.speech.v1p1beta1.RecognizeResponse" +- uid: "com.google.api.gax.longrunning.OperationFuture" + isExternal: true + name: "OperationFuture" + nameWithType: "OperationFuture" + fullName: "com.google.api.gax.longrunning.OperationFuture" +- uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + name: "LongRunningRecognizeResponse,LongRunningRecognizeMetadata" + nameWithType: "LongRunningRecognizeResponse,LongRunningRecognizeMetadata" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" +- uid: "com.google.api.gax.rpc.OperationCallable" + isExternal: true + name: "OperationCallable" + nameWithType: "OperationCallable" + fullName: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" + name: "LongRunningRecognizeRequest,LongRunningRecognizeResponse,LongRunningRecognizeMetadata" + nameWithType: "LongRunningRecognizeRequest,LongRunningRecognizeResponse,LongRunningRecognizeMetadata" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse,com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" +- uid: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest,com.google.longrunning.Operation" + name: "LongRunningRecognizeRequest,Operation" + nameWithType: "LongRunningRecognizeRequest,Operation" + fullName: "com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest,com.google.longrunning.Operation" +- uid: "com.google.api.gax.rpc.BidiStreamingCallable" + isExternal: true + name: "BidiStreamingCallable" + nameWithType: "BidiStreamingCallable" + fullName: "com.google.api.gax.rpc.BidiStreamingCallable" +- uid: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest,com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" + name: "StreamingRecognizeRequest,StreamingRecognizeResponse" + nameWithType: "StreamingRecognizeRequest,StreamingRecognizeResponse" + fullName: "com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest,com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.yml new file mode 100644 index 00000000..7ed2588c --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.yml @@ -0,0 +1,20 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1" + id: "v1" + children: + - "com.microsoft.samples.google.v1.SpeechClient" + langs: + - "java" + name: "com.microsoft.samples.google.v1" + nameWithType: "com.microsoft.samples.google.v1" + fullName: "com.microsoft.samples.google.v1" + type: "Namespace" + syntax: + content: "package com.microsoft.samples.google.v1" + javaType: "package" +references: +- uid: "com.microsoft.samples.google.v1.SpeechClient" + name: "SpeechClient" + nameWithType: "SpeechClient" + fullName: "com.microsoft.samples.google.v1.SpeechClient" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.yml index ea4eedf2..4af78bae 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.yml @@ -6,6 +6,7 @@ items: - "com.microsoft.samples.agreements" - "com.microsoft.samples.commentinheritance" - "com.microsoft.samples.google" + - "com.microsoft.samples.google.v1" - "com.microsoft.samples.google.v1beta" - "com.microsoft.samples.google.v1p1alpha" - "com.microsoft.samples.offers" @@ -17,6 +18,10 @@ items: type: "Namespace" javaType: "overview" references: +- uid: "com.microsoft.samples" + name: "com.microsoft.samples" + nameWithType: "com.microsoft.samples" + fullName: "com.microsoft.samples" - uid: "com.microsoft.samples.agreements" name: "com.microsoft.samples.agreements" nameWithType: "com.microsoft.samples.agreements" @@ -29,14 +34,14 @@ references: name: "com.microsoft.samples.google" nameWithType: "com.microsoft.samples.google" fullName: "com.microsoft.samples.google" +- uid: "com.microsoft.samples.google.v1" + name: "com.microsoft.samples.google.v1" + nameWithType: "com.microsoft.samples.google.v1" + fullName: "com.microsoft.samples.google.v1" - uid: "com.microsoft.samples.offers" name: "com.microsoft.samples.offers" nameWithType: "com.microsoft.samples.offers" fullName: "com.microsoft.samples.offers" -- uid: "com.microsoft.samples" - name: "com.microsoft.samples" - nameWithType: "com.microsoft.samples" - fullName: "com.microsoft.samples" - uid: "com.microsoft.samples.subpackage" name: "com.microsoft.samples.subpackage" nameWithType: "com.microsoft.samples.subpackage" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml index d2bbf837..ba7459c0 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml @@ -108,23 +108,13 @@ - heading: "Exceptions" - uid: "com.microsoft.samples.google.ValidationException" name: "ValidationException" - - uid: "com.microsoft.samples.google.v1beta" - name: "com.microsoft.samples.google.v1beta" - status: "beta" + - uid: "com.microsoft.samples.google.v1" + name: "com.microsoft.samples.google.v1" items: - - uid: "com.microsoft.samples.google.v1beta" + - uid: "com.microsoft.samples.google.v1" name: "Package summary" - heading: "Classes" - - uid: "com.microsoft.samples.google.v1beta.SpeechClient" - name: "SpeechClient" - - uid: "com.microsoft.samples.google.v1p1alpha" - name: "com.microsoft.samples.google.v1p1alpha" - status: "alpha" - items: - - uid: "com.microsoft.samples.google.v1p1alpha" - name: "Package summary" - - heading: "Classes" - - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + - uid: "com.microsoft.samples.google.v1.SpeechClient" name: "SpeechClient" - uid: "com.microsoft.samples.offers" name: "com.microsoft.samples.offers" @@ -155,3 +145,24 @@ - heading: "Exceptions" - uid: "com.microsoft.samples.subpackage.CustomException" name: "CustomException" + - uid: "Older and prerelease packages" + name: "Older and prerelease packages" + items: + - uid: "com.microsoft.samples.google.v1beta" + name: "com.microsoft.samples.google.v1beta" + status: "beta" + items: + - uid: "com.microsoft.samples.google.v1beta" + name: "Package summary" + - heading: "Classes" + - uid: "com.microsoft.samples.google.v1beta.SpeechClient" + name: "SpeechClient" + - uid: "com.microsoft.samples.google.v1p1alpha" + name: "com.microsoft.samples.google.v1p1alpha" + status: "alpha" + items: + - uid: "com.microsoft.samples.google.v1p1alpha" + name: "Package summary" + - heading: "Classes" + - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + name: "SpeechClient"