diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6b9dcffd..3350cc68 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # For syntax help see: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax -* @googleapis/yoshi-java \ No newline at end of file +* @googleapis/cloud-sdk-java-team \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7f37349..ea531de5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,46 +1,44 @@ -# This is a basic workflow to help you get started with Actions +name: ci -name: CI - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] pull_request: branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel +defaults: + run: + working-directory: ./third_party/docfx-doclet-143274 + jobs: - # This workflow contains a single job called "build" build: - # The type of runner that the job will run on runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: - java-version: 11 - - name: build project - working-directory: ./third_party/docfx-doclet-143274 - run: mvn clean install -DskipTests + java-version: 17 + distribution: temurin + - run: mvn -B -ntp install -DskipTests + test: - # The type of runner that the job will run on runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: temurin + - run: mvn -B -ntp test - # Steps represent a sequence of tasks that will be executed as part of the job + lint: + runs-on: ubuntu-latest steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: java-version: 11 - - name: pass tests - working-directory: ./third_party/docfx-doclet-143274 - run: mvn clean test + distribution: temurin + - run: mvn --version + - run: mvn -B -ntp fmt:check diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6272489d..bab9c54d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,10 @@ # How to Contribute -We'd love to accept your patches and contributions to this project. There are -just a few small guidelines you need to follow. +We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow before opening an issue or a PR: +1. Ensure the issue was not already reported. +2. Open a new issue if you are unable to find an existing issue addressing your problem. Make sure to include a title and clear description, as much relevant information as possible, and a code sample or an executable test case demonstrating the expected behavior that is not occurring. +3. Discuss the priority and potential solutions with the maintainers in the issue. The maintainers would review the issue and add a label "Accepting Contributions" once the issue is ready for accepting contributions. +4. Open a PR only if the issue is labeled with "Accepting Contributions", ensure the PR description clearly describes the problem and solution. Note that an open PR without an issue labeled with "Accepting Contributions" will not be accepted. ## Contributor License Agreement diff --git a/README.md b/README.md index ca6356fb..de785ef4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ ## JavaDoc Doclet for DocFX for Google -Designed to generate YAML files from Javadoc output for DocFX consumption. While the doclet helps output docfx yml, there are some differences in the way Google needs this outputed to align with the other languages and look appropriate on devsite. +Designed to generate YAML files from Javadoc output for DocFX consumption. While the doclet helps output docfx yml, there are some differences in the way Google needs this outputed to align with the other languages and look appropriate on [cloud.google.com](https://cloud.google.com/java/docs/reference). The original github repository for the doclet can be found at [github.com/docascode/docfx-doclet](https://github.com/docascode/docfx-doclet). -This doclet is forked from release [143274](https://github.com/docascode/docfx-doclet/releases/tag/143274) from June 2020 as it is still compatible with DocFX V2. +This doclet is forked from release [143274](https://github.com/docascode/docfx-doclet/releases/tag/143274) from June 2020 as it is still compatible with DocFX V2. This doclet has since been refactored and various features and fixes have been included. \ This is not an officially supported Google product. diff --git a/renovate.json b/renovate.json index f45d8f11..d0bc48eb 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,11 @@ { "extends": [ "config:base" + ], + "packageRules": [ + { + "matchPackageNames": ["com.google.cloud:google-cloud-vision"], + "allowedVersions": "<=2.0.13" + } ] } diff --git a/third_party/docfx-doclet-143274/README.md b/third_party/docfx-doclet-143274/README.md index 4a97a0f4..f1c9131a 100644 --- a/third_party/docfx-doclet-143274/README.md +++ b/third_party/docfx-doclet-143274/README.md @@ -1,15 +1,15 @@ ## JavaDoc Doclet for DocFX -[![Build status](https://apidrop.visualstudio.com/Toolshed/_apis/build/status/Toolshed-Maven-CI)](https://apidrop.visualstudio.com/Toolshed/_build/latest?definitionId=1633) - This doclet is designed to produce a YAML representation of the Javadoc-generated documentation, that can be integrated into [DocFX](https://dotnet.github.io/docfx/). +It contains some Google-specific configurations to render pages on cloud.google.com. +The latest version of this doclet has been updated to be run with Java 17. It should work with Java 11 to generate Yaml files; however, the unit tests within this repo will fail. ## Getting started -The easiest way is to just get the JAR files directly from our [releases](https://github.com/dendeli-msft/docfx-doclet/releases). +This repo is a fork off of: [https://github.com/docascode/docfx-doclet](https://github.com/dendeli-msft/docfx-doclet/releases). -Alternatively, you can clone the repository and build it with the help of Maven. You can do so by calling: +You can clone this repository and build it with the help of Maven. You can do so by calling: ```bash mvn compile @@ -23,17 +23,34 @@ mvn package This will produce two JAR files that you can use - one with dependencies, and another one without. +To run the linter: +```bash +mvn fmt:format +``` +## Release Guide + +To cut a new release of the doclet for updated Cloud RAD content, do the following steps: + +1) Manually update the [version of the doclet in the pom.xml](https://github.com/googleapis/java-docfx-doclet/blob/main/third_party/docfx-doclet-143274/pom.xml#L9) to the next minor or patch version. +2) Commit that version update to the `main` branch, and then add a git tag to that version (minus the `-SNAPSHOT`). You can use the below commands as a template: + +` git tag -a v1.. -m ""` + +`git push origin v1..` + +3) Update the `publish_javadoc17.sh` script within g3 to use the latest version of the doclet. + ## Usage ### With `maven-javadoc-plugin` When there is an existing java project where Maven is used as a build tool, one could add `maven-javadoc-plugin` to the root `pom.xml`: -```java +```xml org.apache.maven.plugins maven-javadoc-plugin - 3.0.1 + 3.5.0 com.microsoft.doclet.DocFxDoclet @@ -80,7 +97,7 @@ One can execute the `javadoc` command with the command line parameters: ```bash javadoc \ -encoding UTF-8 \ --docletpath ./target/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies.jar \ +-docletpath ./target/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies.jar \ # Update the version here to the doclet version you want to use -doclet com.microsoft.doclet.DocFxDoclet \ -classpath \ -sourcepath ./src/test/java \ @@ -121,7 +138,7 @@ You can take a look at an [example documentation generation script](https://gith ## Development -When making changes, it is important to ensure that you are using `DocletRunner` class - it is responsible for makeing the `javadoc` call and takes params from an external configuration file. +When making changes, it is important to ensure that you are using `DocletRunner` class - it is responsible for making the `javadoc` call and takes params from an external configuration file. To use it: diff --git a/third_party/docfx-doclet-143274/intellij-java-google-style.xml b/third_party/docfx-doclet-143274/intellij-java-google-style.xml deleted file mode 100644 index f3a6743e..00000000 --- a/third_party/docfx-doclet-143274/intellij-java-google-style.xml +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - diff --git a/third_party/docfx-doclet-143274/pom.xml b/third_party/docfx-doclet-143274/pom.xml index 4d1f749c..2e347308 100644 --- a/third_party/docfx-doclet-143274/pom.xml +++ b/third_party/docfx-doclet-143274/pom.xml @@ -6,17 +6,17 @@ com.microsoft docfx-doclet - 1.0-SNAPSHOT + 1.16.0-SNAPSHOT UTF-8 - 11 - ${java.version} - ${java.version} - 2.13.0 - 3.12.0 + 17 + 17 + 2.17.0 + 3.14.0 4.4 - 2.11.0 + 2.16.1 + 1.12.0 1.1.0 @@ -25,7 +25,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 -Xlint:unchecked @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.3.0 + 3.7.1 @@ -58,7 +58,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.6.3 com.microsoft.doclet.DocFxDoclet @@ -76,7 +76,7 @@ org.jacoco jacoco-maven-plugin - 0.8.7 + 0.8.12 @@ -92,9 +92,38 @@ + + + com.spotify.fmt + fmt-maven-plugin + 2.23 + + + true + + + + com.google.googlejavaformat + google-java-format + 1.22.0 + + + + + + + com.google.cloud + libraries-bom + 26.37.0 + pom + import + + + + org.apache.commons @@ -111,6 +140,11 @@ commons-io ${apache.commons-io.version} + + org.apache.commons + commons-text + ${apache.commons-text.version} + com.fasterxml.jackson.core jackson-databind @@ -124,7 +158,17 @@ org.jsoup jsoup - 1.14.3 + 1.17.2 + + + com.google.guava + guava + 33.1.0-jre + + + com.google.code.gson + gson + 2.10.1 @@ -137,25 +181,23 @@ org.mockito mockito-core - 4.0.0 + 4.11.0 test com.google.testing.compile compile-testing - 0.19 + 0.21.0 test com.google.cloud google-cloud-vision - 2.0.13 test com.google.cloud google-cloud-speech - 2.1.1 test diff --git a/third_party/docfx-doclet-143274/sandbox/docfx.json b/third_party/docfx-doclet-143274/sandbox/docfx.json deleted file mode 100644 index bd1640aa..00000000 --- a/third_party/docfx-doclet-143274/sandbox/docfx.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "build": { - "content": [ - { - "files": [ - "generated-yml-files/**.yml", - "toc.yml" - ] - } - ], - "dest": "_site", - "globalMetadataFiles": [], - "fileMetadataFiles": [], - "template": [ - "default" - ], - "postProcessors": [], - "markdownEngineName": "markdig", - "noLangKeyword": false, - "keepFileLink": false, - "cleanupCacheHistory": false, - "disableGitFeatures": true - } -} \ No newline at end of file diff --git a/third_party/docfx-doclet-143274/sandbox/generate-yml-files.bat b/third_party/docfx-doclet-143274/sandbox/generate-yml-files.bat deleted file mode 100644 index 6e8b216b..00000000 --- a/third_party/docfx-doclet-143274/sandbox/generate-yml-files.bat +++ /dev/null @@ -1,26 +0,0 @@ - -set SOURCES_FOLDER="../target/sandbox/unpacked-sources" -set GENERATED_FOLDER="../target/sandbox/generated-yml-files" - -echo "Remove folders" -rmdir /S /Q %SOURCES_FOLDER% -rmdir /S /Q %GENERATED_FOLDER% - -echo "Create directory to extract sources" -mkdir %SOURCES_FOLDER% - -echo "Extract sources from jar file" -pushd %SOURCES_FOLDER% -jar xf ../../../sandbox/libs/junit-4.12-sources.jar -popd - -echo "Before this action make sure that doclet jar presents in target folder. So build it preliminary when needed" -echo "Generate yml files" -javadoc ^ --encoding UTF-8 ^ --docletpath ../target/docfx-doclet-1.0-SNAPSHOT-jar-with-dependencies.jar ^ --doclet com.microsoft.doclet.DocFxDoclet ^ --cp ./libs/hamcrest-core-1.3.jar ^ --sourcepath %SOURCES_FOLDER% ^ --outputpath %GENERATED_FOLDER% ^ --subpackages org:junit diff --git a/third_party/docfx-doclet-143274/sandbox/libs/hamcrest-core-1.3.jar b/third_party/docfx-doclet-143274/sandbox/libs/hamcrest-core-1.3.jar deleted file mode 100644 index 9d5fe16e..00000000 Binary files a/third_party/docfx-doclet-143274/sandbox/libs/hamcrest-core-1.3.jar and /dev/null differ diff --git a/third_party/docfx-doclet-143274/sandbox/libs/junit-4.12-sources.jar b/third_party/docfx-doclet-143274/sandbox/libs/junit-4.12-sources.jar deleted file mode 100644 index 884f92f5..00000000 Binary files a/third_party/docfx-doclet-143274/sandbox/libs/junit-4.12-sources.jar and /dev/null differ diff --git a/third_party/docfx-doclet-143274/sandbox/serve-docs.bat b/third_party/docfx-doclet-143274/sandbox/serve-docs.bat deleted file mode 100644 index acfdabda..00000000 --- a/third_party/docfx-doclet-143274/sandbox/serve-docs.bat +++ /dev/null @@ -1,15 +0,0 @@ - -set SANDBOX_FOLDER="../target/sandbox" - -echo "Copy files" -copy docfx.json %SANDBOX_FOLDER% -copy toc.yml %SANDBOX_FOLDER% - -echo "Remove folders" -pushd %SANDBOX_FOLDER% -rmdir /S /Q _site -rmdir /S /Q obj - -echo "Serve documentation" -docfx docfx.json --serve -popd diff --git a/third_party/docfx-doclet-143274/sandbox/toc.yml b/third_party/docfx-doclet-143274/sandbox/toc.yml deleted file mode 100644 index b109c22b..00000000 --- a/third_party/docfx-doclet-143274/sandbox/toc.yml +++ /dev/null @@ -1,2 +0,0 @@ -- name: Generated YAML files - href: generated-yml-files/ 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 new file mode 100644 index 00000000..3772c461 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/ApiVersion.java @@ -0,0 +1,134 @@ +package com.google.docfx.doclet; + +import java.util.Collection; +import java.util.Comparator; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.annotation.Nullable; + +public class ApiVersion implements Comparable { + public static ApiVersion NONE = new ApiVersion("", 0, 0, null, 0); + + private static final Pattern VALID_VERSION_REGEX = + Pattern.compile("^v(\\d+)p?(\\d+)?(alpha|beta)?(\\d+)?"); + + /** + * Creates an ApiVersion instance, if the given input matches the correct format. + * + *

Supported Format: + * + *

+   * v1p2beta3
+   *  │└┤└──┤│
+   *  │ │   ││
+   *  │ │   │└─── Optional: Prerelease major version
+   *  │ │   └──── Optional: Stability level. See AIP 181
+   *  │ └──────── Optional: Minor version
+   *  └────────── Required: Major version
+   * 
+ * + * @return Optional.empty() if the given input doesn't match the version pattern + */ + public static Optional parse(@Nullable String input) { + if (input != null) { + Matcher matcher = VALID_VERSION_REGEX.matcher(input); + if (matcher.matches()) { + return Optional.of( + new ApiVersion( + input, + safeParseInt(matcher.group(1)), + safeParseInt(matcher.group(2)), + matcher.group(3), + safeParseInt(matcher.group(4)))); + } + } + return Optional.empty(); + } + + private static int safeParseInt(@Nullable String input) { + if (input == null) { + return 0; + } + 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 String original; + private final int major; + private final int minor; + private final String stability; + private final int prerelease; + + private ApiVersion(String original, int major, int minor, String stability, int prerelease) { + this.original = original; + this.major = major; + this.minor = minor; + this.stability = stability; + this.prerelease = prerelease; + } + + public boolean isStable() { + return stability == null; + } + + @Override + public int compareTo(ApiVersion other) { + if (major != other.major) { + return major - other.major; + } + if (minor != other.minor) { + return minor - other.minor; + } + if (!Objects.equals(stability, other.stability)) { + if (stability == null) { + return 1; // Other is a prerelease version, but this is not. + } + if (other.stability == null) { + return -1; // This is a prerelease version, but the other is not. + } + return stability.compareTo(other.stability); // Based on alphabetical order + } + return prerelease - other.prerelease; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiVersion other = (ApiVersion) o; + return major == other.major + && minor == other.minor + && prerelease == other.prerelease + && Objects.equals(stability, other.stability); + } + + @Override + public int hashCode() { + return Objects.hash(major, minor, stability, prerelease); + } + + @Override + public String toString() { + return original; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/RepoMetadata.java b/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/RepoMetadata.java new file mode 100644 index 00000000..b232498d --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/google/docfx/doclet/RepoMetadata.java @@ -0,0 +1,192 @@ +package com.google.docfx.doclet; + +// This parses .repo-metadata.json files to create a new library overview + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +public class RepoMetadata { + + @SerializedName("api_shortname") + private String apiShortName; + + @SerializedName("name_pretty") + private String namePretty; + + @SerializedName("product_documentation") + private String productDocumentationUri; + + @SerializedName("api_description") + private String apiDescription; + + @SerializedName("client_documentation") + private String clientDocumentationUri; + + @SerializedName("rest_documentation") + private String restDocumentationUri; + + @SerializedName("rpc_documentation") + private String rpcDocumentationUri; + + @SerializedName("repo") + private String repo; + + @SerializedName("repo_short") + private String repoShort; + + @SerializedName("distribution_name") + private String distributionName; + + @SerializedName("api_id") + private String apiId; + + @SerializedName("recommended_package") + private String recommendedPackage; + + @SerializedName("library_path_overrides") + private Map libraryPathOverrides; + + private String artifactId; + + public String getNamePretty() { + return this.namePretty; + } + + public void setNamePretty(String namePretty) { + this.namePretty = namePretty; + } + + public String getApiShortName() { + return this.apiShortName; + } + + public void setApiShortName(String apiShortName) { + this.apiShortName = apiShortName; + } + + public String getProductDocumentationUri() { + return this.productDocumentationUri; + } + + public Optional getRestDocumentationUri() { + return Optional.ofNullable(this.restDocumentationUri); + } + + public Optional getRpcDocumentationUri() { + return Optional.ofNullable(this.rpcDocumentationUri); + } + + public void setProductDocumentationUri(String productDocumentationUri) { + this.productDocumentationUri = productDocumentationUri; + } + + public Optional getRecommendedPackage() { + return Optional.ofNullable(this.recommendedPackage); + } + + public String getApiDescription() { + return this.apiDescription; + } + + public void setApiDescription(String apiDescription) { + this.apiDescription = apiDescription; + } + + public String getClientDocumentationUri() { + return this.clientDocumentationUri; + } + + public void setClientDocumentationUri(String clientDocumentationUri) { + this.clientDocumentationUri = clientDocumentationUri; + } + + public String getRepo() { + return this.repo; + } + + public void setRepo(String repo) { + this.repo = repo; + } + + public String getRepoShort() { + return this.repoShort; + } + + public void setRepoShort(String repoShort) { + this.repoShort = repoShort; + } + + public String getDistributionName() { + return this.distributionName; + } + + public void setDistributionName(String distributionName) { + this.distributionName = distributionName; + } + + public String getApiId() { + return this.apiId; + } + + public void setApiId(String apiId) { + this.apiId = apiId; + } + + public Map getLibraryPathOverrides() { + return this.libraryPathOverrides != null ? this.libraryPathOverrides : Collections.emptyMap(); + } + + public void setLibraryPathOverrides(Map libraryPathOverrides) { + this.libraryPathOverrides = libraryPathOverrides; + } + + // artifactId is parsed from distributionName + public String getArtifactId() { + String substrings[] = this.distributionName.split(":"); + return substrings[substrings.length - 1]; + } + + // GithubLink is created from repo and repoShort + public String getGithubLink() { + String githubRootUri = "https://github.com/"; + String githubLink = githubRootUri + repo; + if (Objects.equals(this.repo, "googleapis/google-cloud-java") + || Objects.equals(this.repo, "googleapis/sdk-platform-java")) { + githubLink = githubLink + "/tree/main/" + this.repoShort; + } + // Handwritten libraries have a different base URI + else { + githubLink = githubLink + "/tree/main/"; + } + return githubLink; + } + + // MavenLink is created from distributionName + public String getMavenLink() { + String mavenRootUri = "https://central.sonatype.com/artifact/"; + String substrings[] = this.distributionName.split(":"); + String groupName = substrings[0]; + String artifactId = substrings[substrings.length - 1]; + String mavenLink = mavenRootUri + groupName + "/" + artifactId; + return mavenLink; + } + + public RepoMetadata parseRepoMetadata(String fileName) { + Gson gson = new Gson(); + Path path = Paths.get(fileName); + try (FileReader reader = new FileReader(path.toFile())) { + return gson.fromJson(reader, RepoMetadata.class); + } catch (IOException e) { + throw new RuntimeException( + ".repo-metadata.json is not found @ " + path.toAbsolutePath().normalize(), e); + } + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/BuilderUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/BuilderUtil.java new file mode 100644 index 00000000..c7471707 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/BuilderUtil.java @@ -0,0 +1,213 @@ +/* + * 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.build; + +import com.microsoft.lookup.BaseLookup; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.SpecViewModel; +import com.microsoft.util.YamlUtil; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.lang.model.element.Element; +import org.apache.commons.lang3.RegExUtils; +import org.apache.commons.lang3.StringUtils; + +final class BuilderUtil { + private static final Pattern XREF_LINK_PATTERN = + Pattern.compile(".*?"); + private static final Pattern XREF_LINK_CONTENT_PATTERN = + Pattern.compile("(?<=.*?)"); + private static final Pattern XREF_LINK_RESOLVE_PATTERN = + Pattern.compile("(?\\w+)\\#(?\\w+)(\\((?.*)\\))?"); + public static final String[] LANGS = {"java"}; + + static String populateUidValues(String text, LookupContext lookupContext) { + if (StringUtils.isBlank(text)) { + return text; + } + + Matcher linkMatcher = XREF_LINK_PATTERN.matcher(text); + while (linkMatcher.find()) { + String link = linkMatcher.group(); + Matcher linkContentMatcher = XREF_LINK_CONTENT_PATTERN.matcher(link); + if (!linkContentMatcher.find()) { + continue; + } + + String linkContent = linkContentMatcher.group(); + String uid = resolveUidFromLinkContent(linkContent, lookupContext); + String updatedLink = linkContentMatcher.replaceAll(uid); + text = StringUtils.replace(text, link, updatedLink); + } + return text; + } + + /** + * The linkContent could be in following format #memeber Class#member Class#method() + * Class#method(params) + */ + static String resolveUidFromLinkContent(String linkContent, LookupContext lookupContext) { + if (StringUtils.isBlank(linkContent)) { + return ""; + } + + linkContent = linkContent.trim(); + + // complete class name for class internal link + if (linkContent.startsWith("#")) { + String firstKey = lookupContext.getOwnerUid(); + linkContent = firstKey + linkContent; + } + + // fuzzy resolve, target for items from project external references + String fuzzyResolvedUid = resolveUidFromReference(linkContent, lookupContext); + + // exact resolve in lookupContext + linkContent = linkContent.replace("#", "."); + String exactResolveUid = resolveUidByLookup(linkContent, lookupContext); + return exactResolveUid.isEmpty() ? fuzzyResolvedUid : exactResolveUid; + } + + static List splitUidWithGenericsIntoClassNames(String uid) { + uid = RegExUtils.removeAll(uid, "[>]+$"); + return Arrays.asList(StringUtils.split(uid, "<")); + } + + static List replaceUidAndSplit(String uid) { + String retValue = RegExUtils.replaceAll(uid, "\\<", "//", "//>//"); + retValue = RegExUtils.replaceAll(retValue, ",", "//,//"); + retValue = RegExUtils.replaceAll(retValue, "\\[\\]", "//[]//"); + + return Arrays.asList(StringUtils.split(retValue, "//")); + } + + static List getJavaSpec(List references) { + List specList = new ArrayList<>(); + + Optional.ofNullable(references) + .ifPresent( + ref -> + references.forEach( + uid -> { + if (uid.equalsIgnoreCase("<") + || uid.equalsIgnoreCase(">") + || uid.equalsIgnoreCase(",") + || uid.equalsIgnoreCase("[]")) specList.add(new SpecViewModel(null, uid)); + else if (uid != "") specList.add(new SpecViewModel(uid, uid)); + })); + + return specList; + } + + static void populateUidValues( + List packageMetadataFiles, List classMetadataFiles) { + Lookup lookup = new Lookup(packageMetadataFiles, classMetadataFiles); + + classMetadataFiles.forEach( + classMetadataFile -> { + LookupContext lookupContext = lookup.buildContext(classMetadataFile); + + for (MetadataFileItem item : classMetadataFile.getItems()) { + item.setSummary( + YamlUtil.cleanupHtml(populateUidValues(item.getSummary(), lookupContext))); + + Optional.ofNullable(item.getSyntax()) + .ifPresent( + syntax -> { + Optional.ofNullable(syntax.getParameters()) + .ifPresent( + methodParams -> + methodParams.forEach( + param -> { + param.setDescription( + populateUidValues( + param.getDescription(), lookupContext)); + })); + Optional.ofNullable(syntax.getReturnValue()) + .ifPresent( + returnValue -> + returnValue.setReturnDescription( + populateUidValues( + syntax.getReturnValue().getReturnDescription(), + lookupContext))); + }); + } + }); + } + + /** + * this method is used to do fuzzy resolve "*" will be added at the end of uid for method for xerf + * service resolve purpose + */ + static String resolveUidFromReference(String linkContent, LookupContext lookupContext) { + String uid = ""; + Matcher matcher = XREF_LINK_RESOLVE_PATTERN.matcher(linkContent); + + if (matcher.find()) { + String className = matcher.group("class"); + String memberName = matcher.group("member"); + uid = resolveUidByLookup(className, lookupContext); + if (!uid.isEmpty()) { + uid = uid.concat(".").concat(memberName); + + // linkContent targets a method + if (!StringUtils.isBlank(matcher.group(3))) { + uid = uid.concat("*"); + } + } + } + return uid; + } + + static String resolveUidByLookup(String signature, LookupContext lookupContext) { + if (StringUtils.isBlank(signature) || lookupContext == null) { + return ""; + } + return lookupContext.containsKey(signature) ? lookupContext.resolve(signature) : ""; + } + + static void populateItemFields( + MetadataFileItem item, BaseLookup lookup, T element) { + String name = lookup.extractName(element); + item.setName(name); + item.setNameWithType(lookup.extractNameWithType(element)); + item.setFullName(lookup.extractFullName(element)); + item.setType(lookup.extractType(element)); + item.setJavaType(lookup.extractJavaType(element)); + item.setSummary(lookup.extractSummary(element)); + item.setStatus(lookup.extractStatus(element)); + item.setContent(lookup.extractContent(element)); + } + + /** Does not include syntax contents for Client classes as they are not useful */ + static void populateItemFieldsForClients( + MetadataFileItem item, BaseLookup lookup, T element) { + String name = lookup.extractName(element); + item.setName(name); + item.setNameWithType(lookup.extractNameWithType(element)); + item.setFullName(lookup.extractFullName(element)); + item.setType(lookup.extractType(element)); + item.setJavaType(lookup.extractJavaType(element)); + item.setSummary(lookup.extractSummary(element)); + item.setStatus(lookup.extractStatus(element)); + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ClassBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ClassBuilder.java new file mode 100644 index 00000000..08123e4a --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ClassBuilder.java @@ -0,0 +1,401 @@ +/* + * 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.build; + +import static com.microsoft.build.BuilderUtil.LANGS; +import static com.microsoft.build.BuilderUtil.populateItemFields; +import static com.microsoft.build.BuilderUtil.populateItemFieldsForClients; + +import com.google.docfx.doclet.RepoMetadata; +import com.microsoft.lookup.ClassItemsLookup; +import com.microsoft.lookup.ClassLookup; +import com.microsoft.lookup.PackageLookup; +import com.microsoft.model.ApiVersionPackageToc; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.StubPackageToc; +import com.microsoft.model.TocItem; +import com.microsoft.model.TocTypeMap; +import com.microsoft.util.ElementUtil; +import com.microsoft.util.Utils; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.ElementFilter; + +class ClassBuilder { + + private final ElementUtil elementUtil; + private final ClassLookup classLookup; + private final ClassItemsLookup classItemsLookup; + private final String outputPath; + private final PackageLookup packageLookup; + private final ReferenceBuilder referenceBuilder; + + ClassBuilder( + ElementUtil elementUtil, + ClassLookup classLookup, + ClassItemsLookup classItemsLookup, + String outputPath, + PackageLookup packageLookup, + ReferenceBuilder referenceBuilder) { + this.elementUtil = elementUtil; + this.classLookup = classLookup; + this.classItemsLookup = classItemsLookup; + this.outputPath = outputPath; + this.packageLookup = packageLookup; + this.referenceBuilder = referenceBuilder; + } + + List buildFilesForPackage( + PackageElement pkg, List classMetadataFiles, RepoMetadata repoMetadata) { + if (packageLookup.isApiVersionPackage(pkg) && containsAtLeastOneClient(pkg)) { + // API Version package organization is a nested list organized by GAPIC concepts + ApiVersionPackageToc apiVersionPackageToc = new ApiVersionPackageToc(); + buildFilesForApiVersionPackage(pkg, apiVersionPackageToc, classMetadataFiles, repoMetadata); + return apiVersionPackageToc.toList(); + + } else if (packageLookup.isApiVersionStubPackage(pkg)) { + StubPackageToc stubPackageToc = new StubPackageToc(); + buildFilesForStubPackage(pkg, stubPackageToc, classMetadataFiles); + return stubPackageToc.toList(); + + } else { + // Standard package organization is a flat list organized by Java type + TocTypeMap typeMap = new TocTypeMap(); + buildFilesForStandardPackage(pkg, typeMap, classMetadataFiles); + return typeMap.toList(); + } + } + + private void buildFilesForApiVersionPackage( + Element element, + ApiVersionPackageToc apiVersionPackageToc, + List classMetadataFiles, + RepoMetadata repoMetadata) { + for (TypeElement classElement : elementUtil.extractSortedElements(element)) { + String uid = classLookup.extractUid(classElement); + String name = classLookup.extractTocName(classElement); + String status = classLookup.extractStatus(classElement); + TocItem tocItem = new TocItem(uid, name, status); + + // The order of these checks matter! + // Ex: a paging response class would change its category if "isPagingClass" is checked first. + if (classElement.getKind() == ElementKind.INTERFACE) { + apiVersionPackageToc.addInterface(tocItem); + } else if (isClient(classElement)) { + apiVersionPackageToc.addClient(tocItem); + } else if (name.endsWith("Response") || name.endsWith("Request")) { + apiVersionPackageToc.addRequestOrResponse(tocItem); + } else if (name.endsWith("Settings")) { + apiVersionPackageToc.addSettings(tocItem); + } else if (name.endsWith("Builder")) { + apiVersionPackageToc.addBuilder(tocItem); + } else if (classElement.getKind() == ElementKind.ENUM) { + apiVersionPackageToc.addEnum(tocItem); + } else if (name.endsWith("Exception")) { + apiVersionPackageToc.addException(tocItem); + } else if (isGeneratedMessage(classElement)) { + apiVersionPackageToc.addMessage(tocItem); + } else if (isPagingClass(classElement)) { + apiVersionPackageToc.addPaging(tocItem); + } else if (isResourceName(classElement)) { + apiVersionPackageToc.addResourceName(tocItem); + } else { + apiVersionPackageToc.addUncategorized(tocItem); + } + + // Client classes have custom overview + if (isClient(classElement)) { + classMetadataFiles.add(buildClientClassYmlFile(classElement, repoMetadata)); + } else { + classMetadataFiles.add(buildClassYmlFile(classElement)); + } + buildFilesForApiVersionPackage( + classElement, apiVersionPackageToc, classMetadataFiles, repoMetadata); + } + } + + private void buildFilesForStubPackage( + Element element, StubPackageToc packageToc, List classMetadataFiles) { + for (TypeElement classElement : elementUtil.extractSortedElements(element)) { + String uid = classLookup.extractUid(classElement); + String name = classLookup.extractTocName(classElement); + String status = classLookup.extractStatus(classElement); + TocItem tocItem = new TocItem(uid, name, status); + + if (name.endsWith("Stub")) { + packageToc.addStub(tocItem); + } else if (name.contains("Settings")) { + packageToc.addSettings(tocItem); + } else if (name.endsWith("CallableFactory")) { + packageToc.addCallableFactory(tocItem); + } else { + packageToc.addUncategorized(tocItem); + } + + classMetadataFiles.add(buildClassYmlFile(classElement)); + buildFilesForStubPackage(classElement, packageToc, classMetadataFiles); + } + } + + boolean containsAtLeastOneClient(PackageElement pkg) { + return elementUtil.extractSortedElements(pkg).stream().anyMatch(this::isClient); + } + + boolean isClient(TypeElement classElement) { + return classLookup.extractTocName(classElement).endsWith("Client"); + } + + boolean isResourceName(TypeElement classElement) { + return classElement.getInterfaces().stream() + .anyMatch(i -> String.valueOf(i).contains("ResourceName")); + } + + boolean isGeneratedMessage(TypeElement classElement) { + return String.valueOf(classElement.getSuperclass()).contains("GeneratedMessage"); + } + + boolean isPagingClass(TypeElement classElement) { + return String.valueOf(classElement.getSuperclass()).contains(".paging."); + } + + void buildFilesForStandardPackage( + Element element, TocTypeMap tocTypeMap, List classMetadataFiles) { + for (TypeElement classElement : elementUtil.extractSortedElements(element)) { + String uid = classLookup.extractUid(classElement); + String name = classLookup.extractTocName(classElement); + String status = classLookup.extractStatus(classElement); + + if (tocTypeMap.get(classElement.getKind().name()) != null) { + if (classElement.getKind().name().equals(ElementKind.CLASS.name()) + && name.contains("Exception")) { + tocTypeMap.get("EXCEPTION").add(new TocItem(uid, name, status)); + } else { + tocTypeMap.get(classElement.getKind().name()).add(new TocItem(uid, name, status)); + } + } else { + tocTypeMap.get(ElementKind.CLASS.name()).add(new TocItem(uid, name, status)); + } + + classMetadataFiles.add(buildClassYmlFile(classElement)); + buildFilesForStandardPackage(classElement, tocTypeMap, classMetadataFiles); + } + } + + private MetadataFile buildClientClassYmlFile( + TypeElement classElement, RepoMetadata repoMetadata) { + String fileName = classLookup.extractHref(classElement); + MetadataFile classMetadataFile = new MetadataFile(outputPath, fileName); + addClientClassInfo(classElement, classMetadataFile, repoMetadata); + addConstructorsInfo(classElement, classMetadataFile); + addMethodsInfo(classElement, classMetadataFile); + addFieldsInfo(classElement, classMetadataFile); + referenceBuilder.addReferencesInfo(classElement, classMetadataFile); + applyPostProcessing(classMetadataFile); + return classMetadataFile; + } + + private MetadataFile buildClassYmlFile(TypeElement classElement) { + String fileName = classLookup.extractHref(classElement); + MetadataFile classMetadataFile = new MetadataFile(outputPath, fileName); + addClassInfo(classElement, classMetadataFile); + addConstructorsInfo(classElement, classMetadataFile); + addMethodsInfo(classElement, classMetadataFile); + addFieldsInfo(classElement, classMetadataFile); + referenceBuilder.addReferencesInfo(classElement, classMetadataFile); + applyPostProcessing(classMetadataFile); + return classMetadataFile; + } + + // Does not set Inherited Methods or Inheritance as that information for Client classes is + // superfluous + // Sets updated Client summary with table of links + private void addClientClassInfo( + TypeElement classElement, MetadataFile classMetadataFile, RepoMetadata repoMetadata) { + MetadataFileItem classItem = new MetadataFileItem(LANGS, classLookup.extractUid(classElement)); + classItem.setId(classLookup.extractId(classElement)); + classItem.setParent(classLookup.extractParent(classElement)); + addChildren(classElement, classItem.getChildren()); + populateItemFieldsForClients(classItem, classLookup, classElement); + classItem.setPackageName(classLookup.extractPackageName(classElement)); + classItem.setTypeParameters(classLookup.extractTypeParameters(classElement)); + classItem.setInheritance(classLookup.extractSuperclass(classElement)); + String summary = classLookup.extractSummary(classElement); + String summaryTable = createClientOverviewTable(classElement, repoMetadata); + classItem.setSummary(summaryTable + summary); + classItem.setStatus(classLookup.extractStatus(classElement)); + classMetadataFile.getItems().add(classItem); + } + + private String createClientOverviewTable(TypeElement classElement, RepoMetadata repoMetadata) { + String clientURI = classLookup.extractUid(classElement).replaceAll("\\.", "/"); + String className = classElement.getSimpleName().toString(); + + // Check overrides map first, otherwise default to artifactId + String directory = + repoMetadata + .getLibraryPathOverrides() + .getOrDefault(className, repoMetadata.getArtifactId()); + + String githubSourceLink = + repoMetadata.getGithubLink() + "/" + directory + "/src/main/java/" + clientURI + ".java"; + StringBuilder tableBuilder = new StringBuilder(); + tableBuilder + .append("") + .append("") + .append("") + .append(""); + repoMetadata + .getRestDocumentationUri() + .ifPresent( + restDocumentationURI -> + tableBuilder + .append("")); + repoMetadata + .getRpcDocumentationUri() + .ifPresent( + rpcDocumentationURI -> + tableBuilder + .append("")); + tableBuilder.append("
GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation
\n\n"); + return tableBuilder.toString(); + } + + private void addClassInfo(TypeElement classElement, MetadataFile classMetadataFile) { + MetadataFileItem classItem = new MetadataFileItem(LANGS, classLookup.extractUid(classElement)); + classItem.setId(classLookup.extractId(classElement)); + classItem.setParent(classLookup.extractParent(classElement)); + addChildren(classElement, classItem.getChildren()); + populateItemFields(classItem, classLookup, classElement); + classItem.setPackageName(classLookup.extractPackageName(classElement)); + classItem.setTypeParameters(classLookup.extractTypeParameters(classElement)); + classItem.setInheritance(classLookup.extractSuperclass(classElement)); + classItem.setInterfaces(classLookup.extractInterfaces(classElement)); + classItem.setInheritedMethods(classLookup.extractInheritedMethods(classElement)); + classItem.setSummary(classLookup.extractSummary(classElement)); + classItem.setStatus(classLookup.extractStatus(classElement)); + classMetadataFile.getItems().add(classItem); + } + + void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFile) { + for (ExecutableElement constructorElement : + ElementFilter.constructorsIn(elementUtil.getEnclosedElements(classElement))) { + MetadataFileItem constructorItem = buildMetadataFileItem(constructorElement); + constructorItem.setOverload(classItemsLookup.extractOverload(constructorElement)); + constructorItem.setContent(classItemsLookup.extractConstructorContent(constructorElement)); + constructorItem.setParameters(classItemsLookup.extractParameters(constructorElement)); + classMetadataFile.getItems().add(constructorItem); + + referenceBuilder.addParameterReferences(constructorItem, classMetadataFile); + referenceBuilder.addOverloadReferences(constructorItem, classMetadataFile); + } + } + + private void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { + ElementFilter.methodsIn(elementUtil.getEnclosedElements(classElement)).stream() + .filter(methodElement -> !Utils.isPrivateOrPackagePrivate(methodElement)) + .forEach( + methodElement -> { + MetadataFileItem methodItem = buildMetadataFileItem(methodElement); + methodItem.setOverload(classItemsLookup.extractOverload(methodElement)); + methodItem.setContent(classItemsLookup.extractMethodContent(methodElement)); + methodItem.setExceptions(classItemsLookup.extractExceptions(methodElement)); + methodItem.setParameters(classItemsLookup.extractParameters(methodElement)); + methodItem.setReturn(classItemsLookup.extractReturn(methodElement)); + methodItem.setOverridden(classItemsLookup.extractOverridden(methodElement)); + + classMetadataFile.getItems().add(methodItem); + referenceBuilder.addExceptionReferences(methodItem, classMetadataFile); + referenceBuilder.addParameterReferences(methodItem, classMetadataFile); + referenceBuilder.addReturnReferences(methodItem, classMetadataFile); + referenceBuilder.addOverloadReferences(methodItem, classMetadataFile); + }); + } + + private void addFieldsInfo(TypeElement classElement, MetadataFile classMetadataFile) { + ElementFilter.fieldsIn(elementUtil.getEnclosedElements(classElement)).stream() + .filter(fieldElement -> !Utils.isPrivateOrPackagePrivate(fieldElement)) + .forEach( + fieldElement -> { + MetadataFileItem fieldItem = buildMetadataFileItem(fieldElement); + fieldItem.setContent(classItemsLookup.extractFieldContent(fieldElement)); + fieldItem.setReturn(classItemsLookup.extractReturn(fieldElement)); + classMetadataFile.getItems().add(fieldItem); + referenceBuilder.addReturnReferences(fieldItem, classMetadataFile); + }); + } + + private void applyPostProcessing(MetadataFile classMetadataFile) { + referenceBuilder.expandComplexGenericsInReferences(classMetadataFile); + } + + private MetadataFileItem buildMetadataFileItem(Element element) { + return new MetadataFileItem(LANGS, classItemsLookup.extractUid(element)) { + { + String name = classItemsLookup.extractName(element); + setId(classItemsLookup.extractId(element)); + setParent(classItemsLookup.extractParent(element)); + setName(name); + setNameWithType(classItemsLookup.extractNameWithType(element)); + setFullName(classItemsLookup.extractFullName(element)); + setType(classItemsLookup.extractType(element)); + setJavaType(classItemsLookup.extractJavaType(element)); + setPackageName(classItemsLookup.extractPackageName(element)); + setSummary(classItemsLookup.extractSummary(element)); + setStatus(classItemsLookup.extractStatus(element)); + } + }; + } + + private void addChildren(TypeElement classElement, List children) { + collect(classElement, children, ElementFilter::constructorsIn, classItemsLookup::extractUid); + collect(classElement, children, ElementFilter::methodsIn, classItemsLookup::extractUid); + collect(classElement, children, ElementFilter::fieldsIn, classItemsLookup::extractUid); + collect(classElement, children, ElementFilter::typesIn, String::valueOf); + } + + private void collect( + TypeElement classElement, + List children, + Function, List> selectFunc, + Function mapFunc) { + + List elements = + selectFunc.apply(elementUtil.getEnclosedElements(classElement)); + children.addAll( + filterPrivateElements(elements).stream().map(mapFunc).collect(Collectors.toList())); + } + + private List filterPrivateElements(List elements) { + return elements.stream() + .filter(element -> !Utils.isPrivateOrPackagePrivate(element)) + .collect(Collectors.toList()); + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/Lookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/Lookup.java index 77781040..bec31504 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/Lookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/Lookup.java @@ -1,99 +1,128 @@ package com.microsoft.build; -import com.microsoft.model.MetadataFile; +import static org.apache.commons.lang3.RegExUtils.removeAll; +import static org.apache.commons.lang3.RegExUtils.replaceAll; +import com.microsoft.model.MetadataFile; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import static org.apache.commons.lang3.RegExUtils.removeAll; -import static org.apache.commons.lang3.RegExUtils.replaceAll; - public class Lookup { - private Map globalLookup = new HashMap<>(); - private Map> localLookupByFileName = new HashMap<>(); + private static final int INITIAL_CAPACITY = 10000; + private final Map globalLookup; + private final Map> localLookupByFileName; - private final String UID_PACKAGE_NAME_REGEXP = "^.*?\\.(?=[A-Z].*)"; - private final String PARAM_PACKAGE_NAME_REGEXP = "(?<=[\\( ]).*?(?=[A-Z].*)"; - private final String METHOD_PARAMS_REGEXP = "\\s[^\\s]+?(?=[,)])"; + private final String UID_PACKAGE_NAME_REGEXP = "^.*?\\.(?=[A-Z].*)"; + private final String PARAM_PACKAGE_NAME_REGEXP = "(?<=[\\( ]).*?(?=[A-Z].*)"; + private final String METHOD_PARAMS_REGEXP = "\\s[^\\s]+?(?=[,)])"; - public Lookup(List packageMetadataFiles, List classMetadataFiles) { - consume(packageMetadataFiles); - consume(classMetadataFiles); - } + public Lookup(List packageMetadataFiles, List classMetadataFiles) { + this.globalLookup = new HashMap<>(INITIAL_CAPACITY); + this.localLookupByFileName = new HashMap<>(INITIAL_CAPACITY); + consume(packageMetadataFiles); + consume(classMetadataFiles); + } - public LookupContext buildContext(MetadataFile metadataFile) { - Map localLookup = localLookupByFileName.get(metadataFile.getFileNameWithPath()); - return new LookupContext(globalLookup, localLookup); - } + public LookupContext buildContext(MetadataFile metadataFile) { + Map localLookup = localLookupByFileName.get(metadataFile.getFileNameWithPath()); + return new LookupContext(globalLookup, localLookup); + } - /** - * For each such item from items and references of metadata file: - *
-     * - uid: "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean)"
-     *   nameWithType: "Person.setFirstName(String firstName, boolean flag)"
-     *   ...
-     * 
- * add several key-value pairs to lookup where keys are: - *
    - *
  • Name with type without generics:
    Person.setFirstName(String firstName, boolean flag)
  • - *
  • Uid as is:
    com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean)
  • - *
  • Uid with param types without package:
    com.microsoft.samples.subpackage.Person.setFirstName(String, - * boolean)
  • - *
  • Uid without package:
    Person.setFirstName(java.lang.String, boolean)
  • - *
  • Name with type without generics and param names:
    Person.setFirstName(String, boolean)
  • - *
  • Name with type as is:
    Person.setFirstName(String, boolean)
  • - *
- * and value equals to uid:
com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String) - */ - private void consume(List metadataFiles) { - metadataFiles.forEach(file -> { - /** - * It's important to use LinkedHashMap here, to put item related with owner class on first place. - * Logic of {@link YmlFilesBuilder#resolveUidByLookup} based on this for case when @link starts from '#' - */ - Map map = new LinkedHashMap<>(); - Map specForJavaMap = new LinkedHashMap<>(); + /** + * For each such item from items and references of metadata file: + * + *
+   * - uid: "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean)"
+   *   nameWithType: "Person.setFirstName(String firstName, boolean flag)"
+   *   ...
+   * 
+ * + * add several key-value pairs to lookup where keys are: + * + *
    + *
  • Name with type without generics:
    + * Person.setFirstName(String firstName, boolean flag) + *
  • Uid as is:
    + * com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean) + *
  • Uid with param types without package:
    + * com.microsoft.samples.subpackage.Person.setFirstName(String, boolean) + *
  • Uid without package:
    + * Person.setFirstName(java.lang.String, boolean) + *
  • Name with type without generics and param names:
    + * Person.setFirstName(String, boolean) + *
  • Name with type as is:
    + * Person.setFirstName(String, boolean) + *
+ * + * and value equals to uid:
+ * com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String) + */ + private void consume(List metadataFiles) { + metadataFiles.forEach( + file -> { + /** + * It's important to use LinkedHashMap here, to put item related with owner class on first + * place. Logic of {@link YmlFilesBuilder#resolveUidByLookup} based on this for case + * when @link starts from '#' + */ + Map map = new LinkedHashMap<>(); + Map specForJavaMap = new LinkedHashMap<>(); - file.getItems().forEach(item -> { - String uid = item.getUid(); - String nameWithType = item.getNameWithType(); - String nameWithTypeWithoutGenerics = removeAll(nameWithType, "<.*?>"); + file.getItems() + .forEach( + item -> { + String uid = item.getUid(); + String href = item.getHref(); + String nameWithType = item.getNameWithType(); + String nameWithTypeWithoutGenerics = removeAll(nameWithType, "<.*?>"); - map.put(nameWithTypeWithoutGenerics, uid); // This item should go first - map.put(uid, uid); - map.put(removeAll(uid, PARAM_PACKAGE_NAME_REGEXP), uid); - map.put(removeAll(uid, UID_PACKAGE_NAME_REGEXP), uid); - map.put(removeAll(nameWithTypeWithoutGenerics, METHOD_PARAMS_REGEXP), uid); - map.put(removeAll(nameWithType, METHOD_PARAMS_REGEXP), uid); + map.put(nameWithTypeWithoutGenerics, uid); // This item should go first + map.put(uid, uid); + map.put(href, href); + map.put(removeAll(uid, PARAM_PACKAGE_NAME_REGEXP), uid); + map.put(removeAll(uid, UID_PACKAGE_NAME_REGEXP), uid); + map.put(removeAll(nameWithTypeWithoutGenerics, METHOD_PARAMS_REGEXP), uid); + map.put(removeAll(nameWithType, METHOD_PARAMS_REGEXP), uid); - map.put(replaceAll(uid, ",", ", "), uid); - map.put(replaceAll(removeAll(uid, PARAM_PACKAGE_NAME_REGEXP), ",", ", "), uid); - map.put(replaceAll(removeAll(uid, UID_PACKAGE_NAME_REGEXP), ",", ", "), uid); - map.put(replaceAll(removeAll(nameWithTypeWithoutGenerics, METHOD_PARAMS_REGEXP), ", ", ","), uid); - }); + map.put(replaceAll(uid, ",", ", "), uid); + map.put(replaceAll(removeAll(uid, PARAM_PACKAGE_NAME_REGEXP), ",", ", "), uid); + map.put(replaceAll(removeAll(uid, UID_PACKAGE_NAME_REGEXP), ",", ", "), uid); + map.put( + replaceAll( + removeAll(nameWithTypeWithoutGenerics, METHOD_PARAMS_REGEXP), + ", ", + ","), + uid); + }); - file.getReferences().forEach(item -> { - map.put(item.getUid(), item.getUid()); + file.getReferences() + .forEach( + item -> { + map.put(item.getUid(), item.getUid()); - // complex types are recorded in "specForJava" as arrayList of items, thus it has no "NameWithType" - // thus we need to get every reference item from specForJava, and add to localLookup - if (item.getNameWithType() == null || item.getNameWithType().isEmpty()) { - item.getSpecForJava().forEach(spec -> { - specForJavaMap.put(spec.getName(), spec.getUid()); - specForJavaMap.put(spec.getFullName(), spec.getUid()); - }); - } else { - map.put(item.getNameWithType(), item.getUid()); - } - }); + // complex types are recorded in "specForJava" as arrayList of items, thus it + // has no "NameWithType" + // thus we need to get every reference item from specForJava, and add to + // localLookup + if (item.getNameWithType() == null || item.getNameWithType().isEmpty()) { + item.getSpecForJava() + .forEach( + spec -> { + specForJavaMap.put(spec.getName(), spec.getUid()); + specForJavaMap.put(spec.getFullName(), spec.getUid()); + }); + } else { + map.put(item.getNameWithType(), item.getUid()); + } + }); - // to avoid conflict, the items from specForJava should only add to localLookup - globalLookup.putAll(map); - map.putAll(specForJavaMap); - localLookupByFileName.put(file.getFileNameWithPath(), map); + // to avoid conflict, the items from specForJava should only add to localLookup + globalLookup.putAll(map); + map.putAll(specForJavaMap); + localLookupByFileName.put(file.getFileNameWithPath(), map); }); - } + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/LookupContext.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/LookupContext.java index eee61c22..1ddc8f74 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/LookupContext.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/LookupContext.java @@ -4,26 +4,26 @@ public class LookupContext { - private final Map globalLookup; - private final Map localLookup; + private final Map globalLookup; + private final Map localLookup; - public LookupContext(Map globalLookup, Map localLookup) { - this.globalLookup = globalLookup; - this.localLookup = localLookup; - } + public LookupContext(Map globalLookup, Map localLookup) { + this.globalLookup = globalLookup; + this.localLookup = localLookup; + } - public String resolve(String key) { - if (localLookup.containsKey(key)) { - return localLookup.get(key); - } - return globalLookup.get(key); + public String resolve(String key) { + if (localLookup.containsKey(key)) { + return localLookup.get(key); } + return globalLookup.get(key); + } - public String getOwnerUid() { - return localLookup.keySet().iterator().next(); - } + public String getOwnerUid() { + return localLookup.keySet().iterator().next(); + } - public boolean containsKey(String key) { - return localLookup.containsKey(key) || globalLookup.containsKey(key); - } + public boolean containsKey(String key) { + return localLookup.containsKey(key) || globalLookup.containsKey(key); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageBuilder.java new file mode 100644 index 00000000..d5f89216 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageBuilder.java @@ -0,0 +1,54 @@ +/* + * 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.build; + +import com.google.docfx.doclet.RepoMetadata; +import com.microsoft.lookup.PackageLookup; +import javax.lang.model.element.PackageElement; + +class PackageBuilder { + private final PackageLookup packageLookup; + private final String outputPath; + private final ReferenceBuilder referenceBuilder; + + PackageBuilder( + PackageLookup packageLookup, String outputPath, ReferenceBuilder referenceBuilder) { + this.packageLookup = packageLookup; + this.outputPath = outputPath; + this.referenceBuilder = referenceBuilder; + } + + PackageOverviewFile buildPackageOverviewFile( + PackageElement packageElement, + RepoMetadata repoMetadata, + String artifactVersion, + String recommendedPackage) { + String status = packageLookup.extractStatus(packageElement); + String fileName = packageElement.getQualifiedName() + ".md"; + PackageOverviewFile packageOverviewFile = + new PackageOverviewFile( + outputPath, + fileName, + repoMetadata, + packageElement, + status, + packageLookup, + referenceBuilder, + artifactVersion, + recommendedPackage); + return packageOverviewFile; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java new file mode 100644 index 00000000..a5c95058 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/PackageOverviewFile.java @@ -0,0 +1,435 @@ +package com.microsoft.build; + +import static com.microsoft.build.BuilderUtil.LANGS; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import com.google.docfx.doclet.RepoMetadata; +import com.microsoft.lookup.PackageLookup; +import com.microsoft.model.MetadataFileItem; +import java.io.File; +import java.util.Comparator; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import javax.lang.model.element.PackageElement; + +public class PackageOverviewFile { + private String CLIENT_TABLE_HEADER = ""; + private String SETTINGS_TABLE_HEADER = ""; + private String CLASSES_TABLE_HEADER = ""; + private String INTERFACES_TABLE_HEADER = ""; + + private String STUB_TABLE_HEADER = ""; + private String CALLABLE_FACTORY_TABLE_HEADER = ""; + + private String ENUM_TABLE_HEADER = ""; + private String EXCEPTION_TABLE_HEADER = ""; + + private String CLIENT_TABLE_BLURB = ""; + + private String SETTINGS_TABLE_BLURB = ""; + private String CLASSES_TABLE_BLURB = ""; + private String INTERFACES_TABLE_BLURB = ""; + + private String STUB_TABLE_BLURB = ""; + private String CALLABLE_FACTORY_TABLE_BLURB = ""; + + private String ENUM_TABLE_BLURB = ""; + private String EXCEPTION_TABLE_BLURB = ""; + private String CLIENT_TABLE = ""; + + private String SETTINGS_TABLE = ""; + + private String CLASSES_TABLE = ""; + + private String STUB_TABLE = ""; + private String CALLABLE_FACTORY_TABLE = ""; + + private String INTERFACES_TABLE = ""; + + private String ENUM_TABLE = ""; + + private String EXCEPTION_TABLE = ""; + + // This is only set if the package is not a GA package + private String PRERELEASE_IMPLICATIONS = ""; + + // Uses the `recommended_package` field set in the RepoMetadata file if set; otherwise computes + // it. + private String recommendedPackage; + + private String recommendedPackageLink; + + // This is only set if the package is not the recommended package + private String RECOMMENDED_VERSION = ""; + + // This is only set if the package is a stub package + private String STUB_IMPLICATIONS = ""; + + private String GITHUB_SOURCE_TABLE; + + private String PACKAGE_HEADER; + + private final String outputPath; + private String fileName; + + private final PackageElement packageElement; + + public PackageOverviewFile( + String outputPath, + String fileName, + RepoMetadata repoMetadata, + PackageElement packageElement, + String status, + PackageLookup packageLookup, + ReferenceBuilder referenceBuilder, + String artifactVersion, + String recommendedPackage) { + this.outputPath = outputPath; + this.fileName = fileName; + this.packageElement = packageElement; + this.recommendedPackage = recommendedPackage; + + String packageURIPath = fileName.replace(".md", ""); + + this.PACKAGE_HEADER = "# Package " + packageURIPath + " (" + artifactVersion + ")\n"; + + String cloudRADChildElementLinkPrefix = + "https://cloud.google.com/java/docs/reference/" + repoMetadata.getArtifactId() + "/latest/"; + + String packageURIPathGithub = packageURIPath.replace('.', '/'); + String githubSourcePackageLink = + repoMetadata.getGithubLink() + + "/" + + repoMetadata.getArtifactId() + + "/src/main/java/" + + packageURIPathGithub; + + this.recommendedPackageLink = cloudRADChildElementLinkPrefix + this.recommendedPackage; + // If the package status is not a GA version, then add a disclaimer around prerelease + // implications + if (status != null) { + this.PRERELEASE_IMPLICATIONS = + "## Prerelease Implications\n\n" + + "This package is a prerelease version! Use with caution.\n\n" + + "Prerelease versions are considered unstable as they may be shut down and/or subject to breaking changes when upgrading.\n" + + "Use them only for testing or if you specifically need their experimental features.\n\n"; + } + + // If a package is not the same as the recommended package, add a disclaimer. If the recommended + // package does not exist, then do not set the disclaimer. + if (!this.recommendedPackage.isEmpty() + && !packageElement.getQualifiedName().toString().equals(this.recommendedPackage)) { + this.RECOMMENDED_VERSION = + "## This package is not the recommended entry point to using this client library!\n\n" + + " For this library, we recommend using [" + + recommendedPackage + + "](" + + recommendedPackageLink + + ")" + + " for new applications.\n" + + "\n"; + } + + // Link to recommended package (if it exists) for the Stub class as well + if (!this.recommendedPackage.isEmpty() + && String.valueOf(this.packageElement.getQualifiedName()).contains("stub")) { + this.STUB_IMPLICATIONS = + "## Stub Package Implications\n\n" + + "This package is a a base stub class. It is for advanced usage and reflects the underlying API directly.\n" + + "We generally recommend using the non-stub, latest GA package, such as [" + + recommendedPackage + + "](" + + recommendedPackageLink + + ")" + + ". Use with caution.\n"; + } else if (String.valueOf(this.packageElement.getQualifiedName()).contains("stub")) { + this.STUB_IMPLICATIONS = + "## Stub Package Implications\n\n" + + "This package is a a base stub class. It is for advanced usage and reflects the underlying API directly.\n" + + "We generally recommend using non-stub classes. Use with caution.\n"; + } + + StringBuilder githubSourceTableBuilder = new StringBuilder(); + + // Start of the reference link table + githubSourceTableBuilder + .append("\n") + .append(" \n") + .append(" \n"); + + // If RPC documentation URI exists, add to the package overview table + if (repoMetadata.getRpcDocumentationUri().isPresent()) { + githubSourceTableBuilder + .append(" \n"); + } + // If REST documentation URI exists, add to the package overview table + if (repoMetadata.getRestDocumentationUri().isPresent()) { + githubSourceTableBuilder + .append(" \n"); + } + githubSourceTableBuilder.append(" \n").append("
GitHub RepositoryRPC DocumentationREST Documentation
").append("\n\n"); + + this.GITHUB_SOURCE_TABLE = githubSourceTableBuilder.toString(); + + // Prepare to build tables of different types of package children elements + MetadataFileItem packageItem = + new MetadataFileItem(LANGS, packageLookup.extractUid(packageElement)); + referenceBuilder.addPackageChildrenSummaries( + packageElement, packageItem.getPackageChildrenSummaries()); + List listOfPackageChildrenSummaries = + packageItem.getPackageChildrenSummaries(); + listOfPackageChildrenSummaries.sort( + Comparator.comparing(PackageChildSummary::getType) + .thenComparing(PackageChildSummary::getUid)); + + // If Clients exist in this package, create a table of them + boolean containsClientSettingsClasses = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Client".equals(packageChildSummary.getType())); + if (containsClientSettingsClasses) { + this.CLIENT_TABLE_HEADER = "## Client Classes\n"; + this.CLIENT_TABLE_BLURB = + "Client classes are the main entry point to using a package.\nThey contain several variations of Java methods for each of the API's methods.\n"; + this.CLIENT_TABLE = + createHtmlTable("Client", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If Settings exist in this package, create a table of them + boolean containsSettingsClasses = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Settings".equals(packageChildSummary.getType())); + if (containsSettingsClasses) { + this.SETTINGS_TABLE_HEADER = "## Settings Classes\n"; + if (packageLookup.isApiVersionStubPackage(this.packageElement)) { + this.SETTINGS_TABLE_BLURB = + "Settings classes can be used to configure credentials, endpoints, and retry settings for a Stub.\n"; + } else { + this.SETTINGS_TABLE_BLURB = + "Settings classes can be used to configure credentials, endpoints, and retry settings for a Client.\n"; + } + + this.SETTINGS_TABLE = + createHtmlTable( + "Settings", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If package is a Stub package, create a table of Stub classes + boolean containsStubClasses = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Stub".equals(packageChildSummary.getType())); + if (containsStubClasses && (packageLookup.isApiVersionStubPackage(this.packageElement))) { + this.STUB_TABLE_HEADER = "## Stub Classes\n"; + this.STUB_TABLE_BLURB = ""; + this.STUB_TABLE = + createHtmlTable("Stub", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If package is a Stub package and Callable Factory classes exist in this package, create a + // table of them + boolean containsCallableFactoryClasses = + listOfPackageChildrenSummaries.stream() + .anyMatch( + packageChildSummary -> "CallableFactory".equals(packageChildSummary.getType())); + if (containsCallableFactoryClasses + && (packageLookup.isApiVersionStubPackage(this.packageElement))) { + this.CALLABLE_FACTORY_TABLE_HEADER = "## Callable Factory Classes\n"; + this.CALLABLE_FACTORY_TABLE_BLURB = ""; + this.CALLABLE_FACTORY_TABLE = + createHtmlTable( + "CallableFactory", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If Classes exist in this package, create a table of them + boolean containsClasses = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Class".equals(packageChildSummary.getType())); + if (containsClasses) { + this.CLASSES_TABLE_HEADER = "## Classes\n"; + this.CLASSES_TABLE = + createHtmlTable("Class", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If Interfaces exist in this package, create a table of them + boolean containsInterfaces = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Interface".equals(packageChildSummary.getType())); + if (containsInterfaces) { + this.INTERFACES_TABLE_HEADER = "## Interfaces\n"; + this.INTERFACES_TABLE = + createHtmlTable( + "Interface", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If Enums exist in this package, create a table of them + boolean containsEnums = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Enum".equals(packageChildSummary.getType())); + if (containsEnums) { + this.ENUM_TABLE_HEADER = "## Enums\n"; + this.ENUM_TABLE = + createHtmlTable("Enum", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + + // If Exceptions exist in this package, create a table of them + boolean containsExceptions = + listOfPackageChildrenSummaries.stream() + .anyMatch(packageChildSummary -> "Exception".equals(packageChildSummary.getType())); + if (containsExceptions) { + this.EXCEPTION_TABLE_HEADER = "## Exceptions\n"; + this.EXCEPTION_TABLE = + createHtmlTable( + "Exception", cloudRADChildElementLinkPrefix, listOfPackageChildrenSummaries); + } + } + + @JsonIgnore + public String getFileContent() { + return PACKAGE_HEADER + + GITHUB_SOURCE_TABLE + + RECOMMENDED_VERSION + + PRERELEASE_IMPLICATIONS + + STUB_IMPLICATIONS + + CLIENT_TABLE_HEADER + + CLIENT_TABLE_BLURB + + CLIENT_TABLE + + STUB_TABLE_HEADER + + STUB_TABLE_BLURB + + STUB_TABLE + + SETTINGS_TABLE_HEADER + + SETTINGS_TABLE_BLURB + + SETTINGS_TABLE + + CALLABLE_FACTORY_TABLE_HEADER + + CALLABLE_FACTORY_TABLE_BLURB + + CALLABLE_FACTORY_TABLE + + CLASSES_TABLE_HEADER + + CLASSES_TABLE_BLURB + + CLASSES_TABLE + + INTERFACES_TABLE_HEADER + + INTERFACES_TABLE_BLURB + + INTERFACES_TABLE + + ENUM_TABLE_HEADER + + ENUM_TABLE_BLURB + + ENUM_TABLE + + EXCEPTION_TABLE_HEADER + + EXCEPTION_TABLE_BLURB + + EXCEPTION_TABLE; + } + + /** + * Class that contains the information about an element of a class used to populate the tables in + * the Package Overview file + */ + public static class PackageChildSummary { + String uid; + String type; + String summary; + + public PackageChildSummary(String uid, String type, String summary) { + this.uid = uid; + this.type = type; + this.summary = summary; + } + + private String getSummary() { + return summary; + } + + private String getType() { + return type; + } + + private String getUid() { + return uid; + } + } + + /** Use to get the recommended package URL for Package Overview */ + private static String createHtmlTable( + String type, String linkPrefix, List listOfPackageChildrenSummaries) { + String tableHeader = type; + if (type.equals("Client/Settings")) { + tableHeader = "Clients or Settings Class"; + } + StringBuilder tableBuilder = new StringBuilder(); + tableBuilder + .append("\n") + .append(" \n") + .append(" \n") + .append(" \n"); + + for (PackageChildSummary packageChildSummary : listOfPackageChildrenSummaries) { + if (packageChildSummary.type.equals(type)) { + tableBuilder + .append("\n") + .append("\n") + .append("\n") + .append(" \n"); + } + } + tableBuilder.append("
\n") + .append(tableHeader) + .append("\n") + .append("Description") + .append("
") + .append(withLineBreaks(packageChildSummary.uid)) + .append("\n") + .append(packageChildSummary.summary != null ? packageChildSummary.summary : "") + .append("
\n\n"); + return tableBuilder.toString(); + } + + /** Use to get the recommended package URL for Package Overview */ + public static ImmutableList extractPackageBaseURIBeforeVersion( + String input, Pattern pattern) { + Matcher matcher = pattern.matcher(input); + boolean isVersioned = matcher.find(); + if (isVersioned) { + ImmutableList packageBaseURIVersion = + new ImmutableList.Builder<>().add(matcher.group(1)).add(matcher.group(2)).build(); + return packageBaseURIVersion; + } else { + ImmutableList packageBaseURIVersion = + new ImmutableList.Builder<>().add("N/A").add("N/A").build(); + return packageBaseURIVersion; + } + } + + @JsonIgnore + public String getFileNameWithPath() { + return outputPath + File.separator + fileName; + } + + @JsonIgnore + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + @VisibleForTesting + static String withLineBreaks(String uid) { + Pattern p = Pattern.compile("[a-zA-Z\\d][a-z\\d]+\\.|[A-Z][a-z]+"); + Matcher m = p.matcher(uid); + if (!m.find()) { + return uid; + } + StringBuilder s = new StringBuilder(); + while (m.find()) { + m.appendReplacement(s, "" + m.group()); + } + return s.toString(); + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ProjectBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ProjectBuilder.java new file mode 100644 index 00000000..b43b1783 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ProjectBuilder.java @@ -0,0 +1,57 @@ +/* + * 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.build; + +import static com.microsoft.build.BuilderUtil.LANGS; + +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import java.util.ArrayList; +import java.util.List; + +class ProjectBuilder { + private final String projectName; + + ProjectBuilder(String projectName) { + this.projectName = projectName; + } + + void buildProjectMetadataFile( + List packageItems, MetadataFile projectMetadataFile) { + MetadataFileItem projectItem = new MetadataFileItem(LANGS, projectName); + projectItem.setNameWithType(projectName); + projectItem.setFullName(projectName); + projectItem.setType("Namespace"); + projectItem.setJavaType("overview"); + + List children = new ArrayList<>(); + List references = new ArrayList<>(); + packageItems.stream() + .forEach( + i -> { + children.add(i.getUid()); + MetadataFileItem refItem = new MetadataFileItem(i.getUid()); + refItem.setName(i.getName()); + refItem.setNameWithType(i.getNameWithType()); + refItem.setFullName(i.getFullName()); + references.add(refItem); + }); + + projectItem.getChildren().addAll(children); + projectMetadataFile.getReferences().addAll(references); + projectMetadataFile.getItems().add(projectItem); + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ReferenceBuilder.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ReferenceBuilder.java new file mode 100644 index 00000000..3dce8767 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/build/ReferenceBuilder.java @@ -0,0 +1,358 @@ +/* + * 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.build; + +import static com.microsoft.build.BuilderUtil.getJavaSpec; +import static com.microsoft.build.BuilderUtil.populateItemFields; +import static com.microsoft.build.BuilderUtil.replaceUidAndSplit; +import static com.microsoft.build.BuilderUtil.splitUidWithGenericsIntoClassNames; + +import com.microsoft.build.PackageOverviewFile.PackageChildSummary; +import com.microsoft.lookup.ClassLookup; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.SpecViewModel; +import com.microsoft.util.ElementUtil; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Set; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.ElementFilter; +import jdk.javadoc.doclet.DocletEnvironment; +import org.apache.commons.lang3.RegExUtils; + +class ReferenceBuilder { + private final Pattern JAVA_PATTERN = Pattern.compile("^java.*"); + private final Pattern PROTOBUF_PATTERN = Pattern.compile("^com.google.protobuf.*"); + private final Pattern GAX_PATTERN = Pattern.compile("^com.google.api.gax.*"); + private final Pattern APICOMMON_PATTERN = Pattern.compile("^com.google.api.core.*"); + private final Pattern LONGRUNNING_PATTERN = Pattern.compile("^com.google.longrunning.*"); + private final Pattern ENDING_PATTERN = Pattern.compile(".*<\\?>$"); + private final String PRIMITIVE_URL = + "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html"; + private final String JAVA_BASE_URL = "https://docs.oracle.com/javase/8/docs/api/"; + private final DocletEnvironment environment; + private final ClassLookup classLookup; + private final ElementUtil elementUtil; + + ReferenceBuilder( + DocletEnvironment environment, ClassLookup classLookup, ElementUtil elementUtil) { + this.environment = environment; + this.classLookup = classLookup; + this.elementUtil = elementUtil; + } + + MetadataFileItem buildClassReference(TypeElement classElement) { + MetadataFileItem referenceItem = new MetadataFileItem(classLookup.extractUid(classElement)); + referenceItem.setName(classLookup.extractName(classElement)); + referenceItem.setNameWithType(classLookup.extractNameWithType(classElement)); + referenceItem.setFullName(classLookup.extractFullName(classElement)); + return referenceItem; + } + + void addReferencesInfo(TypeElement classElement, MetadataFile classMetadataFile) { + MetadataFileItem classReference = new MetadataFileItem(classLookup.extractUid(classElement)); + classReference.setParent(classLookup.extractParent(classElement)); + populateItemFields(classReference, classLookup, classElement); + classReference.setTypeParameters(classLookup.extractTypeParameters(classElement)); + + addTypeParameterReferences(classReference, classMetadataFile); + addSuperclassAndInterfacesReferences(classElement, classMetadataFile); + addInnerClassesReferences(classElement, classMetadataFile); + } + + void addPackageChildrenSummaries( + Element element, List packageChildrenSummaries) { + for (TypeElement classElement : elementUtil.extractSortedElements(element)) { + String summary = classLookup.extractSummary(classElement); + String type = classLookup.extractType(classElement); + String uid = classLookup.extractUid(classElement); + // Only take the first 4 lines as the summary to keep the table tidy + if (summary != null) { + String[] summaryStrings = summary.split("\n"); + if (summaryStrings.length > 4) { + summary = + summaryStrings[0] + + "\n" + + summaryStrings[1] + + "\n" + + summaryStrings[2] + + "\n" + + summaryStrings[3]; + } + } + // If a Class is a Client, call it out separately in the Package Overview + if (uid.endsWith("Client")) { + type = "Client"; + } + // If a Class is a Settings class, call it out separately in the Package Overview + if (uid.endsWith("Settings")) { + type = "Settings"; + } + // If a Class is a Stub class, call it out separately in the Package Overview + if (uid.endsWith("Stub")) { + type = "Stub"; + } + // If a Class is a CallableFactory class (in Stub Packages only), call it out separately in + // the Package Overview + if (uid.endsWith("CallableFactory")) { + type = "CallableFactory"; + } + // If a Class is an Exception, call it out separately in + // the Package Overview + if (uid.endsWith("Exception")) { + type = "Exception"; + } + packageChildrenSummaries.add(new PackageChildSummary(uid, type, summary)); + addPackageChildrenSummaries(classElement, packageChildrenSummaries); + } + } + + String getJavaReferenceHref(String uid) { + if (uid == null || uid.equals("")) { + return JAVA_BASE_URL; + } + // example1 uid: "java.lang.Object.equals(java.lang.Object)" + // example2 uid: "java.lang.Object" + String endURL = uid.replaceAll("", ""); + + Pattern argPattern = Pattern.compile(".*\\(.*\\).*"); + if (argPattern.matcher(endURL).find()) { + // example1 + // argumentSplit: ["java.lang.Object.equals", "java.lang.Object)"] + // nameSplit: ["java", "lang", "Object", "equals"] + List argumentSplit = Arrays.asList(endURL.split("\\(")); + List nameSplit = Arrays.asList(argumentSplit.get(0).split("\\.")); + + // className: "java/lang/Object" + // methodName: "#equals" + // argumentsName: "#java.lang.Object-" + String className = String.join("/", nameSplit.subList(0, nameSplit.size() - 1)); + String methodName = "#" + nameSplit.get(nameSplit.size() - 1); + String argumentsName = argumentSplit.get(1).replaceAll("[,)]", "-"); + + // endURL: "java/lang/Object.html#equals-java.lang.Object-" + endURL = className + ".html" + methodName + "-" + argumentsName; + } else { + // example2 + // endURL = java/lang/Object.html + endURL = endURL.replaceAll("\\.", "/"); + endURL = endURL + ".html"; + } + return JAVA_BASE_URL + endURL; + } + + void updateExternalReferences(List classMetadataFiles) { + classMetadataFiles.forEach( + file -> file.getReferences().forEach(ref -> updateExternalReference(ref))); + } + + private void updateExternalReference(MetadataFileItem reference) { + String uid = reference.getUid(); + uid = updateReferenceUid(uid); + + if (isJavaPrimitive(uid)) { + reference.setHref(PRIMITIVE_URL); + return; + } + if (isJavaLibrary(uid)) { + reference.setHref(getJavaReferenceHref(uid)); + } + if (isExternalReference(uid)) { + reference.setIsExternal(true); + } + if (reference.getSpecForJava().size() > 0) { + for (SpecViewModel spec : reference.getSpecForJava()) { + String specUid = spec.getUid(); + if (specUid != null) { + if (isJavaPrimitive(specUid)) { + spec.setHref(PRIMITIVE_URL); + } + if (isJavaLibrary(specUid)) { + spec.setHref(getJavaReferenceHref(specUid)); + } + if (isExternalReference(specUid)) { + spec.setIsExternal(true); + } + } + } + } + } + + private String updateReferenceUid(String uid) { + if (ENDING_PATTERN.matcher(uid).find()) { + uid = uid.replace("", ""); + } + return uid; + } + + private boolean isExternalReference(String uid) { + return (PROTOBUF_PATTERN.matcher(uid).find() + || GAX_PATTERN.matcher(uid).find() + || APICOMMON_PATTERN.matcher(uid).find() + || GAX_PATTERN.matcher(uid).find() + || LONGRUNNING_PATTERN.matcher(uid).find()); + } + + private boolean isJavaPrimitive(String uid) { + return (uid.equals("boolean") + || uid.equals("int") + || uid.equals("byte") + || uid.equals("long") + || uid.equals("float") + || uid.equals("double") + || uid.equals("char") + || uid.equals("short")); + } + + private boolean isJavaLibrary(String uid) { + return JAVA_PATTERN.matcher(uid).find(); + } + + void addParameterReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .addAll( + methodItem.getSyntax().getParameters().stream() + .map(parameter -> buildRefItem(parameter.getType())) + .filter(o -> !classMetadataFile.getItems().contains(o)) + .collect(Collectors.toList())); + } + + void addReturnReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .addAll( + Stream.of(methodItem.getSyntax().getReturnValue()) + .filter(Objects::nonNull) + .map(returnValue -> buildRefItem(returnValue.getReturnType())) + .filter(o -> !classMetadataFile.getItems().contains(o)) + .collect(Collectors.toList())); + } + + void addExceptionReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .addAll( + methodItem.getExceptions().stream() + .map(exceptionItem -> buildRefItem(exceptionItem.getType())) + .filter(o -> !classMetadataFile.getItems().contains(o)) + .collect(Collectors.toList())); + } + + void addTypeParameterReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .addAll( + methodItem.getSyntax().getTypeParameters().stream() + .map( + typeParameter -> { + String id = typeParameter.getId(); + return new MetadataFileItem(id, id, false); + }) + .collect(Collectors.toList())); + } + + void addSuperclassAndInterfacesReferences( + TypeElement classElement, MetadataFile classMetadataFile) { + classMetadataFile.getReferences().addAll(classLookup.extractReferences(classElement)); + } + + void addInnerClassesReferences(TypeElement classElement, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .addAll( + ElementFilter.typesIn(elementUtil.extractSortedElements(classElement)).stream() + .map(this::buildClassReference) + .collect(Collectors.toList())); + } + + void addOverloadReferences(MetadataFileItem item, MetadataFile classMetadataFile) { + classMetadataFile + .getReferences() + .add( + new MetadataFileItem(item.getOverload()) { + { + setName(RegExUtils.removeAll(item.getName(), "\\(.*\\)$")); + setNameWithType(RegExUtils.removeAll(item.getNameWithType(), "\\(.*\\)$")); + setFullName(RegExUtils.removeAll(item.getFullName(), "\\(.*\\)$")); + setPackageName(item.getPackageName()); + } + }); + } + + /** + * Replace one record in 'references' with several records in this way: + * + *
+   * a.b.c.List> ->
+   *     - a.b.c.List
+   *     - df.mn.ClassOne
+   *     - tr.T
+   * 
+ */ + void expandComplexGenericsInReferences(MetadataFile classMetadataFile) { + Set additionalItems = new LinkedHashSet<>(); + Iterator iterator = classMetadataFile.getReferences().iterator(); + while (iterator.hasNext()) { + MetadataFileItem item = iterator.next(); + String uid = item.getUid(); + if (!uid.endsWith("*") && uid.contains("<")) { + List classNames = splitUidWithGenericsIntoClassNames(uid); + additionalItems.addAll( + classNames.stream() + .map(s -> new MetadataFileItem(s, classLookup.makeTypeShort(s), false)) + .collect(Collectors.toSet())); + } + } + // Remove items which already exist in 'items' section (compared by 'uid' field) + additionalItems.removeAll(classMetadataFile.getItems()); + + classMetadataFile.getReferences().addAll(additionalItems); + } + + MetadataFileItem buildRefItem(String uid) { + if (!uid.endsWith("*") && (uid.contains("<") || uid.contains("[]"))) { + return new MetadataFileItem(uid, getJavaSpec(replaceUidAndSplit(uid))); + } else { + List fullNameList = new ArrayList<>(); + + environment + .getIncludedElements() + .forEach( + element -> + elementUtil + .extractSortedElements(element) + .forEach( + typeElement -> + fullNameList.add(classLookup.extractFullName(typeElement)))); + + if (fullNameList.contains(uid)) { + return new MetadataFileItem(uid, classLookup.makeTypeShort(uid), false); + } else { + return new MetadataFileItem(uid, getJavaSpec(replaceUidAndSplit(uid))); + } + } + } +} 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 0733bb61..f0ddb1e8 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 @@ -1,652 +1,236 @@ package com.microsoft.build; -import com.microsoft.lookup.BaseLookup; +import static com.microsoft.build.BuilderUtil.populateUidValues; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableListMultimap; +import com.google.docfx.doclet.ApiVersion; +import com.google.docfx.doclet.RepoMetadata; import com.microsoft.lookup.ClassItemsLookup; import com.microsoft.lookup.ClassLookup; import com.microsoft.lookup.PackageLookup; -import com.microsoft.model.*; +import com.microsoft.lookup.PackageLookup.PackageGroup; +import com.microsoft.model.LibraryOverviewFile; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.TocFile; +import com.microsoft.model.TocItem; import com.microsoft.util.ElementUtil; import com.microsoft.util.FileUtil; -import com.microsoft.util.Utils; -import com.microsoft.util.YamlUtil; -import jdk.javadoc.doclet.DocletEnvironment; -import org.apache.commons.lang3.RegExUtils; -import org.apache.commons.lang3.StringUtils; - -import javax.lang.model.element.*; -import javax.lang.model.util.ElementFilter; -import java.util.*; -import java.util.function.Function; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; -import java.util.stream.Stream; - +import javax.lang.model.element.PackageElement; +import jdk.javadoc.doclet.DocletEnvironment; public class YmlFilesBuilder { - - private final static String[] LANGS = {"java"}; - private final Pattern XREF_LINK_PATTERN = Pattern.compile(".*?"); - private final Pattern XREF_LINK_CONTENT_PATTERN = Pattern.compile("(?<=.*?)"); - private final Pattern XREF_LINK_RESOLVE_PATTERN = Pattern.compile("(?\\w+)\\#(?\\w+)(\\((?.*)\\))?"); - - private DocletEnvironment environment; - private String outputPath; - private ElementUtil elementUtil; - private PackageLookup packageLookup; - private ClassItemsLookup classItemsLookup; - private ClassLookup classLookup; - private String projectName; - - private final Pattern JAVA_PATTERN = Pattern.compile("^java.*"); - private final Pattern PROTOBUF_PATTERN = Pattern.compile("^com.google.protobuf.*"); - private final Pattern GAX_PATTERN = Pattern.compile("^com.google.api.gax.*"); - private final Pattern APICOMMON_PATTERN = Pattern.compile("^com.google.api.core.*"); - private final Pattern LONGRUNNING_PATTERN = Pattern.compile("^com.google.longrunning.*"); - private final Pattern ENDING_PATTERN = Pattern.compile(".*<\\?>$"); - private final String PRIMITIVE_URL = "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html"; - private final String JAVA_BASE_URL = "https://docs.oracle.com/javase/8/docs/api/"; - - public YmlFilesBuilder(DocletEnvironment environment, String outputPath, - String[] excludePackages, String[] excludeClasses, String projectName) { - this.environment = environment; - this.outputPath = outputPath; - this.elementUtil = new ElementUtil(excludePackages, excludeClasses); - this.packageLookup = new PackageLookup(environment); - this.classItemsLookup = new ClassItemsLookup(environment); - this.classLookup = new ClassLookup(environment); - this.projectName = projectName; - } - - public boolean build() { - List packageMetadataFiles = new ArrayList<>(); - List classMetadataFiles = new ArrayList<>(); - - TocFile tocFile = new TocFile(outputPath, projectName); - for (PackageElement packageElement : elementUtil.extractPackageElements(environment.getIncludedElements())) { - String uid = packageLookup.extractUid(packageElement); - String status = packageLookup.extractStatus(packageElement.getQualifiedName().toString()); - TocItem packageTocItem = new TocItem(uid, uid, status); - packageMetadataFiles.add(buildPackageMetadataFile(packageElement)); - packageTocItem.getItems().add(new TocItem(uid, "Package summary")); - - TocTypeMap typeMap = new TocTypeMap(); - buildFilesForInnerClasses(packageElement,typeMap, classMetadataFiles); - packageTocItem.getItems().addAll(joinTocTypeItems(typeMap)); - - tocFile.addTocItem(packageTocItem); - } - - for (MetadataFile packageFile : packageMetadataFiles) { - 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; - } - } - } - - populateUidValues(packageMetadataFiles, classMetadataFiles); - updateExternalReferences(classMetadataFiles); - - packageMetadataFiles.forEach(FileUtil::dumpToFile); - classMetadataFiles.forEach(FileUtil::dumpToFile); - FileUtil.dumpToFile(tocFile); - - return true; - } - - List joinTocTypeItems(TocTypeMap tocTypeMap){ - return tocTypeMap.getTitleList().stream() - .filter(kindTitle -> tocTypeMap.get(kindTitle.getElementKind()).size() > 0) - .flatMap(kindTitle -> { - tocTypeMap.get(kindTitle.getElementKind()).add(0, new TocItem(kindTitle.getTitle())); - return tocTypeMap.get(kindTitle.getElementKind()).stream(); - }).collect(Collectors.toList()); - } - - void buildFilesForInnerClasses(Element element, TocTypeMap tocTypeMap, List container) { - for (TypeElement classElement : elementUtil.extractSortedElements(element)) { - String uid = classLookup.extractUid(classElement); - String name = classLookup.extractTocName(classElement); - String status = classLookup.extractStatus(classElement); - - if (tocTypeMap.get(classElement.getKind().name()) != null) { - if (classElement.getKind().name().equals(ElementKind.CLASS.name()) && name.contains("Exception")) { - tocTypeMap.get("EXCEPTION").add(new TocItem(uid, name, status)); - } else { - tocTypeMap.get(classElement.getKind().name()).add(new TocItem(uid, name, status)); - } - } else { - tocTypeMap.get(ElementKind.CLASS.name()).add(new TocItem(uid, name, status)); - } - - container.add(buildClassYmlFile(classElement)); - buildFilesForInnerClasses(classElement, tocTypeMap, container); - } - } - - MetadataFile buildPackageMetadataFile(PackageElement packageElement) { - String fileName = packageLookup.extractHref(packageElement); - MetadataFile packageMetadataFile = new MetadataFile(outputPath, fileName); - MetadataFileItem packageItem = new MetadataFileItem(LANGS, packageLookup.extractUid(packageElement)); - packageItem.setId(packageLookup.extractId(packageElement)); - addChildrenReferences(packageElement, packageItem.getChildren(), packageMetadataFile.getReferences()); - populateItemFields(packageItem, packageLookup, packageElement); - packageMetadataFile.getItems().add(packageItem); - return packageMetadataFile; - } - - void addChildrenReferences(Element element, List packageChildren, - Set referencesCollector) { - for (TypeElement classElement : elementUtil.extractSortedElements(element)) { - referencesCollector.add(buildClassReference(classElement)); - - packageChildren.add(classLookup.extractUid(classElement)); - addChildrenReferences(classElement, packageChildren, referencesCollector); - } - } - - MetadataFileItem buildClassReference(TypeElement classElement) { - MetadataFileItem referenceItem = new MetadataFileItem(classLookup.extractUid(classElement)); - referenceItem.setName(classLookup.extractName(classElement)); - referenceItem.setNameWithType(classLookup.extractNameWithType(classElement)); - referenceItem.setFullName(classLookup.extractFullName(classElement)); - return referenceItem; - } - - void populateItemFields(MetadataFileItem item, BaseLookup lookup, T element) { - item.setName(lookup.extractName(element)); - item.setNameWithType(lookup.extractNameWithType(element)); - item.setFullName(lookup.extractFullName(element)); - item.setType(lookup.extractType(element)); - item.setSummary(lookup.extractSummary(element)); - item.setContent(lookup.extractContent(element)); - } - - MetadataFile buildClassYmlFile(TypeElement classElement) { - String fileName = classLookup.extractHref(classElement); - MetadataFile classMetadataFile = new MetadataFile(outputPath, fileName); - addClassInfo(classElement, classMetadataFile); - addConstructorsInfo(classElement, classMetadataFile); - addMethodsInfo(classElement, classMetadataFile); - addFieldsInfo(classElement, classMetadataFile); - addReferencesInfo(classElement, classMetadataFile); - applyPostProcessing(classMetadataFile); - return classMetadataFile; - } - - void addClassInfo(TypeElement classElement, MetadataFile classMetadataFile) { - MetadataFileItem classItem = new MetadataFileItem(LANGS, classLookup.extractUid(classElement)); - classItem.setId(classLookup.extractId(classElement)); - classItem.setParent(classLookup.extractParent(classElement)); - addChildren(classElement, classItem.getChildren()); - populateItemFields(classItem, classLookup, classElement); - classItem.setPackageName(classLookup.extractPackageName(classElement)); - classItem.setTypeParameters(classLookup.extractTypeParameters(classElement)); - classItem.setInheritance(classLookup.extractSuperclass(classElement)); - classItem.setInterfaces(classLookup.extractInterfaces(classElement)); - classItem.setInheritedMethods(classLookup.extractInheritedMethods(classElement)); - String depMsg = classLookup.extractDeprecatedDescription(classElement); - if (depMsg != null) { - classItem.setSummary(getDeprecatedSummary(depMsg, classItem.getSummary())); - classItem.setStatus(Status.DEPRECATED.toString()); - } - classMetadataFile.getItems().add(classItem); - } - - String getDeprecatedSummary(String depMsg, String summary){ - String result = "

(deprecated) " + depMsg + "

"; - if (summary != null && !summary.equals("")) { - result = result + "\n" + summary; - } - return result; - } - - void addChildren(TypeElement classElement, List children) { - collect(classElement, children, ElementFilter::constructorsIn, classItemsLookup::extractUid); - collect(classElement, children, ElementFilter::methodsIn, classItemsLookup::extractUid); - collect(classElement, children, ElementFilter::fieldsIn, classItemsLookup::extractUid); - collect(classElement, children, ElementFilter::typesIn, String::valueOf); - } - - List filterPrivateElements(List elements) { - return elements.stream() - .filter(element -> !Utils.isPrivateOrPackagePrivate(element)).collect(Collectors.toList()); - } - - void collect(TypeElement classElement, List children, - Function, List> selectFunc, - Function mapFunc) { - - List elements = selectFunc.apply(classElement.getEnclosedElements()); - children.addAll(filterPrivateElements(elements).stream() - .map(mapFunc).collect(Collectors.toList())); - } - - void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFile) { - for (ExecutableElement constructorElement : ElementFilter.constructorsIn(classElement.getEnclosedElements())) { - MetadataFileItem constructorItem = buildMetadataFileItem(constructorElement); - constructorItem.setOverload(classItemsLookup.extractOverload(constructorElement)); - constructorItem.setContent(classItemsLookup.extractConstructorContent(constructorElement)); - constructorItem.setParameters(classItemsLookup.extractParameters(constructorElement)); - String depMsg = classItemsLookup.extractDeprecatedDescription(constructorElement); - if (depMsg != null) { - constructorItem.setSummary(getDeprecatedSummary(depMsg, constructorItem.getSummary())); - constructorItem.setStatus(Status.DEPRECATED.toString()); - } - classMetadataFile.getItems().add(constructorItem); - - addParameterReferences(constructorItem, classMetadataFile); - addOverloadReferences(constructorItem, classMetadataFile); - } - } - - void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { - ElementFilter.methodsIn(classElement.getEnclosedElements()).stream() - .filter(methodElement -> !Utils.isPrivateOrPackagePrivate(methodElement)) - .forEach(methodElement -> { - MetadataFileItem methodItem = buildMetadataFileItem(methodElement); - methodItem.setOverload(classItemsLookup.extractOverload(methodElement)); - methodItem.setContent(classItemsLookup.extractMethodContent(methodElement)); - methodItem.setExceptions(classItemsLookup.extractExceptions(methodElement)); - methodItem.setParameters(classItemsLookup.extractParameters(methodElement)); - methodItem.setReturn(classItemsLookup.extractReturn(methodElement)); - methodItem.setOverridden(classItemsLookup.extractOverridden(methodElement)); - String depMsg = classItemsLookup.extractDeprecatedDescription(methodElement); - if (depMsg != null) { - methodItem.setSummary(getDeprecatedSummary(depMsg, methodItem.getSummary())); - methodItem.setStatus(Status.DEPRECATED.toString()); - } - - classMetadataFile.getItems().add(methodItem); - addExceptionReferences(methodItem, classMetadataFile); - addParameterReferences(methodItem, classMetadataFile); - addReturnReferences(methodItem, classMetadataFile); - addOverloadReferences(methodItem, classMetadataFile); - }); - } - - void addFieldsInfo(TypeElement classElement, MetadataFile classMetadataFile) { - ElementFilter.fieldsIn(classElement.getEnclosedElements()).stream() - .filter(fieldElement -> !Utils.isPrivateOrPackagePrivate(fieldElement)) - .forEach(fieldElement -> { - MetadataFileItem fieldItem = buildMetadataFileItem(fieldElement); - fieldItem.setContent(classItemsLookup.extractFieldContent(fieldElement)); - fieldItem.setReturn(classItemsLookup.extractReturn(fieldElement)); - String depMsg = classItemsLookup.extractDeprecatedDescription(fieldElement); - if (depMsg != null) { - fieldItem.setSummary(getDeprecatedSummary(depMsg, fieldItem.getSummary())); - fieldItem.setStatus(Status.DEPRECATED.toString()); - } - - classMetadataFile.getItems().add(fieldItem); - addReturnReferences(fieldItem, classMetadataFile); - }); - } - - void addReferencesInfo(TypeElement classElement, MetadataFile classMetadataFile) { - MetadataFileItem classReference = new MetadataFileItem(classLookup.extractUid(classElement)); - classReference.setParent(classLookup.extractParent(classElement)); - populateItemFields(classReference, classLookup, classElement); - classReference.setTypeParameters(classLookup.extractTypeParameters(classElement)); - - addTypeParameterReferences(classReference, classMetadataFile); - addSuperclassAndInterfacesReferences(classElement, classMetadataFile); - addInnerClassesReferences(classElement, classMetadataFile); - } - - MetadataFileItem buildMetadataFileItem(Element element) { - return new MetadataFileItem(LANGS, classItemsLookup.extractUid(element)) {{ - setId(classItemsLookup.extractId(element)); - setParent(classItemsLookup.extractParent(element)); - setName(classItemsLookup.extractName(element)); - setNameWithType(classItemsLookup.extractNameWithType(element)); - setFullName(classItemsLookup.extractFullName(element)); - setType(classItemsLookup.extractType(element)); - setPackageName(classItemsLookup.extractPackageName(element)); - setSummary(classItemsLookup.extractSummary(element)); - }}; - } - - protected String getJavaReferenceHref(String uid) { - if (uid == null || uid.equals("")) { - return JAVA_BASE_URL; - } - // example1 uid: "java.lang.Object.equals(java.lang.Object)" - // example2 uid: "java.lang.Object" - String endURL = uid.replaceAll("", ""); - - Pattern argPattern = Pattern.compile(".*\\(.*\\).*"); - if (argPattern.matcher(endURL).find()) { - // example1 - // argumentSplit: ["java.lang.Object.equals", "java.lang.Object)"] - // nameSplit: ["java", "lang", "Object", "equals"] - List argumentSplit = Arrays.asList(endURL.split("\\(")); - List nameSplit = Arrays.asList(argumentSplit.get(0).split("\\.")); - - // className: "java/lang/Object" - // methodName: "#equals" - // argumentsName: "#java.lang.Object-" - String className = String.join("/", nameSplit.subList(0, nameSplit.size() - 1)); - String methodName = "#" + nameSplit.get(nameSplit.size() - 1); - String argumentsName = argumentSplit.get(1).replaceAll("[,)]", "-"); - - // endURL: "java/lang/Object.html#equals-java.lang.Object-" - endURL = className + ".html" + methodName + "-" + argumentsName; - } else { - // example2 - // endURL = java/lang/Object.html - endURL = endURL.replaceAll("\\.", "/"); - endURL = endURL + ".html"; - } - return JAVA_BASE_URL + endURL; - } - - private void updateExternalReferences(List classMetadataFiles) { - classMetadataFiles.forEach(file -> file.getReferences() - .forEach(ref -> updateExternalReference(ref))); - } - - private void updateExternalReference(MetadataFileItem reference) { - String uid = reference.getUid(); - uid = updateReferenceUid(uid); - - if (isJavaPrimitive(uid)) { - reference.setHref(PRIMITIVE_URL); - return; - } - if (isJavaLibrary(uid)) { - reference.setHref(getJavaReferenceHref(uid)); - } - if (isExternalReference(uid)) { - reference.setIsExternal(true); - } - if (reference.getSpecForJava().size() > 0) { - for (SpecViewModel spec : reference.getSpecForJava()) { - String specUid = spec.getUid(); - if (specUid != null) { - if (isJavaPrimitive(specUid)) { - spec.setHref(PRIMITIVE_URL); + 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 boolean disableLibraryOverview; + + private final String artifactVersion; + + private final String librariesBomVersion; + + private final String repoMetadataFilePath; + private final ProjectBuilder projectBuilder; + private final PackageBuilder packageBuilder; + private final ClassBuilder classBuilder; + private final ReferenceBuilder referenceBuilder; + + public YmlFilesBuilder( + DocletEnvironment environment, + String outputPath, + String[] excludePackages, + String[] excludeClasses, + String projectName, + boolean disableChangelog, + boolean disableLibraryOverview, + String artifactVersion, + String librariesBomVersion, + String repoMetadataFilePath) { + this.environment = environment; + this.outputPath = outputPath; + this.artifactVersion = artifactVersion; + this.librariesBomVersion = librariesBomVersion; + this.repoMetadataFilePath = repoMetadataFilePath; + this.elementUtil = new ElementUtil(excludePackages, excludeClasses); + this.packageLookup = new PackageLookup(environment); + this.projectName = projectName; + this.disableChangelog = disableChangelog; + this.disableLibraryOverview = disableLibraryOverview; + this.projectBuilder = new ProjectBuilder(projectName); + ClassLookup classLookup = new ClassLookup(environment, elementUtil); + this.referenceBuilder = new ReferenceBuilder(environment, classLookup, elementUtil); + this.packageBuilder = new PackageBuilder(packageLookup, outputPath, referenceBuilder); + this.classBuilder = + new ClassBuilder( + elementUtil, + classLookup, + new ClassItemsLookup(environment, elementUtil), + outputPath, + packageLookup, + referenceBuilder); + } + + public boolean build() { + Processor processor = new Processor(); + processor.repoMetadata = processor.repoMetadata.parseRepoMetadata(this.repoMetadataFilePath); + processor.process(); + + // write to yaml files + if (disableLibraryOverview) { + FileUtil.dumpToFile(processor.projectMetadataFile); + } + processor.packageMetadataFiles.forEach(FileUtil::dumpToFile); + processor.classMetadataFiles.forEach(FileUtil::dumpToFile); + processor.packageOverviewFiles.forEach(FileUtil::dumpToFile); + FileUtil.dumpToFile(processor.tocFile); + + // Generate new library overview page + if (!disableLibraryOverview) { + LibraryOverviewFile libraryOverviewFile = + new LibraryOverviewFile( + outputPath, + "overview.md", + artifactVersion, + librariesBomVersion, + repoMetadataFilePath, + processor.recommendedPackage); + FileUtil.dumpToFile(libraryOverviewFile); + } + return true; + } + + @VisibleForTesting + class Processor { + // table of contents + final TocFile tocFile = + new TocFile(outputPath, projectName, disableChangelog, disableLibraryOverview); + // overview page if not using new libraryOverview + + final MetadataFile projectMetadataFile = new MetadataFile(outputPath, "overview.yml"); + // package summary pages + private final List packageMetadataFiles = new ArrayList<>(); + + private final List packageOverviewFiles = new ArrayList<>(); + // packages + private final List packageItems = new ArrayList<>(); + // class/enum/interface/etc. pages + private final List classMetadataFiles = new ArrayList<>(); + + private final List allPackages = + elementUtil.extractPackageElements(environment.getIncludedElements()); + + private ApiVersion recommendedApiVersion; + + // If set in RepoMetadata, use that value. Otherwise, calculate based on recommendedApiVersion + private String recommendedPackage = ""; + + private RepoMetadata repoMetadata = new RepoMetadata(); + + @VisibleForTesting + void process() { + ImmutableListMultimap organizedPackagesWithoutStubs = + packageLookup.organize( + allPackages.stream() + .filter(pkg -> !packageLookup.isApiVersionStubPackage(pkg)) + .collect(Collectors.toList())); + + // Use the provided recommended package in the .repo-metadata.json file, if set + recommendedPackage = + repoMetadata + .getRecommendedPackage() + .orElseGet( + () -> { + // Calculate the recommended package based on the latest stable Version ID. + HashMap packageVersions = new HashMap<>(); + for (PackageElement pkg : allPackages) { + Optional apiVersion = packageLookup.extractApiVersion(pkg); + apiVersion.ifPresent( + version -> + packageVersions.put(version, String.valueOf(pkg.getQualifiedName()))); } - if (isJavaLibrary(specUid)) { - spec.setHref(getJavaReferenceHref(specUid)); - } - if (isExternalReference(specUid)) { - spec.setIsExternal(true); - } - } - } - } - } - - private String updateReferenceUid(String uid) { - if (ENDING_PATTERN.matcher(uid).find()) { - uid = uid.replace("", ""); - } - return uid; - } - - private boolean isExternalReference(String uid) { - return (PROTOBUF_PATTERN.matcher(uid).find() || GAX_PATTERN.matcher(uid).find() || APICOMMON_PATTERN.matcher(uid).find() || GAX_PATTERN.matcher(uid).find() || LONGRUNNING_PATTERN.matcher(uid).find()); - } - - private boolean isJavaPrimitive(String uid) { - return (uid.equals("boolean") || uid.equals("int") || uid.equals("byte") || uid.equals("long") || uid.equals("float") || uid.equals("double") || uid.equals("char") || uid.equals("short")); - } - - private boolean isJavaLibrary(String uid) { - return JAVA_PATTERN.matcher(uid).find(); - } - - void addParameterReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll( - methodItem.getSyntax().getParameters().stream() - .map(parameter -> buildRefItem(parameter.getType())) - .filter(o -> !classMetadataFile.getItems().contains(o)) - .collect(Collectors.toList())); - } - - void addReturnReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll( - Stream.of(methodItem.getSyntax().getReturnValue()) - .filter(Objects::nonNull) - .map(returnValue -> buildRefItem(returnValue.getReturnType())) - .filter(o -> !classMetadataFile.getItems().contains(o)) - .collect(Collectors.toList())); - } - - void addExceptionReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll( - methodItem.getExceptions().stream() - .map(exceptionItem -> buildRefItem(exceptionItem.getType())) - .filter(o -> !classMetadataFile.getItems().contains(o)) - .collect(Collectors.toList())); - } - - void addTypeParameterReferences(MetadataFileItem methodItem, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll( - methodItem.getSyntax().getTypeParameters().stream() - .map(typeParameter -> { - String id = typeParameter.getId(); - return new MetadataFileItem(id, id, false); - }).collect(Collectors.toList())); - } - - void addSuperclassAndInterfacesReferences(TypeElement classElement, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll(classLookup.extractReferences(classElement)); - } - - void addInnerClassesReferences(TypeElement classElement, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().addAll( - ElementFilter.typesIn(elementUtil.extractSortedElements(classElement)).stream() - .map(this::buildClassReference) - .collect(Collectors.toList())); - } - - void addOverloadReferences(MetadataFileItem item, MetadataFile classMetadataFile) { - classMetadataFile.getReferences().add(new MetadataFileItem(item.getOverload()) {{ - setName(RegExUtils.removeAll(item.getName(), "\\(.*\\)$")); - setNameWithType(RegExUtils.removeAll(item.getNameWithType(), "\\(.*\\)$")); - setFullName(RegExUtils.removeAll(item.getFullName(), "\\(.*\\)$")); - setPackageName(item.getPackageName()); - }}); - } - - void applyPostProcessing(MetadataFile classMetadataFile) { - expandComplexGenericsInReferences(classMetadataFile); - } - - /** - * Replace one record in 'references' with several records in this way: - *
-     * a.b.c.List> ->
-     *     - a.b.c.List
-     *     - df.mn.ClassOne
-     *     - tr.T
-     * 
- */ - void expandComplexGenericsInReferences(MetadataFile classMetadataFile) { - Set additionalItems = new LinkedHashSet<>(); - Iterator iterator = classMetadataFile.getReferences().iterator(); - while (iterator.hasNext()) { - MetadataFileItem item = iterator.next(); - String uid = item.getUid(); - if (!uid.endsWith("*") && uid.contains("<")) { - List classNames = splitUidWithGenericsIntoClassNames(uid); - additionalItems.addAll(classNames.stream() - .map(s -> new MetadataFileItem(s, classLookup.makeTypeShort(s), false)) - .collect(Collectors.toSet())); - } - } - // Remove items which already exist in 'items' section (compared by 'uid' field) - additionalItems.removeAll(classMetadataFile.getItems()); - - classMetadataFile.getReferences().addAll(additionalItems); - } - - void populateUidValues(List packageMetadataFiles, List classMetadataFiles) { - Lookup lookup = new Lookup(packageMetadataFiles, classMetadataFiles); - - classMetadataFiles.forEach(classMetadataFile -> { - LookupContext lookupContext = lookup.buildContext(classMetadataFile); - - for (MetadataFileItem item : classMetadataFile.getItems()) { - item.setSummary(YamlUtil.cleanupHtml( - populateUidValues(item.getSummary(), lookupContext) - )); - - Optional.ofNullable(item.getSyntax()).ifPresent(syntax -> { - Optional.ofNullable(syntax.getParameters()).ifPresent( - methodParams -> methodParams.forEach( - param -> { - param.setDescription(populateUidValues(param.getDescription(), lookupContext)); - }) - ); - Optional.ofNullable(syntax.getReturnValue()).ifPresent(returnValue -> - returnValue.setReturnDescription( - populateUidValues(syntax.getReturnValue().getReturnDescription(), lookupContext) - ) - ); - } - ); - } - }); - } - - String populateUidValues(String text, LookupContext lookupContext) { - if (StringUtils.isBlank(text)) { - return text; - } - - Matcher linkMatcher = XREF_LINK_PATTERN.matcher(text); - while (linkMatcher.find()) { - String link = linkMatcher.group(); - Matcher linkContentMatcher = XREF_LINK_CONTENT_PATTERN.matcher(link); - if (!linkContentMatcher.find()) { - continue; - } - - String linkContent = linkContentMatcher.group(); - String uid = resolveUidFromLinkContent(linkContent, lookupContext); - String updatedLink = linkContentMatcher.replaceAll(uid); - text = StringUtils.replace(text, link, updatedLink); - } - return text; - } - - /** - * The linkContent could be in following format - * #memeber - * Class#member - * Class#method() - * Class#method(params) - */ - String resolveUidFromLinkContent(String linkContent, LookupContext lookupContext) { - if (StringUtils.isBlank(linkContent)) { - return ""; - } - - linkContent = linkContent.trim(); - - // complete class name for class internal link - if (linkContent.startsWith("#")) { - String firstKey = lookupContext.getOwnerUid(); - linkContent = firstKey + linkContent; - } - - // fuzzy resolve, target for items from project external references - String fuzzyResolvedUid = resolveUidFromReference(linkContent, lookupContext); - - // exact resolve in lookupContext - linkContent = linkContent.replace("#", "."); - String exactResolveUid = resolveUidByLookup(linkContent, lookupContext); - return exactResolveUid.isEmpty() ? fuzzyResolvedUid : exactResolveUid; - } - - List splitUidWithGenericsIntoClassNames(String uid) { - uid = RegExUtils.removeAll(uid, "[>]+$"); - return Arrays.asList(StringUtils.split(uid, "<")); - } - - MetadataFileItem buildRefItem(String uid) { - if (!uid.endsWith("*") && (uid.contains("<") || uid.contains("[]"))) { - return new MetadataFileItem(uid, getJavaSpec(replaceUidAndSplit(uid))); - } else { - List fullNameList = new ArrayList<>(); - - this.environment.getIncludedElements().forEach( - element -> elementUtil.extractSortedElements(element).forEach( - typeElement -> fullNameList.add(classLookup.extractFullName(typeElement))) - ); - - if (fullNameList.contains(uid)) { - return new MetadataFileItem(uid, classLookup.makeTypeShort(uid), false); - } else { - return new MetadataFileItem(uid, getJavaSpec(replaceUidAndSplit(uid))); - } - } - } - - List replaceUidAndSplit(String uid) { - String retValue = RegExUtils.replaceAll(uid, "\\<", "//", "//>//"); - retValue = RegExUtils.replaceAll(retValue, ",", "//,//"); - retValue = RegExUtils.replaceAll(retValue, "\\[\\]", "//[]//"); - - return Arrays.asList(StringUtils.split(retValue, "//")); - } - - List getJavaSpec(List references) { - List specList = new ArrayList<>(); - - Optional.ofNullable(references).ifPresent( - ref -> references.forEach( - uid -> { - if (uid.equalsIgnoreCase("<") - || uid.equalsIgnoreCase(">") - || uid.equalsIgnoreCase(",") - || uid.equalsIgnoreCase("[]")) - specList.add(new SpecViewModel(null, uid)); - else if (uid != "") - specList.add(new SpecViewModel(uid, uid)); - }) - ); - - return specList; - } - - /** - * this method is used to do fuzzy resolve - * "*" will be added at the end of uid for method for xerf service resolve purpose - */ - String resolveUidFromReference(String linkContent, LookupContext lookupContext) { - String uid = ""; - Matcher matcher = XREF_LINK_RESOLVE_PATTERN.matcher(linkContent); - - if (matcher.find()) { - String className = matcher.group("class"); - String memberName = matcher.group("member"); - uid = resolveUidByLookup(className, lookupContext); - if (!uid.isEmpty()) { - uid = uid.concat(".").concat(memberName); - - // linkContent targets a method - if (!StringUtils.isBlank(matcher.group(3))) { - uid = uid.concat("*"); - } - } - } - return uid; - } - - String resolveUidByLookup(String signature, LookupContext lookupContext) { - if (StringUtils.isBlank(signature) || lookupContext == null) { - return ""; - } - return lookupContext.containsKey(signature) ? lookupContext.resolve(signature) : ""; - } + if (packageVersions.isEmpty()) return ""; + + ApiVersion recommended = ApiVersion.getRecommended(packageVersions.keySet()); + return packageVersions.get(recommended).toString(); + }); + + for (PackageElement element : organizedPackagesWithoutStubs.get(PackageGroup.VISIBLE)) { + tocFile.addTocItem(buildPackage(element)); + } + + ImmutableList olderPackages = + organizedPackagesWithoutStubs.get(PackageGroup.OLDER_AND_PRERELEASE); + if (!olderPackages.isEmpty()) { + TocItem older = new TocItem(OLDER_AND_PRERELEASE, OLDER_AND_PRERELEASE, null); + for (PackageElement element : olderPackages) { + 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 if disableLibraryOverview=true + if (disableLibraryOverview) { + 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); + + TocItem packageTocItem = new TocItem(packageUid, packageUid, packageStatus); + + // New package overview + TocItem packageSummary = new TocItem(packageUid, "Package summary", packageUid + ".md", true); + packageTocItem.getItems().add(packageSummary); + packageOverviewFiles.add( + packageBuilder.buildPackageOverviewFile( + element, repoMetadata, artifactVersion, recommendedPackage)); + + // build classes/interfaces/enums/exceptions/annotations + packageTocItem + .getItems() + .addAll(classBuilder.buildFilesForPackage(element, classMetadataFiles, repoMetadata)); + + // build stubs + TocItem stubPackagesItem = new TocItem("Stub packages", "Stub packages", ""); + packageLookup + .findStubPackages(element, allPackages) + .forEach((PackageElement stub) -> stubPackagesItem.getItems().add(buildPackage(stub))); + if (!stubPackagesItem.getItems().isEmpty()) { + packageTocItem.getItems().add(stubPackagesItem); + } + + return packageTocItem; + } + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocFxDoclet.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocFxDoclet.java index 068c7bcd..d7e6895f 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocFxDoclet.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocFxDoclet.java @@ -1,142 +1,240 @@ package com.microsoft.doclet; import com.microsoft.build.YmlFilesBuilder; +import java.util.*; +import javax.lang.model.SourceVersion; +import javax.tools.Diagnostic.Kind; import jdk.javadoc.doclet.Doclet; import jdk.javadoc.doclet.DocletEnvironment; import jdk.javadoc.doclet.Reporter; import org.apache.commons.lang3.StringUtils; -import javax.lang.model.SourceVersion; -import javax.tools.Diagnostic.Kind; -import java.util.*; - public class DocFxDoclet implements Doclet { - private Reporter reporter; - - @Override - public void init(Locale locale, Reporter reporter) { - reporter.print(Kind.NOTE, "Doclet using locale: " + locale); - this.reporter = reporter; - } - - @Override - public boolean run(DocletEnvironment environment) { - reporter.print(Kind.NOTE, "Output path: " + outputPath); - reporter.print(Kind.NOTE, "Excluded packages: " + Arrays.toString(excludePackages)); - reporter.print(Kind.NOTE, "Excluded classes: " + Arrays.toString(excludeClasses)); - reporter.print(Kind.NOTE, "Project Name: " + projectName); + private Reporter reporter; - return (new YmlFilesBuilder(environment, outputPath, excludePackages, excludeClasses, projectName)).build(); - } + @Override + public void init(Locale locale, Reporter reporter) { + reporter.print(Kind.NOTE, "Doclet using locale: " + locale); + this.reporter = reporter; + } - @Override - public String getName() { - return "DocFxDoclet"; + @Override + public boolean run(DocletEnvironment environment) { + if (repoMetadataFilePath == null) { + repoMetadataFilePath = System.getenv("repoMetadataFilePath"); } - - private String outputPath; - private String[] excludePackages = {}; - private String[] excludeClasses = {}; - private String projectName; - - @Override - public Set getSupportedOptions() { - Option[] options = { - new CustomOption("Output path", Arrays.asList("-outputpath", "--output-path", "-d"), "path") { - @Override - public boolean process(String option, List arguments) { - outputPath = arguments.get(0); - return true; - } - }, - new CustomOption("Exclude packages", Arrays.asList("-excludepackages", "--exclude-packages", "-ep"), - "packages") { - @Override - public boolean process(String option, List arguments) { - excludePackages = StringUtils.split(arguments.get(0), ":"); - return true; - } - }, - new CustomOption("Exclude classes", Arrays.asList("-excludeclasses", "--exclude-classes", "-ec"), - "classes") { - @Override - public boolean process(String option, List arguments) { - excludeClasses = StringUtils.split(arguments.get(0), ":"); - return true; - } - }, - new CustomOption( - "Project name", Arrays.asList("-projectname", "--project-name", "-pn"), "name") { - @Override - public boolean process(String option, List arguments) { - // using artifact id as projectName - remove "-parent" since generation runs in parent pom - projectName = arguments.get(0).replaceAll("-parent", ""); - return true; - } - }, - // Support next properties for compatibility with Gradle javadoc task. - // According to javadoc spec - these properties used by StandardDoclet and used only when - // 'doclet' parameter not populated. But Gradle javadoc not align with this rule and - // passes them in spite of 'doclet' parameter existence - new FakeOptionForCompatibilityWithStandardDoclet("Fake support of doctitle property", "-doctitle"), - new FakeOptionForCompatibilityWithStandardDoclet("Fake support of windowtitle property", "-windowtitle") - }; - return new HashSet<>(Arrays.asList(options)); + if (artifactVersion == null) { + artifactVersion = System.getenv("artifactVersion"); } - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); + if (librariesBomVersion == null) { + librariesBomVersion = System.getenv("librariesBomVersion"); } - abstract static class CustomOption implements Option { - - private final String description; - private final List names; - private final String parameters; - - public CustomOption(String description, List names, String parameters) { - this.description = description; - this.names = names; - this.parameters = parameters; + Objects.requireNonNull(repoMetadataFilePath, "repoMetadataFilePath must not be null."); + + reporter.print(Kind.NOTE, "artifactVersion: " + artifactVersion); + reporter.print(Kind.NOTE, "librariesBomVersion: " + librariesBomVersion); + reporter.print(Kind.NOTE, "repoMetadataFilePath: " + repoMetadataFilePath); + reporter.print(Kind.NOTE, "Output path: " + outputPath); + reporter.print(Kind.NOTE, "Excluded packages: " + Arrays.toString(excludePackages)); + reporter.print(Kind.NOTE, "Excluded classes: " + Arrays.toString(excludeClasses)); + reporter.print(Kind.NOTE, "Project name: " + projectName); + reporter.print(Kind.NOTE, "Disable changelog: " + disableChangelog); + reporter.print(Kind.NOTE, "Disable libraryOverview: " + disableLibraryOverview); + + return (new YmlFilesBuilder( + environment, + outputPath, + excludePackages, + excludeClasses, + projectName, + disableChangelog, + disableLibraryOverview, + artifactVersion, + librariesBomVersion, + repoMetadataFilePath)) + .build(); + } + + @Override + public String getName() { + return "DocFxDoclet"; + } + + private String outputPath; + private String[] excludePackages = {}; + private String[] excludeClasses = {}; + private String projectName; + private boolean disableChangelog; + private boolean disableLibraryOverview; + private String artifactVersion; + private String librariesBomVersion; + private String repoMetadataFilePath; + + @Override + public Set getSupportedOptions() { + Option[] options = { + new CustomOption("Output path", Arrays.asList("-outputpath", "--output-path", "-d"), "path") { + @Override + public boolean process(String option, List arguments) { + outputPath = arguments.get(0); + return true; } - + }, + new CustomOption( + "Exclude packages", + Arrays.asList("-excludepackages", "--exclude-packages", "-ep"), + "packages") { @Override - public int getArgumentCount() { - return 1; + public boolean process(String option, List arguments) { + excludePackages = StringUtils.split(arguments.get(0), ":"); + return true; } - + }, + new CustomOption( + "Exclude classes", + Arrays.asList("-excludeclasses", "--exclude-classes", "-ec"), + "classes") { @Override - public String getDescription() { - return description; + public boolean process(String option, List arguments) { + excludeClasses = StringUtils.split(arguments.get(0), ":"); + return true; } - + }, + new CustomOption( + "Project name", Arrays.asList("-projectname", "--project-name", "-pn"), "name") { @Override - public Kind getKind() { - return Kind.STANDARD; + public boolean process(String option, List arguments) { + // using artifact id as projectName - remove "-parent" since generation runs in parent + // pom + projectName = arguments.get(0).replaceAll("-parent", ""); + return true; } - + }, + new CustomOption( + "Disable changelog", + Arrays.asList("-disable-changelog", "--disable-changelog"), + "disableChangelog") { @Override - public List getNames() { - return names; + public boolean process(String option, List arguments) { + if (arguments.get(0).equalsIgnoreCase("false")) { + disableChangelog = false; + } else { + disableChangelog = true; + } + return true; } - + }, + new CustomOption( + "Disable libraryOverview", + Arrays.asList("-disable-libraryOverview", "--disable-libraryOverview"), + "disablelibraryOverview") { @Override - public String getParameters() { - return parameters; + public boolean process(String option, List arguments) { + if (arguments.get(0).equalsIgnoreCase("false")) { + disableLibraryOverview = false; + } else { + disableLibraryOverview = true; + } + return true; } - } - - static class FakeOptionForCompatibilityWithStandardDoclet extends CustomOption { - - public FakeOptionForCompatibilityWithStandardDoclet(String description, String name) { - super(description, Collections.singletonList(name), "none"); + }, + new CustomOption( + "Artifact Version", + Arrays.asList("-artifactVersion", "--artifactVersion"), + "artifactVersion") { + @Override + public boolean process(String option, List arguments) { + artifactVersion = arguments.get(0); + return true; } - + }, + new CustomOption( + "libraries-bom Version", + Arrays.asList("-librariesBomVersion", "--librariesBomVersion"), + "librariesBomVersion") { + @Override + public boolean process(String option, List arguments) { + librariesBomVersion = arguments.get(0); + return true; + } + }, + new CustomOption( + "repo-metadata.json File Path", + Arrays.asList("-repoMetadataFilePath", "--repoMetadataFilePath"), + "repoMetadataFilePath") { @Override public boolean process(String option, List arguments) { - return true; + repoMetadataFilePath = arguments.get(0); + return true; } + }, + + // Support next properties for compatibility with Gradle javadoc task. + // According to javadoc spec - these properties used by StandardDoclet and used only when + // 'doclet' parameter not populated. But Gradle javadoc not align with this rule and + // passes them in spite of 'doclet' parameter existence + new FakeOptionForCompatibilityWithStandardDoclet( + "Fake support of doctitle property", "-doctitle"), + new FakeOptionForCompatibilityWithStandardDoclet( + "Fake support of windowtitle property", "-windowtitle") + }; + return new HashSet<>(Arrays.asList(options)); + } + + @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + abstract static class CustomOption implements Option { + + private final String description; + private final List names; + private final String parameters; + + public CustomOption(String description, List names, String parameters) { + this.description = description; + this.names = names; + this.parameters = parameters; + } + + @Override + public int getArgumentCount() { + return 1; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public Kind getKind() { + return Kind.STANDARD; + } + + @Override + public List getNames() { + return names; + } + + @Override + public String getParameters() { + return parameters; + } + } + + static class FakeOptionForCompatibilityWithStandardDoclet extends CustomOption { + + public FakeOptionForCompatibilityWithStandardDoclet(String description, String name) { + super(description, Collections.singletonList(name), "none"); + } + + @Override + public boolean process(String option, List arguments) { + return true; } + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocletRunner.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocletRunner.java index 9dc8c719..e2a4af8f 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocletRunner.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/doclet/DocletRunner.java @@ -1,27 +1,69 @@ package com.microsoft.doclet; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableList; import com.microsoft.util.OptionsFileUtil; - +import java.util.ArrayList; +import java.util.List; import javax.tools.ToolProvider; /** - * To use runner just pass as commandline param to main method: - * - name of file with doclet name amd params - *

- * For example: java DocletRunner src\test\resources\test-doclet-params.txt + * To use runner just pass as commandline param to main method: - name of file with doclet name, + * parameter file, and argument file. + * + *

For example: java DocletRunner $HOME/java-aiplatform/target/site/apidocs/options + * $HOME/java-aiplatform/target/site/apidocs/argfile */ public class DocletRunner { - public static void main(final String[] args) { - if (args.length != 1) { - System.err.println("Usage: java DocletRunner "); - return; - } - if (!(new java.io.File(args[0])).isFile()) { - System.err.println(String.format("File '%s' does not exist", args[0])); - return; - } - - ToolProvider.getSystemDocumentationTool().run(null, null, null, OptionsFileUtil.processOptionsFile(args[0])); + public static void main(final String[] args) { + if (args.length < 1) { + System.err.println("Usage: java DocletRunner "); + return; + } + + run( + args, + new EnvironmentToArgumentsBuilder() + .addIfExists("artifactVersion") + .addIfExists("librariesBomVersion") + .addIfExists("repoMetadataFilePath") + .build()); + } + + @VisibleForTesting + static void run(final String[] args, List env) { + List combined = new ArrayList<>(env); + for (String arg : args) { + if (!(new java.io.File(arg)).isFile()) { + System.err.println(String.format("File '%s' does not exist", args[0])); + } + combined.addAll(OptionsFileUtil.processOptionsFile(arg)); + } + ToolProvider.getSystemDocumentationTool() + .run(null, null, null, combined.toArray(new String[0])); + } + + @VisibleForTesting + static class EnvironmentToArgumentsBuilder { + private final ImmutableList.Builder env = new ImmutableList.Builder<>(); + + public EnvironmentToArgumentsBuilder addIfExists(String name) { + String value = System.getenv(name); + if (value != null) { + return add(name, value); + } + return this; + } + + @VisibleForTesting + EnvironmentToArgumentsBuilder add(String name, String value) { + env.add("-" + name, value); + return this; + } + + public ImmutableList build() { + return env.build(); } + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java index 7084318f..627d58f2 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/BaseLookup.java @@ -1,230 +1,429 @@ package com.microsoft.lookup; import com.microsoft.lookup.model.ExtendedMetadataFileItem; -import com.microsoft.model.*; +import com.microsoft.model.ExceptionItem; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.MethodParameter; +import com.microsoft.model.Return; +import com.microsoft.model.TypeParameter; import com.microsoft.util.YamlUtil; +import com.sun.source.doctree.DeprecatedTree; import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.LinkTree; import com.sun.source.doctree.LiteralTree; +import com.sun.source.doctree.SeeTree; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import javax.annotation.Nullable; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; import jdk.javadoc.doclet.DocletEnvironment; import org.apache.commons.lang3.RegExUtils; import org.apache.commons.lang3.StringUtils; - -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; +import org.apache.commons.text.StringEscapeUtils; public abstract class BaseLookup { - protected final Map elementKindLookup = new HashMap<>() {{ - put(ElementKind.PACKAGE, "Namespace"); - put(ElementKind.CLASS, "Class"); - put(ElementKind.ENUM, "Enum"); - put(ElementKind.ENUM_CONSTANT, "Field"); - put(ElementKind.INTERFACE, "Interface"); - put(ElementKind.ANNOTATION_TYPE, "Interface"); - put(ElementKind.CONSTRUCTOR, "Constructor"); - put(ElementKind.METHOD, "Method"); - put(ElementKind.FIELD, "Field"); - }}; - - protected Map map = new HashMap<>(); - protected final DocletEnvironment environment; - - protected BaseLookup(DocletEnvironment environment) { - this.environment = environment; - } - - protected ExtendedMetadataFileItem resolve(T key) { - ExtendedMetadataFileItem value = map.get(key); - if (value == null) { - value = buildMetadataFileItem(key); - map.put(key, value); + private static final int INITIAL_CAPACITY = 500000; + protected final Map elementKindLookup = + new HashMap<>() { + { + put(ElementKind.PACKAGE, "Namespace"); + put(ElementKind.CLASS, "Class"); + put(ElementKind.ENUM, "Enum"); + put(ElementKind.ENUM_CONSTANT, "Field"); + put(ElementKind.INTERFACE, "Interface"); + put(ElementKind.ANNOTATION_TYPE, "Interface"); + put(ElementKind.CONSTRUCTOR, "Constructor"); + put(ElementKind.METHOD, "Method"); + put(ElementKind.FIELD, "Field"); } - return value; - } - - protected abstract ExtendedMetadataFileItem buildMetadataFileItem(T key); - - public String extractPackageName(T key) { - return resolve(key).getPackageName(); - } - - public String extractFullName(T key) { - return resolve(key).getFullName(); - } - - public String extractName(T key) { - return resolve(key).getName(); - } + }; - public String extractHref(T key) { - return resolve(key).getHref(); - } - - public String extractParent(T key) { - return resolve(key).getParent(); - } - - public String extractId(T key) { - return resolve(key).getId(); - } + protected Map map; + protected final DocletEnvironment environment; - public String extractUid(T key) { - return resolve(key).getUid(); - } + protected BaseLookup(DocletEnvironment environment) { + this.environment = environment; + this.map = new HashMap<>(INITIAL_CAPACITY); + } - public String extractNameWithType(T key) { - return resolve(key).getNameWithType(); - } + protected ExtendedMetadataFileItem resolve(T key) { + map.computeIfAbsent(key, this::buildMetadataFileItem); + return map.get(key); + } - public String extractMethodContent(T key) { - return resolve(key).getMethodContent(); - } + protected abstract ExtendedMetadataFileItem buildMetadataFileItem(T key); - public String extractFieldContent(T key) { - return resolve(key).getFieldContent(); - } + public String extractPackageName(T key) { + return resolve(key).getPackageName(); + } - public String extractConstructorContent(T key) { - return resolve(key).getConstructorContent(); - } + public String extractFullName(T key) { + return resolve(key).getFullName(); + } - public String extractOverload(T key) { - return resolve(key).getOverload(); - } - - public List extractParameters(T key) { - return resolve(key).getParameters(); - } - - public List extractExceptions(T key) { - return resolve(key).getExceptions(); - } - - public Return extractReturn(T key) { - return resolve(key).getReturn(); - } - - public String extractSummary(T key) { - return resolve(key).getSummary(); - } + public String extractName(T key) { + return resolve(key).getName(); + } - public String extractType(T key) { - return resolve(key).getType(); - } - - public String extractContent(T key) { - return resolve(key).getContent(); - } - - public List extractTypeParameters(T key) { - return resolve(key).getTypeParameters(); - } - - public List extractSuperclass(T key) { - List reversed = resolve(key).getSuperclass(); - Collections.reverse(reversed); - return reversed; - } - - public List extractInheritedMethods(T key) { - List sorted = resolve(key).getInheritedMethods(); - Collections.sort(sorted); - return sorted; - } - - public List extractInterfaces(T key) { - return resolve(key).getInterfaces(); - } - - public String extractTocName(T key) { - return resolve(key).getTocName(); - } - - public Set extractReferences(T key) { - return resolve(key).getReferences(); - } - - public String extractOverridden(T key) { - return resolve(key).getOverridden(); - } - - protected String determineType(T element) { - return elementKindLookup.get(element.getKind()); - } - - protected String determinePackageName(T element) { - return String.valueOf(environment.getElementUtils().getPackageOf(element)); - } - - protected String determineComment(T element) { - return getDocCommentTree(element) - .map(DocCommentTree::getFullBody) - .map(this::replaceLinksAndCodes) - .orElse(null); - } - - /** - *

    - *
  • Replace @link and @linkplain with tags
  • - *
  • Replace @code with tags
  • - *
- */ - String replaceLinksAndCodes(List items) { - return YamlUtil.cleanupHtml(items.stream().map( + public String extractHref(T key) { + return resolve(key).getHref(); + } + + public String extractParent(T key) { + return resolve(key).getParent(); + } + + public String extractId(T key) { + return resolve(key).getId(); + } + + public String extractUid(T key) { + return resolve(key).getUid(); + } + + public String extractNameWithType(T key) { + return resolve(key).getNameWithType(); + } + + public String extractMethodContent(T key) { + return resolve(key).getMethodContent(); + } + + public String extractFieldContent(T key) { + return resolve(key).getFieldContent(); + } + + public String extractConstructorContent(T key) { + return resolve(key).getConstructorContent(); + } + + public String extractOverload(T key) { + return resolve(key).getOverload(); + } + + public List extractParameters(T key) { + return resolve(key).getParameters(); + } + + public List extractExceptions(T key) { + return resolve(key).getExceptions(); + } + + public Return extractReturn(T key) { + return resolve(key).getReturn(); + } + + public String extractSummary(T key) { + return resolve(key).getSummary(); + } + + public String extractType(T key) { + return resolve(key).getType(); + } + + public String extractJavaType(T element) { + return null; + } + + public String extractContent(T key) { + return resolve(key).getContent(); + } + + public List extractTypeParameters(T key) { + return resolve(key).getTypeParameters(); + } + + public List extractSuperclass(T key) { + List reversed = resolve(key).getSuperclass(); + Collections.reverse(reversed); + return reversed; + } + + public List extractInheritedMethods(T key) { + List sorted = resolve(key).getInheritedMethods(); + Collections.sort(sorted); + return sorted; + } + + public List extractInterfaces(T key) { + return resolve(key).getInterfaces(); + } + + public String extractTocName(T key) { + return resolve(key).getTocName(); + } + + public Set extractReferences(T key) { + return resolve(key).getReferences(); + } + + public String extractOverridden(T key) { + return resolve(key).getOverridden(); + } + + protected Optional getDocCommentTree(T element) { + return Optional.ofNullable(environment.getDocTrees().getDocCommentTree(element)); + } + + private boolean hasDeprecatedJavadocTag(T element) { + List javadocTags = + getDocCommentTree(element) + .map(DocCommentTree::getBlockTags) + .orElse(Collections.emptyList()); + + return javadocTags.stream().map(DocTree::getKind).anyMatch(DocTree.Kind.DEPRECATED::equals); + } + + protected String determineType(T element) { + return elementKindLookup.get(element.getKind()); + } + + protected String determinePackageName(T element) { + return String.valueOf(environment.getElementUtils().getPackageOf(element)); + } + + protected String determineComment(T element) { + String statusComment = getStatusComment(element); + String javadocComment = getJavadocComment(element); + return joinNullable(statusComment, javadocComment); + } + + private String getJavadocComment(T element) { + return getDocCommentTree(element) + .map( + tree -> { + String commentWithBlockTags = replaceLinksAndCodes(tree.getFullBody()); + return replaceBlockTags(tree, commentWithBlockTags); + }) + .orElse(null); + } + + /** Safely combine two nullable strings with a newline delimiter */ + String joinNullable(@Nullable String top, @Nullable String bottom) { + String a = top == null || top.isEmpty() ? null : top; + String b = bottom == null || bottom.isEmpty() ? null : bottom; + + if (a != null && b != null) { + return a + "\n\n" + b; + } else if (a != null) { + return a; + } else { + return b; + } + } + + /** Provides support for deprecated and see tags */ + String replaceBlockTags(DocCommentTree docCommentTree, String comment) { + Set seeItems = new HashSet<>(); + String commentWithBlockTags = comment; + for (DocTree blockTag : docCommentTree.getBlockTags()) { + switch (blockTag.getKind()) { + case DEPRECATED: + commentWithBlockTags = getDeprecatedSummary((DeprecatedTree) blockTag).concat(comment); + break; + case SEE: + seeItems.add(getSeeTagRef((SeeTree) blockTag)); + break; + default: + } + } + if (!seeItems.isEmpty()) { + commentWithBlockTags = commentWithBlockTags.concat(getSeeAlsoSummary(seeItems)); + } + return commentWithBlockTags; + } + + /** + *
    + *
  • Replace @link and @linkplain with tags
  • + *
  • Replace @code with tags
  • + *
+ */ + String replaceLinksAndCodes(List items) { + return YamlUtil.cleanupHtml( + items.stream() + .map( bodyItem -> { - switch (bodyItem.getKind()) { - case LINK: - case LINK_PLAIN: - return buildXrefTag((LinkTree) bodyItem); - case CODE: - return buildCodeTag((LiteralTree) bodyItem); - case LITERAL: - return expandLiteralBody((LiteralTree) bodyItem); - default: - return String.valueOf(bodyItem); - } - } - ).collect(Collectors.joining())); - } - - /** - * By using this way of processing links we provide support of @links with label, like this: {@link List someLabel} - */ - String buildXrefTag(LinkTree linkTree) { - String signature = linkTree.getReference().getSignature(); - String label = linkTree.getLabel().stream().map(String::valueOf).collect(Collectors.joining(" ")); - if (StringUtils.isEmpty(label)) { - label = signature; - } - return String.format("%s", signature, label); - } - - String buildCodeTag(LiteralTree literalTree) { - return String.format("%s", literalTree.getBody()); - } - - String expandLiteralBody(LiteralTree bodyItem) { - return String.valueOf(bodyItem.getBody()); - } - - protected Optional getDocCommentTree(T element) { - return Optional.ofNullable(environment.getDocTrees().getDocCommentTree(element)); - } - - /** - * We make type shortening in assumption that package name doesn't contain uppercase characters - */ - public String makeTypeShort(String value) { - if (!value.contains(".")) { - return value; - } - return Stream.of(StringUtils.split(value, "<")) - .map(s -> RegExUtils.removeAll(s, "\\b[a-z0-9_.]+\\.")) - .collect(Collectors.joining("<")); - } + switch (bodyItem.getKind()) { + case LINK: + case LINK_PLAIN: + return buildXrefTag((LinkTree) bodyItem); + case CODE: + return buildCodeTag((LiteralTree) bodyItem); + case LITERAL: + return expandLiteralBody((LiteralTree) bodyItem); + default: + return String.valueOf(StringEscapeUtils.unescapeJava(bodyItem.toString())); + } + }) + .collect(Collectors.joining())); + } + + /** + * By using this way of processing links we provide support of @links with label, like this: + * {@link List someLabel} + */ + String buildXrefTag(LinkTree linkTree) { + String signature = linkTree.getReference().getSignature(); + String label = + linkTree.getLabel().stream().map(String::valueOf).collect(Collectors.joining(" ")); + if (StringUtils.isEmpty(label)) { + label = signature; + } + return String.format( + "%s", signature, label); + } + + String buildCodeTag(LiteralTree literalTree) { + return String.format( + "%s", StringEscapeUtils.unescapeJava(literalTree.getBody().toString())); + } + + String expandLiteralBody(LiteralTree bodyItem) { + return String.valueOf(StringEscapeUtils.unescapeJava(bodyItem.getBody().toString())); + } + + /** + * We make type shortening in assumption that package name doesn't contain uppercase characters + */ + public String makeTypeShort(String value) { + if (!value.contains(".")) { + return value; + } + return Stream.of(StringUtils.split(value, "<")) + .map(s -> RegExUtils.removeAll(s, "\\b[a-z0-9_.]+\\.")) + .collect(Collectors.joining("<")); + } + + private String getSeeAlsoSummary(Set seeItems) { + return String.format("\nSee Also: %s\n", String.join(", ", seeItems)); + } + + private String getDeprecatedSummary(DeprecatedTree deprecatedTree) { + return String.format( + "\nDeprecated. %s\n\n", + replaceLinksAndCodes(deprecatedTree.getBody())); + } + + private String getSeeTagRef(SeeTree seeTree) { + String ref = + seeTree.getReference().stream().map(r -> String.valueOf(r)).collect(Collectors.joining("")); + // if it's already a tag, use that otherwise build xref tag + if (ref.matches("^<.+>(.|\n)*")) { + return ref.replaceAll("\n", "").replaceAll("( )+", " "); + } + return String.format( + "%1$s", ref); + } + + public String extractStatus(T element) { + List annotationNames = + element.getAnnotationMirrors().stream() + .map(mirror -> mirror.getAnnotationType().asElement().getSimpleName().toString()) + .collect(Collectors.toList()); + + if (annotationNames.stream().anyMatch("Deprecated"::equals) + || hasDeprecatedJavadocTag(element)) { + return "deprecated"; + } + if (annotationNames.stream().anyMatch("BetaApi"::equals)) { + return "beta"; + } + return null; + } + + public String getStatusComment(T element) { + Map> annotationComments = getAnnotationComments(element); + + // Deprecated comments are determined by the Javadoc @deprecated block tag. + // See this#replaceBlockTags + + List comments = new ArrayList<>(); + if (annotationComments.containsKey("InternalApi")) { + comments.add(createInternalOnlyNotice(annotationComments.get("InternalApi"))); + } + if (annotationComments.containsKey("InternalExtensionOnly")) { + comments.add( + createInternalExtensionOnlyNotice(annotationComments.get("InternalExtensionOnly"))); + } + if (annotationComments.containsKey("ObsoleteApi")) { + comments.add(createObsoleteNotice(annotationComments.get("ObsoleteApi"))); + } + if (annotationComments.containsKey("BetaApi")) { + comments.add(createBetaNotice(annotationComments.get("BetaApi"))); + } + + if (comments.isEmpty()) { + return null; + } + return String.join("\n\n", comments); + } + + private String createBetaNotice(Optional customComment) { + return "\n"; + } + + private String createObsoleteNotice(Optional customComment) { + return "\n"; + } + + private String createInternalExtensionOnlyNotice(Optional customComment) { + return "\n"; + } + + private String createInternalOnlyNotice(Optional customComment) { + return "\n"; + } + + /** + * @return all annotations on the element and their associated comment, if it exists + */ + public Map> getAnnotationComments(T element) { + Map> annotationComments = new HashMap<>(); + + for (AnnotationMirror annotation : element.getAnnotationMirrors()) { + String name = annotation.getAnnotationType().asElement().getSimpleName().toString(); + Optional value = + annotation.getElementValues().entrySet().stream() + .filter(entry -> entry.getKey().getSimpleName().toString().equals("value")) + .map(Map.Entry::getValue) + .map(annotationValue -> annotationValue.getValue().toString()) + .findFirst(); + + annotationComments.put(name, value); + } + + return annotationComments; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java index 009b67dd..6f60ae2c 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassItemsLookup.java @@ -5,36 +5,49 @@ import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; import com.microsoft.util.CommentHelper; +import com.microsoft.util.ElementUtil; import com.microsoft.util.Utils; -import com.sun.source.doctree.*; +import com.sun.source.doctree.DocCommentTree; +import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree.Kind; -import jdk.javadoc.doclet.DocletEnvironment; - -import javax.lang.model.element.*; -import javax.lang.model.type.TypeKind; +import com.sun.source.doctree.ParamTree; +import com.sun.source.doctree.ReturnTree; +import com.sun.source.doctree.ThrowsTree; import java.util.ArrayList; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.VariableElement; +import javax.lang.model.type.TypeKind; +import jdk.javadoc.doclet.DocletEnvironment; public class ClassItemsLookup extends BaseLookup { - private Utils utils; + private Utils utils; - public ClassItemsLookup(DocletEnvironment environment) { - super(environment); - utils = new Utils(environment); - } + public ClassItemsLookup(DocletEnvironment environment, ElementUtil elementUtil) { + super(environment); + utils = new Utils(environment, elementUtil); + } + + @Override + protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { + String packageName = determinePackageName(element); + TypeElement classElement = (TypeElement) element.getEnclosingElement(); + String classQName = String.valueOf(classElement.getQualifiedName()); + String elementQName = String.valueOf(element); + String classQNameWithGenericsSupport = String.valueOf(classElement.asType()); + String classSNameWithGenericsSupport = + classQNameWithGenericsSupport.replace(packageName.concat("."), ""); + String uid = String.format("%s.%s", classQName, elementQName); - @Override - protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { - String packageName = determinePackageName(element); - TypeElement classElement = (TypeElement) element.getEnclosingElement(); - String classQName = String.valueOf(classElement.getQualifiedName()); - String elementQName = String.valueOf(element); - String classQNameWithGenericsSupport = String.valueOf(classElement.asType()); - String classSNameWithGenericsSupport = classQNameWithGenericsSupport.replace(packageName.concat("."), ""); - String uid = String.format("%s.%s", classQName, elementQName); - - ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(uid) {{ + ExtendedMetadataFileItem result = + new ExtendedMetadataFileItem(uid) { + { setId(elementQName); setParent(classQName); setHref(classQName + ".yml"); @@ -42,159 +55,202 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { setType(determineType(element)); setPackageName(packageName); setSummary(determineComment(element)); - }}; - - String modifiers = element.getModifiers().stream().map(String::valueOf).collect(Collectors.joining(" ")); - if (element instanceof ExecutableElement) { - ExecutableElement exeElement = (ExecutableElement) element; - List parameters = extractParameters(exeElement); - String paramsString = parameters.stream() - .map(parameter -> String.format("%s %s", makeTypeShort(parameter.getType()), parameter.getId())) - .collect(Collectors.joining(", ")); - String nameWithoutBrackets = elementQName.replaceAll("\\(.*\\)", ""); - String methodName = String.format("%s(%s)", nameWithoutBrackets, paramsString); - - result.setName(methodName); - result.setMethodContent(String.format("%s %s %s", modifiers, - makeTypeShort(String.valueOf(exeElement.getReturnType())), result.getName())); - result.setConstructorContent(String.format("%s %s", modifiers, result.getName())); - result.setParameters(parameters); - result.setExceptions(extractExceptions(exeElement)); - result.setReturn(extractReturn(exeElement)); - if (exeElement.getKind() == ElementKind.METHOD) { - result.setOverridden(extractOverriddenUid(utils.overriddenMethod(exeElement))); - result.setSummary(getInheritedInlineCommentString(exeElement)); - } - } - result.setNameWithType(String.format("%s.%s", classSNameWithGenericsSupport, result.getName())); - result.setFullName(String.format("%s.%s", classQNameWithGenericsSupport, result.getName())); - result.setOverload(convertFullNameToOverload(result.getFullName())); - - if (element instanceof VariableElement) { - String type = makeTypeShort(String.valueOf(element.asType())); - result.setFieldContent(String.format("%s %s %s", modifiers, type, elementQName)); - result.setReturn(extractReturn((VariableElement) element)); - } - - return result; - } + } + }; - public String extractDeprecatedDescription(Element element) { - return getDocCommentTree(element).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == DocTree.Kind.DEPRECATED) - .map(o -> (DeprecatedTree) o) - .map(o -> replaceLinksAndCodes(o.getBody())) - .findFirst().orElse(null) - ).orElse(null); - } + String modifiers = + element.getModifiers().stream().map(String::valueOf).collect(Collectors.joining(" ")); + if (element instanceof ExecutableElement) { + ExecutableElement exeElement = (ExecutableElement) element; + List parameters = extractParameters(exeElement); + String paramsString = + parameters.stream() + .map( + parameter -> + String.format("%s %s", makeTypeShort(parameter.getType()), parameter.getId())) + .collect(Collectors.joining(", ")); + String nameWithoutBrackets = elementQName.replaceAll("\\(.*\\)", ""); + String methodName = String.format("%s(%s)", nameWithoutBrackets, paramsString); - List extractParameters(ExecutableElement element) { - return element.getParameters().stream().map(o -> { - String paramName = String.valueOf(o.getSimpleName()); - String paramType = String.valueOf(o.asType()); - return new MethodParameter(paramName, paramType, extractParameterDescription(element, paramName)); - }).collect(Collectors.toList()); + result.setName(methodName); + result.setMethodContent( + String.format( + "%s %s %s", + modifiers, + makeTypeShort(String.valueOf(exeElement.getReturnType())), + result.getName())); + result.setConstructorContent(String.format("%s %s", modifiers, result.getName())); + result.setParameters(parameters); + result.setExceptions(extractExceptions(exeElement)); + result.setReturn(extractReturn(exeElement)); + if (exeElement.getKind() == ElementKind.METHOD) { + result.setOverridden(extractOverriddenUid(utils.overriddenMethod(exeElement))); + result.setSummary(determineComment(exeElement)); + } } + result.setNameWithType(String.format("%s.%s", classSNameWithGenericsSupport, result.getName())); + result.setFullName(String.format("%s.%s", classQNameWithGenericsSupport, result.getName())); + result.setOverload(convertFullNameToOverload(result.getFullName())); - String extractParameterDescription(ExecutableElement method, String paramName) { - return getDocCommentTree(method).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.PARAM) - .map(o -> (ParamTree) o) - .filter(o -> paramName.equals(String.valueOf(o.getName()))) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) - ).orElse(null); + if (element instanceof VariableElement) { + String type = makeTypeShort(String.valueOf(element.asType())); + result.setFieldContent(String.format("%s %s %s", modifiers, type, elementQName)); + result.setReturn(extractReturn((VariableElement) element)); } - List extractExceptions(ExecutableElement methodElement) { - return methodElement.getThrownTypes().stream().map(o -> { - String exceptionType = String.valueOf(o); - return new ExceptionItem(exceptionType, extractExceptionDescription(methodElement)); - }).collect(Collectors.toList()); - } + return result; + } - String extractExceptionDescription(ExecutableElement methodElement) { - return getDocCommentTree(methodElement).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.THROWS) - .map(o -> (ThrowsTree) o) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) - ).orElse(null); - } + List extractParameters(ExecutableElement element) { + return element.getParameters().stream() + .map( + o -> { + String paramName = String.valueOf(o.getSimpleName()); + String paramType = String.valueOf(o.asType()); + return new MethodParameter( + paramName, paramType, extractParameterDescription(element, paramName)); + }) + .collect(Collectors.toList()); + } + + String extractParameterDescription(ExecutableElement method, String paramName) { + return getDocCommentTree(method) + .map( + docTree -> + docTree.getBlockTags().stream() + .filter(o -> o.getKind() == Kind.PARAM) + .map(o -> (ParamTree) o) + .filter(o -> paramName.equals(String.valueOf(o.getName()))) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst() + .orElse(null)) + .orElse(null); + } + + List extractExceptions(ExecutableElement methodElement) { + return methodElement.getThrownTypes().stream() + .map( + o -> { + String exceptionType = String.valueOf(o); + return new ExceptionItem(exceptionType, extractExceptionDescription(methodElement)); + }) + .collect(Collectors.toList()); + } - Return extractReturn(ExecutableElement methodElement) { - if (methodElement.getReturnType().getKind() == TypeKind.VOID) { - return null; - } - return new Return(String.valueOf(methodElement.getReturnType()), extractReturnDescription(methodElement)); + String extractExceptionDescription(ExecutableElement methodElement) { + return getDocCommentTree(methodElement) + .map( + docTree -> + docTree.getBlockTags().stream() + .filter(o -> o.getKind() == Kind.THROWS) + .map(o -> (ThrowsTree) o) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst() + .orElse(null)) + .orElse(null); + } + + Return extractReturn(ExecutableElement methodElement) { + if (methodElement.getReturnType().getKind() == TypeKind.VOID) { + return null; } + return new Return( + String.valueOf(methodElement.getReturnType()), extractReturnDescription(methodElement)); + } + + String extractReturnDescription(ExecutableElement methodElement) { + return getDocCommentTree(methodElement) + .map( + docTree -> + docTree.getBlockTags().stream() + .filter(o -> o.getKind() == Kind.RETURN) + .map(o -> (ReturnTree) o) + .map(o -> replaceLinksAndCodes(o.getDescription())) + .findFirst() + .orElse(null)) + .orElse(null); + } - String extractReturnDescription(ExecutableElement methodElement) { - return getDocCommentTree(methodElement).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == Kind.RETURN) - .map(o -> (ReturnTree) o) - .map(o -> replaceLinksAndCodes(o.getDescription())) - .findFirst().orElse(null) - ).orElse(null); + Return extractReturn(VariableElement fieldElement) { + return new Return(String.valueOf(fieldElement.asType())); + } + + String convertFullNameToOverload(String fullName) { + return fullName.replaceAll("\\(.*\\)", "*"); + } + + String extractOverriddenUid(ExecutableElement ovr) { + if (ovr != null) { + TypeElement te = utils.getEnclosingTypeElement(ovr); + String uid = te.getQualifiedName().toString().concat(".") + String.valueOf(ovr); + return uid; } - Return extractReturn(VariableElement fieldElement) { - return new Return(String.valueOf(fieldElement.asType())); + return ""; + } + + private String determineComment(ExecutableElement methodElement) { + String inheritedInlineComment = getInheritedInlineCommentString(methodElement); + Optional docCommentTree = getDocCommentTree(methodElement); + if (docCommentTree.isPresent()) { + inheritedInlineComment = replaceBlockTags(docCommentTree.get(), inheritedInlineComment); } + return joinNullable(getStatusComment(methodElement), inheritedInlineComment); + } - String convertFullNameToOverload(String fullName) { - return fullName.replaceAll("\\(.*\\)", "*"); + /** + * If the item being inherited from is declared from external compiled package, or is declared in + * the packages like java.lang.Object, comments may be not available as doclet resolves from byte + * code. + */ + private String getInheritedInlineCommentString(ExecutableElement exeElement) { + CommentHelper ch = getInheritedInlineTags(new CommentHelper(exeElement, utils)); + // Remove unresolved "@inheritDoc" tag. + List dctree = utils.removeBlockTag(ch.inlineTags, DocTree.Kind.INHERIT_DOC); + return replaceLinksAndCodes(dctree); + } + + private CommentHelper getInheritedInlineTags(CommentHelper input) { + CommentHelper output = input.copy(); + if (!output.hasInheritDocTag() && !output.isSimpleOverride()) { + return output; } - String extractOverriddenUid(ExecutableElement ovr) { - if (ovr != null) { - TypeElement te = utils.getEnclosingTypeElement(ovr); - String uid = te.getQualifiedName().toString().concat(".") + String.valueOf(ovr); - return uid; - } + CommentHelper inheritedSearchInput = input.copy(); + ExecutableElement overriddenMethod = utils.overriddenMethod((ExecutableElement) input.element); - return ""; + if (overriddenMethod != null) { + inheritedSearchInput.element = overriddenMethod; + CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); + if (!ch.isSimpleOverride()) { + output = output.inherit(ch); + } } - /** - * If the item being inherited from is declared from external compiled package, - * or is declared in the packages like java.lang.Object, - * comments may be not available as doclet resolves from byte code. - */ - String getInheritedInlineCommentString(ExecutableElement exeElement) { - CommentHelper ch = getInheritedInlineTags(new CommentHelper(exeElement, utils)); - // Remove unresolved "@inheritDoc" tag. - List dctree = utils.removeBlockTag(ch.inlineTags, DocTree.Kind.INHERIT_DOC); - return replaceLinksAndCodes(dctree); + TypeElement encl = utils.getEnclosingTypeElement(input.element); + List implementedMethods = + utils.getImplementedMethods(input.element.toString(), encl, new ArrayList()); + for (Element implementedMethod : implementedMethods) { + inheritedSearchInput.element = implementedMethod; + CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); + if (!ch.isSimpleOverride()) { + output = output.inherit(ch); + } } - CommentHelper getInheritedInlineTags(CommentHelper input) { - CommentHelper output = input.copy(); - if (!output.hasInheritDocTag() && !output.isSimpleOverride()) { - return output; - } - - CommentHelper inheritedSearchInput = input.copy(); - ExecutableElement overriddenMethod = utils.overriddenMethod((ExecutableElement) input.element); - - if (overriddenMethod != null) { - inheritedSearchInput.element = overriddenMethod; - CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); - if (!ch.isSimpleOverride()) { - output = output.inherit(ch); - } - } - - TypeElement encl = utils.getEnclosingTypeElement(input.element); - List implementedMethods = utils.getImplementedMethods(input.element.toString(), encl, new ArrayList()); - for (Element implementedMethod : implementedMethods) { - inheritedSearchInput.element = implementedMethod; - CommentHelper ch = getInheritedInlineTags(inheritedSearchInput); - if (!ch.isSimpleOverride()) { - output = output.inherit(ch); - } - } - - return output; + return output; + } + + public String extractJavaType(Element element) { + if (element.getModifiers().contains(Modifier.STATIC)) { + if (element.getKind().equals(ElementKind.METHOD)) { + return "static method"; + } + if (element.getKind().equals(ElementKind.FIELD) + || element.getKind().equals(ElementKind.ENUM_CONSTANT)) { + return "static field"; + } } + return null; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java index 406a3d6f..ef6a70e0 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/ClassLookup.java @@ -2,220 +2,241 @@ import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.MetadataFileItem; -import com.microsoft.model.Status; import com.microsoft.model.TypeParameter; +import com.microsoft.util.ElementUtil; import com.microsoft.util.Utils; -import com.sun.source.doctree.DeprecatedTree; -import com.sun.source.doctree.DocTree; -import jdk.javadoc.doclet.DocletEnvironment; -import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; - +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; -import java.util.*; -import java.util.stream.Collectors; +import jdk.javadoc.doclet.DocletEnvironment; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; public class ClassLookup extends BaseLookup { - private static final String JAVA_LANG_OBJECT = "java.lang.Object"; - - public ClassLookup(DocletEnvironment environment) { - super(environment); - } - - @Override - protected ExtendedMetadataFileItem buildMetadataFileItem(TypeElement classElement) { - List inheritedMethods = new ArrayList<>(); - - String packageName = determinePackageName(classElement); - String classQName = String.valueOf(classElement.getQualifiedName()); - String classSName = String.valueOf(classElement.getSimpleName()); - String classQNameWithGenericsSupport = String.valueOf(classElement.asType()); - String classSNameWithGenericsSupport = classQNameWithGenericsSupport.replace(packageName.concat("."), ""); - - ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(classQName); - result.setId(classSName); - result.setParent(packageName); - result.setHref(classQName + ".yml"); - result.setName(classSNameWithGenericsSupport); - result.setNameWithType(classSNameWithGenericsSupport); - result.setFullName(classQNameWithGenericsSupport); - result.setType(determineType(classElement)); - result.setPackageName(packageName); - result.setSummary(determineComment(classElement)); - result.setSuperclass(determineNestedSuperclass(classElement, result, inheritedMethods)); - result.setTypeParameters(determineTypeParameters(classElement)); - result.setInheritedMethods(determineInheritedMembers(inheritedMethods)); - populateContent(classElement, classSNameWithGenericsSupport, result); - result.setTocName(classQName.replace(packageName.concat("."), "")); - return result; + private static final String JAVA_LANG_OBJECT = "java.lang.Object"; + + private final ElementUtil elementUtil; + + public ClassLookup(DocletEnvironment environment, ElementUtil elementUtil) { + super(environment); + this.elementUtil = elementUtil; + } + + @Override + protected ExtendedMetadataFileItem buildMetadataFileItem(TypeElement classElement) { + List inheritedMethods = new ArrayList<>(); + + String packageName = determinePackageName(classElement); + String classQName = String.valueOf(classElement.getQualifiedName()); + String classSName = String.valueOf(classElement.getSimpleName()); + String classQNameWithGenericsSupport = String.valueOf(classElement.asType()); + String classSNameWithGenericsSupport = + classQNameWithGenericsSupport.replace(packageName.concat("."), ""); + + ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(classQName); + result.setId(classSName); + result.setParent(packageName); + result.setHref(classQName + ".yml"); + result.setName(classSNameWithGenericsSupport); + result.setNameWithType(classSNameWithGenericsSupport); + result.setFullName(classQNameWithGenericsSupport); + result.setType(determineType(classElement)); + result.setPackageName(packageName); + result.setSummary(determineComment(classElement)); + result.setSuperclass(determineNestedSuperclass(classElement, result, inheritedMethods)); + result.setTypeParameters(determineTypeParameters(classElement)); + result.setInheritedMethods(determineInheritedMembers(inheritedMethods)); + result.setJavaType(extractJavaType(classElement)); + populateContent(classElement, classSNameWithGenericsSupport, result); + result.setTocName(classQName.replace(packageName.concat("."), "")); + return result; + } + + void populateContent( + TypeElement classElement, + String shortNameWithGenericsSupport, + ExtendedMetadataFileItem container) { + String type = elementKindLookup.get(classElement.getKind()); + String result = + String.format( + "%s %s %s", + classElement.getModifiers().stream() + .map(String::valueOf) + .filter(modifier -> !("Interface".equals(type) && "abstract".equals(modifier))) + .filter( + modifier -> + !("Enum".equals(type) + && ("static".equals(modifier) || "final".equals(modifier)))) + .collect(Collectors.joining(" ")), + StringUtils.lowerCase(type), + shortNameWithGenericsSupport); + + String superclass = determineSuperclass(classElement); + if (superclass != null && !JAVA_LANG_OBJECT.equals(superclass)) { + result += " extends " + makeTypeShort(superclass); + + addSuperclassToReferencesMap(superclass, container); } - public String extractStatus(TypeElement classElement) { - DocTree deprecated = getDocCommentTree(classElement) - .map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == DocTree.Kind.DEPRECATED) - .findFirst().orElse(null) - ).orElse(null); - - if (deprecated != null) { - return Status.DEPRECATED.toString(); - } - return null; + List interfaces = classElement.getInterfaces(); + if (CollectionUtils.isNotEmpty(interfaces)) { + String prefix = + (classElement.getKind() == ElementKind.INTERFACE) ? " extends " : " implements "; + result += + prefix + + interfaces.stream() + .map(String::valueOf) + .map(this::makeTypeShort) + .collect(Collectors.joining(", ")); + + container.setInterfaces( + interfaces.stream().map(String::valueOf).collect(Collectors.toList())); + + addInterfacesToReferencesMap(interfaces, container); } - - public String extractDeprecatedDescription(TypeElement classElement) { - return getDocCommentTree(classElement).map(docTree -> docTree.getBlockTags().stream() - .filter(o -> o.getKind() == DocTree.Kind.DEPRECATED) - .map(o -> (DeprecatedTree) o) - .map(o -> replaceLinksAndCodes(o.getBody())) - .findFirst().orElse(null) - ).orElse(null); + addInheritedMethodsToReferencesMap(container); + container.setContent(result); + } + + void addSuperclassToReferencesMap(String superclass, ExtendedMetadataFileItem container) { + container.addReferences( + Set.of(new MetadataFileItem(superclass, makeTypeShort(superclass), false))); + } + + void addInheritedMethodsToReferencesMap(ExtendedMetadataFileItem container) { + container.addReferences( + container.getInheritedMethods().stream() + .map(o -> new MetadataFileItem(o, makeTypeShort(o), false)) + .collect(Collectors.toSet())); + } + + void addInterfacesToReferencesMap( + List interfaces, ExtendedMetadataFileItem container) { + container.addReferences( + interfaces.stream() + .map(String::valueOf) + .map(o -> new MetadataFileItem(o, makeTypeShort(o), false)) + .collect(Collectors.toSet())); + } + + String determineSuperclass(TypeElement classElement) { + TypeMirror superclass = classElement.getSuperclass(); + if (superclass.getKind() == TypeKind.NONE) { + return null; } + return String.valueOf(superclass); + } - void populateContent(TypeElement classElement, String shortNameWithGenericsSupport, - ExtendedMetadataFileItem container) { - String type = elementKindLookup.get(classElement.getKind()); - String result = String.format("%s %s %s", - classElement.getModifiers().stream().map(String::valueOf) - .filter(modifier -> !("Interface".equals(type) && "abstract".equals(modifier))) - .filter(modifier -> !("Enum".equals(type) && ("static".equals(modifier) || "final".equals(modifier)))) - .collect(Collectors.joining(" ")), - StringUtils.lowerCase(type), shortNameWithGenericsSupport); - - String superclass = determineSuperclass(classElement); - if (superclass != null && !JAVA_LANG_OBJECT.equals(superclass)) { - result += " extends " + makeTypeShort(superclass); - - addSuperclassToReferencesMap(superclass, container); - } - - List interfaces = classElement.getInterfaces(); - if (CollectionUtils.isNotEmpty(interfaces)) { - String prefix = (classElement.getKind() == ElementKind.INTERFACE) ? " extends " : " implements "; - result += prefix + interfaces.stream().map(String::valueOf).map(this::makeTypeShort) - .collect(Collectors.joining(", ")); - - container.setInterfaces(interfaces.stream() - .map(String::valueOf) - .collect(Collectors.toList())); + List determineNestedSuperclass( + TypeElement classElement, + ExtendedMetadataFileItem result, + List inheritedMethods) { + List nestedList = new ArrayList<>(); - addInterfacesToReferencesMap(interfaces, container); - - } - addInheritedMethodsToReferencesMap(container); - container.setContent(result); + if (result.getSuperclass() != null) { + nestedList = result.getSuperclass(); } - void addSuperclassToReferencesMap(String superclass, ExtendedMetadataFileItem container) { - container.addReferences(Set.of(new MetadataFileItem(superclass, makeTypeShort(superclass), false))); - } + TypeMirror superclass = classElement.getSuperclass(); + if (superclass.getKind() != TypeKind.NONE) { + TypeElement superClassElement = + (TypeElement) environment.getTypeUtils().asElement(superclass); - void addInheritedMethodsToReferencesMap(ExtendedMetadataFileItem container) { - container.addReferences(container.getInheritedMethods().stream() - .map(o -> new MetadataFileItem(o, makeTypeShort(o), false)) - .collect(Collectors.toSet()) - ); - } + nestedList.add(superClassElement.getQualifiedName().toString()); + result.setSuperclass(nestedList); + appendInheritedMethods(superClassElement, inheritedMethods); - void addInterfacesToReferencesMap(List interfaces, ExtendedMetadataFileItem container) { - container.addReferences(interfaces.stream() - .map(String::valueOf) - .map(o -> new MetadataFileItem(o, makeTypeShort(o), false)) - .collect(Collectors.toSet()) - ); + determineNestedSuperclass(superClassElement, result, inheritedMethods); } - - String determineSuperclass(TypeElement classElement) { - TypeMirror superclass = classElement.getSuperclass(); - if (superclass.getKind() == TypeKind.NONE) { - return null; - } - return String.valueOf(superclass); + return nestedList; + } + + List determineTypeParameters(TypeElement element) { + return element.getTypeParameters().stream() + .map(typeParameter -> new TypeParameter(String.valueOf(typeParameter))) + .collect(Collectors.toList()); + } + + void appendInheritedMethods( + TypeElement element, List inheritedMethods) { + List members = elementUtil.getEnclosedElements(element); + Integer level = Optional.ofNullable(getMaxNestedLevel(inheritedMethods)).orElse(0); + + for (Element m : members) { + if (m.getKind() == ElementKind.METHOD && !Utils.isPrivateOrPackagePrivate(m)) { + String uid = element.getQualifiedName().toString().concat(".") + String.valueOf(m); + + ExtendedMetadataFileItem item = new ExtendedMetadataFileItem(uid); + item.setName(String.valueOf(m)); + item.setNestedLevel(level + 1); + + inheritedMethods.add(item); + } } + } - List determineNestedSuperclass(TypeElement classElement, ExtendedMetadataFileItem result, List inheritedMethods) { - List nestedList = new ArrayList<>(); + Integer getMaxNestedLevel(List inheritedMethods) { + Integer level = 0; - if (result.getSuperclass() != null) { - nestedList = result.getSuperclass(); - } - - TypeMirror superclass = classElement.getSuperclass(); - if (superclass.getKind() != TypeKind.NONE) { - TypeElement superClassElement = (TypeElement) environment.getTypeUtils().asElement(superclass); - - nestedList.add(superClassElement.getQualifiedName().toString()); - result.setSuperclass(nestedList); - appendInheritedMethods(superClassElement, inheritedMethods); - - determineNestedSuperclass(superClassElement, result, inheritedMethods); - } - return nestedList; + if (inheritedMethods.size() > 0) { + level = + inheritedMethods.stream() + .mapToInt(v -> v.getNestedLevel()) + .max() + .orElseThrow(NoSuchElementException::new); } - - List determineTypeParameters(TypeElement element) { - return element.getTypeParameters().stream() - .map(typeParameter -> new TypeParameter(String.valueOf(typeParameter))) - .collect(Collectors.toList()); - } - - void appendInheritedMethods(TypeElement element, List inheritedMethods) { - List members = element.getEnclosedElements(); - Integer level = Optional.ofNullable(getMaxNestedLevel(inheritedMethods)) - .orElse(0); - - for (Element m : members) { - if (m.getKind() == ElementKind.METHOD && !Utils.isPrivateOrPackagePrivate(m)) { - String uid = element.getQualifiedName().toString().concat(".") + String.valueOf(m); - - ExtendedMetadataFileItem item = new ExtendedMetadataFileItem(uid); - item.setName(String.valueOf(m)); - item.setNestedLevel(level + 1); - - inheritedMethods.add(item); - } + return level; + } + + List determineInheritedMembers(List inheritedMethods) { + + if (inheritedMethods.size() > 0) { + HashMap map = new HashMap<>(); + for (ExtendedMetadataFileItem item : inheritedMethods) { + String key = item.getName(); + + if (map.containsKey(key) && map.get(key).getNestedLevel() > item.getNestedLevel()) { + // child class will have smaller than superclass, we only need the nearest methods + // inherited with same signature + map.put(key, item); + } else if (!map.containsKey(key)) { + map.put(key, item); } - } - - Integer getMaxNestedLevel(List inheritedMethods) { - Integer level = 0; + } + List methods = + map.values().stream().map(x -> x.getUid()).collect(Collectors.toList()); - if (inheritedMethods.size() > 0) { - level = inheritedMethods - .stream() - .mapToInt(v -> v.getNestedLevel()) - .max().orElseThrow(NoSuchElementException::new); - } - return level; + return methods; + } + return new ArrayList<>(); + } + + @Override + public String getStatusComment(TypeElement element) { + // Don't provide status comments for classes. + return null; + } + + public String extractJavaType(TypeElement element) { + String superClass = determineSuperclass(element); + if (superClass != null && superClass.contains("Exception")) { + return "exception"; } - List determineInheritedMembers(List inheritedMethods) { - - if (inheritedMethods.size() > 0) { - HashMap map = new HashMap<>(); - for (ExtendedMetadataFileItem item : inheritedMethods - ) { - String key = item.getName(); - - if (map.containsKey(key) && map.get(key).getNestedLevel() > item.getNestedLevel()) { - // child class will have smaller than superclass, we only need the nearest methods inherited with same signature - map.put(key, item); - } else if (!map.containsKey(key)) { - map.put(key, item); - } - } - List methods = map.values() - .stream() - .map(x -> x.getUid()) - .collect(Collectors.toList()); - - return methods; - } - return new ArrayList<>(); + String javatype = element.getKind().name().toLowerCase().replaceAll("_", ""); + if (javatype.equals("annotationtype")) { + return javatype; } + return null; + } } 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 ca9738fd..d9394854 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,47 +1,222 @@ 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 com.sun.source.doctree.DeprecatedTree; -import com.sun.source.doctree.DocTree; -import jdk.javadoc.doclet.DocletEnvironment; - +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; import javax.lang.model.element.PackageElement; +import jdk.javadoc.doclet.DocletEnvironment; public class PackageLookup extends BaseLookup { - public PackageLookup(DocletEnvironment environment) { - super(environment); + public PackageLookup(DocletEnvironment environment) { + super(environment); + } + + @Override + protected ExtendedMetadataFileItem buildMetadataFileItem(PackageElement packageElement) { + String qName = String.valueOf(packageElement.getQualifiedName()); + String sName = String.valueOf(packageElement.getSimpleName()); + + ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(qName); + result.setId(sName); + result.setHref(qName + ".yml"); + result.setName(qName); + result.setNameWithType(qName); + result.setFullName(qName); + result.setType(determineType(packageElement)); + result.setJavaType(extractJavaType(packageElement)); + result.setSummary(determineComment(packageElement)); + result.setContent(determinePackageContent(packageElement)); + return result; + } + + public String extractStatus(PackageElement packageElement) { + String name = String.valueOf(packageElement.getQualifiedName()); + if (name.contains(Status.ALPHA.toString())) { + return Status.ALPHA.toString(); } + if (name.contains(Status.BETA.toString())) { + return Status.BETA.toString(); + } + return null; + } + + String determinePackageContent(PackageElement packageElement) { + return "package " + packageElement.getQualifiedName(); + } - @Override - protected ExtendedMetadataFileItem buildMetadataFileItem(PackageElement packageElement) { - String qName = String.valueOf(packageElement.getQualifiedName()); - String sName = String.valueOf(packageElement.getSimpleName()); - - ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(qName); - result.setId(sName); - result.setHref(qName + ".yml"); - result.setName(qName); - result.setNameWithType(qName); - result.setFullName(qName); - result.setType(determineType(packageElement)); - result.setSummary(determineComment(packageElement)); - result.setContent(determinePackageContent(packageElement)); - return result; + public String extractJavaType(PackageElement element) { + String javaType = element.getKind().name().toLowerCase(); + if (javaType.equals("package")) { + return javaType; } + return null; + } - public String extractStatus(String name) { - if (name.contains(Status.ALPHA.toString())) { - return Status.ALPHA.toString(); - } - if (name.contains(Status.BETA.toString())) { - return Status.BETA.toString(); - } - return null; + /** + * @return true, if the package ends with 'stub' and its parent package is an API version + */ + public boolean isApiVersionStubPackage(PackageElement pkg) { + return isApiVersionStubPackageName(String.valueOf(pkg.getQualifiedName())); + } + + /** + * @return true, if the package ends with 'stub' and its parent package is an API version + */ + @VisibleForTesting + boolean isApiVersionStubPackageName(String name) { + List packagePath = Arrays.asList(name.split("\\.")); + int stubIndex = packagePath.indexOf("stub"); + if (stubIndex < 1) { + return false; } + return ApiVersion.parse(packagePath.get(stubIndex - 1)).isPresent(); + } + + public List findStubPackages( + PackageElement pkg, Collection packages) { + String expectedStubPackageBase = pkg.getQualifiedName() + ".stub"; + return packages.stream() + .filter(p -> String.valueOf(p.getQualifiedName()).startsWith(expectedStubPackageBase)) + .sorted(Comparator.comparing(p -> String.valueOf(p.getQualifiedName()))) + .collect(Collectors.toList()); + } + + /** Compare PackageElements by their parsed ApiVersion */ + private final Comparator byComparingApiVersion = + Comparator.comparing(pkg -> extractApiVersion(pkg).orElse(ApiVersion.NONE)); + + public Optional extractApiVersion(PackageElement pkg) { + return extractApiVersion(String.valueOf(pkg.getQualifiedName())); + } + + public Optional extractApiVersion(String name) { + return ApiVersion.parse(getLeafPackage(name)); + } + + public boolean isApiVersionPackage(PackageElement pkg) { + return extractApiVersion(pkg).isPresent(); + } + + 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) { - String determinePackageContent(PackageElement packageElement) { - return "package " + packageElement.getQualifiedName(); + 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()); + + // Group all API version packages into a single .v# group + boolean packageIsApiVersion = ApiVersion.parse(getLeafPackage(name)).isPresent(); + if (packageIsApiVersion) { + return withoutLeafPackage(name) + ".v#"; // withoutLeafPackage("a.b.c.v1") --> "a.b.c" + } + + // When not an API version package, use 'name' to ensure a unique 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); + } + + /** withoutLeafPackage("a.b.c.d") --> "a.b.c" */ + private String withoutLeafPackage(String name) { + int lastPackageIndex = name.lastIndexOf('.'); + return name.substring(0, lastPackageIndex); + } + + /** getLeafPackage("a.b.c.d") --> "d" */ + private String getLeafPackage(String name) { + int lastPackageIndex = name.lastIndexOf('.'); + return name.substring(lastPackageIndex + 1); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/model/ExtendedMetadataFileItem.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/model/ExtendedMetadataFileItem.java index dea5e61a..c4238280 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/model/ExtendedMetadataFileItem.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/lookup/model/ExtendedMetadataFileItem.java @@ -8,112 +8,114 @@ import java.util.List; import java.util.Set; -/** - * Just container to keep cached precalculated values for lookup - */ +/** Just container to keep cached precalculated values for lookup */ public class ExtendedMetadataFileItem extends MetadataFileItem { - private String methodContent; - private String fieldContent; - private String constructorContent; - private List parameters; - private Return returnValue; - private String content; - private List typeParameters; - private List superclass; - private String tocName; - private Set references = new LinkedHashSet<>(); - private Integer nestedLevel; - - public ExtendedMetadataFileItem(String uid) { - super(uid); - } - - public String getMethodContent() { - return methodContent; - } - - public void setMethodContent(String methodContent) { - this.methodContent = methodContent; - } - - public String getFieldContent() { - return fieldContent; - } - - public void setFieldContent(String fieldContent) { - this.fieldContent = fieldContent; - } - - public String getConstructorContent() { - return constructorContent; - } - - public void setConstructorContent(String constructorContent) { - this.constructorContent = constructorContent; - } - - public List getParameters() { - return parameters; - } - - public Integer getNestedLevel() {return nestedLevel;} - - public void setNestedLevel(Integer level) {this.nestedLevel = level;} - - @Override - public void setParameters(List parameters) { - this.parameters = parameters; - } - - public Return getReturn() { - return returnValue; - } - - @Override - public void setReturn(Return returnValue) { - this.returnValue = returnValue; - } - - public String getContent() { - return content; - } - - @Override - public void setContent(String content) { - this.content = content; - } - - public List getTypeParameters() { - return typeParameters; - } - - @Override - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } - - public List getSuperclass() { - return superclass; - } - - public void setSuperclass(List superclass) { - this.superclass = superclass; - } - - public void setTocName(String tocName) { - this.tocName = tocName; - } - - public String getTocName() { - return tocName; - } - - public void addReferences(Set references) { - this.references.addAll(references); - } - - public Set getReferences() { - return references; - } + private String methodContent; + private String fieldContent; + private String constructorContent; + private List parameters; + private Return returnValue; + private String content; + private List typeParameters; + private List superclass; + private String tocName; + private Set references = new LinkedHashSet<>(); + private Integer nestedLevel; + + public ExtendedMetadataFileItem(String uid) { + super(uid); + } + + public String getMethodContent() { + return methodContent; + } + + public void setMethodContent(String methodContent) { + this.methodContent = methodContent; + } + + public String getFieldContent() { + return fieldContent; + } + + public void setFieldContent(String fieldContent) { + this.fieldContent = fieldContent; + } + + public String getConstructorContent() { + return constructorContent; + } + + public void setConstructorContent(String constructorContent) { + this.constructorContent = constructorContent; + } + + public List getParameters() { + return parameters; + } + + public Integer getNestedLevel() { + return nestedLevel; + } + + public void setNestedLevel(Integer level) { + this.nestedLevel = level; + } + + @Override + public void setParameters(List parameters) { + this.parameters = parameters; + } + + public Return getReturn() { + return returnValue; + } + + @Override + public void setReturn(Return returnValue) { + this.returnValue = returnValue; + } + + public String getContent() { + return content; + } + + @Override + public void setContent(String content) { + this.content = content; + } + + public List getTypeParameters() { + return typeParameters; + } + + @Override + public void setTypeParameters(List typeParameters) { + this.typeParameters = typeParameters; + } + + public List getSuperclass() { + return superclass; + } + + public void setSuperclass(List superclass) { + this.superclass = superclass; + } + + public void setTocName(String tocName) { + this.tocName = tocName; + } + + public String getTocName() { + return tocName; + } + + public void addReferences(Set references) { + this.references.addAll(references); + } + + public Set getReferences() { + return references; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ApiVersionPackageToc.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ApiVersionPackageToc.java new file mode 100644 index 00000000..2e5e7cbf --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ApiVersionPackageToc.java @@ -0,0 +1,116 @@ +package com.microsoft.model; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; + +public class ApiVersionPackageToc { + static final String CLIENTS = "Clients"; + static final String REQUESTS_AND_RESPONSES = "Requests and responses"; + static final String SETTINGS = "Settings"; + static final String ALL_OTHERS = "All other classes and interfaces"; + static final String BUILDERS = "Builders"; + static final String ENUMS = "Enums"; + static final String INTERFACES = "Interfaces"; + static final String MESSAGES = "Messages"; + static final String EXCEPTIONS = "Exceptions"; + static final String PAGING = "Paging"; + static final String RESOURCE_NAMES = "Resource names"; + static final String UNCATEGORIZED = "Other"; + + private final LinkedHashMap> visibleCategories = new LinkedHashMap<>(); + private final LinkedHashMap> hiddenCategories = new LinkedHashMap<>(); + + public ApiVersionPackageToc() { + // Order here determines final organization order. + visibleCategories.put(CLIENTS, new ArrayList<>()); + visibleCategories.put(SETTINGS, new ArrayList<>()); + visibleCategories.put(REQUESTS_AND_RESPONSES, new ArrayList<>()); + + hiddenCategories.put(BUILDERS, new ArrayList<>()); + hiddenCategories.put(ENUMS, new ArrayList<>()); + hiddenCategories.put(EXCEPTIONS, new ArrayList<>()); + hiddenCategories.put(MESSAGES, new ArrayList<>()); + hiddenCategories.put(PAGING, new ArrayList<>()); + hiddenCategories.put(RESOURCE_NAMES, new ArrayList<>()); + hiddenCategories.put(INTERFACES, new ArrayList<>()); + hiddenCategories.put(UNCATEGORIZED, new ArrayList<>()); + } + + public void addClient(TocItem tocItem) { + visibleCategories.get(CLIENTS).add(tocItem); + } + + public void addRequestOrResponse(TocItem tocItem) { + visibleCategories.get(REQUESTS_AND_RESPONSES).add(tocItem); + } + + public void addSettings(TocItem tocItem) { + visibleCategories.get(SETTINGS).add(tocItem); + } + + public void addBuilder(TocItem tocItem) { + hiddenCategories.get(BUILDERS).add(tocItem); + } + + public void addEnum(TocItem tocItem) { + hiddenCategories.get(ENUMS).add(tocItem); + } + + public void addException(TocItem tocItem) { + hiddenCategories.get(EXCEPTIONS).add(tocItem); + } + + public void addInterface(TocItem tocItem) { + hiddenCategories.get(INTERFACES).add(tocItem); + } + + public void addMessage(TocItem tocItem) { + hiddenCategories.get(MESSAGES).add(tocItem); + } + + public void addUncategorized(TocItem tocItem) { + hiddenCategories.get(UNCATEGORIZED).add(tocItem); + } + + public void addPaging(TocItem tocItem) { + hiddenCategories.get(PAGING).add(tocItem); + } + + public void addResourceName(TocItem tocItem) { + hiddenCategories.get(RESOURCE_NAMES).add(tocItem); + } + + /** Build a list of TocItems for inclusion in the library's table of contents */ + public List toList() { + List toc = new ArrayList<>(); + + visibleCategories.forEach( + (name, category) -> { + if (!category.isEmpty()) { + toc.add(createCategory(name, category)); + } + }); + + TocItem allOthers = new TocItem(ALL_OTHERS, ALL_OTHERS, null); + hiddenCategories.forEach( + (name, category) -> { + if (!category.isEmpty()) { + allOthers.getItems().add(createCategory(name, category)); + } + }); + if (allOthers.getItems().size() > 0) { + toc.add(allOthers); + } + + return toc; + } + + private TocItem createCategory(String name, List items) { + TocItem category = new TocItem(name, name, null); + items.sort(Comparator.comparing(TocItem::getName)); + category.getItems().addAll(items); + return category; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ExceptionItem.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ExceptionItem.java index b833f6bd..2fda6b0f 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ExceptionItem.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ExceptionItem.java @@ -2,19 +2,19 @@ public class ExceptionItem { - private final String type; - private final String description; + private final String type; + private final String description; - public ExceptionItem(String type, String description) { - this.type = type; - this.description = description; - } + public ExceptionItem(String type, String description) { + this.type = type; + this.description = description; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Guide.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Guide.java index 22310a0d..ebd071ce 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Guide.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Guide.java @@ -18,25 +18,25 @@ // for including guides with toc items // [items: [name: Overview, -// href: index.md, +// href: overview.html, // name: Version history, // href: history.md, // name: name, // uid: package.name,...]] public class Guide { - private final String name; - private final String href; + private final String name; + private final String href; - public Guide(String name, String href) { - this.name = name; - this.href = href; - } + public Guide(String name, String href) { + this.name = name; + this.href = href; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public String getHref() { - return href; - } -} \ No newline at end of file + public String getHref() { + return href; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/KindTitle.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/KindTitle.java index b098336c..65f438a7 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/KindTitle.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/KindTitle.java @@ -16,13 +16,19 @@ package com.microsoft.model; public class KindTitle { - private final String elementKind; - private final String title; + private final String elementKind; + private final String title; - public KindTitle(String elementKind, String title) { - this.elementKind = elementKind; - this.title = title; - } - public String getElementKind() { return elementKind; } - public String getTitle() { return title; } + public KindTitle(String elementKind, String title) { + this.elementKind = elementKind; + this.title = title; + } + + public String getElementKind() { + return elementKind; + } + + public String getTitle() { + return title; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/LibraryOverviewFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/LibraryOverviewFile.java new file mode 100644 index 00000000..3adfef30 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/LibraryOverviewFile.java @@ -0,0 +1,273 @@ +package com.microsoft.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.docfx.doclet.RepoMetadata; +import java.io.File; +import java.util.Arrays; + +public class LibraryOverviewFile { + // This is passed in as an environment variable + private String repoMetadataFilePath; + + private final String outputPath; + private String fileName; + + // This is passed in as an environment variable + private String artifactVersion; + // This is passed in as an environment variable + private String librariesBomVersion; + + private String recommendedPackageLink; + + // This is parsed from the .repoMetadata.json if it exists, or is calculated in ApiVersion + private String recommendedPackage; + + private String LIBRARY_OVERVIEW_FILE_HEADER = ""; + + private String LIBRARY_OVERVIEW_KEY_REFERENCE_HEADER = ""; + + private String LIBRARY_OVERVIEW_KEY_REFERENCE_TABLE = ""; + + private String LIBRARY_OVERVIEW_GETTING_STARTED_SECTION = ""; + + private String LIBRARY_OVERVIEW_CLIENT_INSTALLATION_SECTION = ""; + + private String LIBRARY_OVERVIEW_CLIENT_INSTALLATION_HEADER = ""; + + private String LIBRARY_OVERVIEW_PACKAGE_SELECTION_SECTION = ""; + + public LibraryOverviewFile( + String outputPath, + String fileName, + String artifactVersion, + String librariesBomVersion, + String repoMetadataFilePath, + String recommendedPackage) { + this.outputPath = outputPath; + this.fileName = fileName; + this.artifactVersion = artifactVersion; + this.librariesBomVersion = librariesBomVersion.trim(); + this.repoMetadataFilePath = repoMetadataFilePath; + this.recommendedPackage = recommendedPackage; + + RepoMetadata repoMetadata = new RepoMetadata(); + repoMetadata = repoMetadata.parseRepoMetadata(this.repoMetadataFilePath); + + this.recommendedPackageLink = ""; + // Compute the link to the recommended package if it exists + if (!this.recommendedPackage.isEmpty()) { + String cgcRootUri = "https://cloud.google.com/java/docs/reference/"; + this.recommendedPackageLink = + cgcRootUri + + repoMetadata.getArtifactId() + + "/" + + artifactVersion + + "/" + + this.recommendedPackage; + } + + this.LIBRARY_OVERVIEW_FILE_HEADER = + "# " + repoMetadata.getArtifactId() + " overview (" + artifactVersion + ")\n\n"; + + this.LIBRARY_OVERVIEW_KEY_REFERENCE_HEADER = + "## Key Reference Links\n" + + "**" + + repoMetadata.getNamePretty() + + " Description:** " + + capitalizeFirstLetter(repoMetadata.getApiDescription()) + + "\n\n"; + + this.LIBRARY_OVERVIEW_KEY_REFERENCE_TABLE = + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
" + + repoMetadata.getNamePretty() + + " Product ReferenceGitHub RepositoryMaven artifact
" + + "\n\n"; + + // For non-service libraries, these steps are not necessary + // TODO: https://github.com/googleapis/java-docfx-doclet/issues/253 : Ideally we can refactor + // for custom modules to copy from their README sections + String[] runtimeLibraries = {"gax", "api-common", "common-protos", "google-cloud-core"}; + + if (Arrays.asList(runtimeLibraries).contains(repoMetadata.getApiShortName())) { + this.LIBRARY_OVERVIEW_GETTING_STARTED_SECTION = + "## Getting Started\n" + + "In order to use this library, you first need to go through the following steps:" + + "\n\n" + + "- [Install a JDK (Java Development Kit)](https://cloud.google.com/java/docs/setup#install_a_jdk_java_development_kit)\n\n"; + } else { + this.LIBRARY_OVERVIEW_GETTING_STARTED_SECTION = + "## Getting Started\n" + + "In order to use this library, you first need to go through the following steps:" + + "\n\n" + + "- [Install a JDK (Java Development Kit)](https://cloud.google.com/java/docs/setup#install_a_jdk_java_development_kit)\n" + + "- [Select or create a Cloud Platform project](https://console.cloud.google.com/project)\n" + + "- [Enable billing for your project](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)\n" + + "- [Enable the API](https://console.cloud.google.com/apis/library/" + + repoMetadata.getApiShortName() + + ".googleapis.com)\n" + + "- [Set up authentication](https://cloud.google.com/docs/authentication/client-libraries)\n\n"; + + this.LIBRARY_OVERVIEW_CLIENT_INSTALLATION_HEADER = + "## Use the " + + repoMetadata.getNamePretty() + + " for Java\n" + + "To ensure that your project uses compatible versions of the libraries\n" + + "and their component artifacts, import `com.google.cloud:libraries-bom` and use\n" + + "the BOM to specify dependency versions. Be sure to remove any versions that you\n" + + "set previously. For more information about\n" + + "BOMs, see [Google Cloud Platform Libraries BOM](https://cloud.google.com/java/docs/bom).\n\n"; + + // When b/312765900 is implemented, then refactor this section to use the devsite-selector + // format. Current format is a workaround so the sanitizer doesn't remove the content. + this.LIBRARY_OVERVIEW_CLIENT_INSTALLATION_SECTION = + "### Maven\n" + + "Import the BOM in the dependencyManagement section of your pom.xml file.\n" + + "Include specific artifacts you depend on in the dependencies section, but don't\n" + + "specify the artifacts' versions in the dependencies section.\n" + + "\n" + + "The example below demonstrates how you would import the BOM and include the " + + repoMetadata.getArtifactId() + + " artifact.\n" + + "

\n"
+              + "<dependencyManagement>\n"
+              + " <dependencies>\n"
+              + "   <dependency>\n"
+              + "      <groupId>com.google.cloud</groupId>\n"
+              + "      <artifactId>libraries-bom</artifactId>\n"
+              + "      <version>"
+              + this.librariesBomVersion
+              + "</version>\n"
+              + "      <type>pom</type>\n"
+              + "      <scope>import</scope>\n"
+              + "   </dependency>\n"
+              + " </dependencies>\n"
+              + "</dependencyManagement>\n\n"
+              + "<dependencies>\n"
+              + " <dependency>\n"
+              + "   <groupId>com.google.cloud</groupId>\n"
+              + "   <artifactId>"
+              + repoMetadata.getArtifactId()
+              + "</artifactId>\n"
+              + " </dependency>\n"
+              + "</dependencies>\n"
+              + "
\n\n" + + "### Gradle\n" + + "BOMs are supported by default in Gradle 5.x or later. Add a platform\n" + + "dependency on com.google.cloud:libraries-bom and remove the version from the\n" + + "dependency declarations in the artifact's build.gradle file.\n" + + "\n" + + "The example below demonstrates how you would import the BOM and include the " + + repoMetadata.getArtifactId() + + " artifact.\n" + + "
\n"
+              + "implementation(platform("com.google.cloud:libraries-bom:"
+              + this.librariesBomVersion
+              + ""))\n"
+              + "implementation(""
+              + repoMetadata.getDistributionName()
+              + "")\n"
+              + "
\n\n" + + "The platform and enforcedPlatform keywords supply dependency versions\n" + + "declared in a BOM. The enforcedPlatform keyword enforces the dependency\n" + + "versions declared in the BOM and thus overrides what you specified.\n\n" + + "For more details of the platform and enforcedPlatform keywords Gradle 5.x or higher, see\n" + + "[Gradle: Importing Maven BOMs](https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import).\n" + + "\n" + + "If you're using Gradle 4.6 or later, add\n" + + "enableFeaturePreview('IMPROVED_POM_SUPPORT') to your settings.gradle file. For details, see\n" + + "[Gradle 4.6 Release Notes: BOM import](https://docs.gradle.org/4.6/release-notes.html#bom-import).\n" + + "Versions of Gradle earlier than 4.6 don't support BOMs.

\n\n" + + "### SBT\n" + + "SBT [doesn't support BOMs](https://github.com/sbt/sbt/issues/4531). You can find\n" + + "recommended versions of libraries from a particular BOM version on the\n" + + "[dashboard](https://storage.googleapis.com/cloud-opensource-java-dashboard/com.google.cloud/libraries-bom/index.html)\n" + + "and set the versions manually.\n" + + "To use the latest version of this library, add this to your dependencies:\n" + + "
\n"
+              + "libraryDependencies += "com.google.cloud" % ""
+              + repoMetadata.getArtifactId()
+              + "" % ""
+              + artifactVersion
+              + ""\n"
+              + "
\n\n"; + } + // It should be very rare that a client library does not have a recommended package + if (this.recommendedPackage.isEmpty()) { + this.LIBRARY_OVERVIEW_PACKAGE_SELECTION_SECTION = ""; + } else { + this.LIBRARY_OVERVIEW_PACKAGE_SELECTION_SECTION = + "## Which version ID should I get started with?\n" + + "For this library, we recommend using " + + "[" + + this.recommendedPackage + + "](" + + this.recommendedPackageLink + + ") for new applications.\n\n" + + "### Understanding Version ID and Library Versions\n" + + "When using a Cloud client library, it's important to distinguish between two types of versions:\n" + + "- **Library Version**: The version of the software package (the client library) that helps you interact with the Cloud service. These libraries are\n" + + "released and updated frequently with bug fixes, improvements, and support for new service features and versions. The version selector at\n" + + "the top of this page represents the client library version.\n" + + "- **Version ID**: The version of the Cloud service itself (e.g. " + + repoMetadata.getNamePretty() + + "). New Version IDs are introduced infrequently, and often involve\n" + + "changes to the core functionality and structure of the Cloud service itself. The packages in the lefthand navigation represent packages tied\n" + + "to a specific Version ID of the Cloud service.\n\n" + + "### Managing Library Versions\n" + + "We recommend using the com.google.cloud:libraries-bom installation method detailed above to streamline dependency management\n" + + "across multiple Cloud Java client libraries. This ensures compatibility and simplifies updates.\n\n" + + "### Choosing the Right Version ID\n" + + "Each Cloud Java client library may contain packages tied to specific Version IDs (e.g., v1, v2alpha). For new production applications, use\n" + + "the latest stable Version ID. This is identified by the highest version number **without** a suffix (like \"alpha\" or \"beta\"). You can read more about\n" + + "[Cloud API versioning strategy here](https://cloud.google.com/apis/design/versioning).\n\n" + + "**Important**: Unstable Version ID releases (those _with_ suffixes) are subject to breaking changes when upgrading. Use them only for testing or if you specifically need their experimental features.\n\n"; + } + } + + @JsonIgnore + public String getFileContent() { + return LIBRARY_OVERVIEW_FILE_HEADER + + LIBRARY_OVERVIEW_KEY_REFERENCE_HEADER + + LIBRARY_OVERVIEW_KEY_REFERENCE_TABLE + + LIBRARY_OVERVIEW_GETTING_STARTED_SECTION + + LIBRARY_OVERVIEW_CLIENT_INSTALLATION_HEADER + + LIBRARY_OVERVIEW_CLIENT_INSTALLATION_SECTION + + LIBRARY_OVERVIEW_PACKAGE_SELECTION_SECTION; + } + + @JsonIgnore + private static String capitalizeFirstLetter(String string) { + if (string == null || string.isEmpty()) { + return string; // Return unchanged if input is null or empty + } + + // Capitalize the first character and append the rest of the string + return string.substring(0, 1).toUpperCase() + string.substring(1); + } + + @JsonIgnore + public String getFileNameWithPath() { + return outputPath + File.separator + fileName; + } + + @JsonIgnore + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFile.java index 15e7ebe6..c47de634 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFile.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFile.java @@ -2,7 +2,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.microsoft.util.YamlUtil; - import java.io.File; import java.util.LinkedHashSet; import java.util.Set; @@ -10,45 +9,45 @@ public class MetadataFile implements YmlFile { - private final static String METADATA_FILE_HEADER = "### YamlMime:ManagedReference\n"; - private final String outputPath; - private String fileName; - private Set items = new LinkedHashSet<>(); - private Set references = new LinkedHashSet<>(); - - public MetadataFile(String outputPath, String fileName) { - this.outputPath = outputPath; - this.fileName = fileName; - } - - public Set getItems() { - return items; - } - - public Set getReferences() { - return references; - } - - @JsonIgnore - @Override - public String getFileContent() { - Set sortedSet = new TreeSet<>(this.items); - this.items = sortedSet; - return METADATA_FILE_HEADER + YamlUtil.objectToYamlString(this); - } - - @JsonIgnore - @Override - public String getFileNameWithPath() { - return outputPath + File.separator + fileName; - } - - @JsonIgnore - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } + private static final String METADATA_FILE_HEADER = "### YamlMime:ManagedReference\n"; + private final String outputPath; + private String fileName; + private Set items = new LinkedHashSet<>(); + private Set references = new LinkedHashSet<>(); + + public MetadataFile(String outputPath, String fileName) { + this.outputPath = outputPath; + this.fileName = fileName; + } + + public Set getItems() { + return items; + } + + public Set getReferences() { + return references; + } + + @JsonIgnore + @Override + public String getFileContent() { + Set sortedSet = new TreeSet<>(this.items); + this.items = sortedSet; + return METADATA_FILE_HEADER + YamlUtil.objectToYamlString(this); + } + + @JsonIgnore + @Override + public String getFileNameWithPath() { + return outputPath + File.separator + fileName; + } + + @JsonIgnore + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFileItem.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFileItem.java index 02e9be9c..450c17d2 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFileItem.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MetadataFileItem.java @@ -2,273 +2,332 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.apache.commons.lang3.RegExUtils; - +import com.microsoft.build.PackageOverviewFile.PackageChildSummary; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import org.apache.commons.lang3.RegExUtils; -@JsonPropertyOrder({"uid", "id", "parent", "children", "href", "langs", "isExternal", "name", "nameWithType", - "fullName", "overload", "overridden", "type", "package", "summary", "syntax", "inheritance", "implements", "exceptions", - "spec.java", "inheritedMembers", "status"}) +@JsonPropertyOrder({ + "uid", + "id", + "parent", + "children", + "href", + "langs", + "isExternal", + "name", + "nameWithType", + "fullName", + "overload", + "overridden", + "type", + "javatype", + "package", + "summary", + "syntax", + "inheritance", + "implements", + "exceptions", + "spec.java", + "inheritedMembers", + "status" +}) public class MetadataFileItem implements Comparable { - private final String uid; - private String id; - private String parent; - private List children = new ArrayList<>(); - private String href; - private String[] langs; - private String name; - private String nameWithType; - private String fullName; - private String overload; - private String overridden; - private String type; - @JsonProperty("package") - private String packageName; - private String summary; - private Syntax syntax; - private List inheritance; - @JsonProperty("implements") - private List interfaces; - private List exceptions; - private boolean isExternal; - @JsonProperty("spec.java") - private List specForJava = new ArrayList<>(); - @JsonProperty("inheritedMembers") - private List inheritedMethods = new ArrayList<>(); - private String status; - - @Override - public int compareTo(MetadataFileItem item) { - return this.getUid().compareTo(item.getUid()); - } - - public MetadataFileItem(String[] langs, String uid) { - this(uid); - this.langs = langs; - } - - public MetadataFileItem(String uid) { - this.uid = uid; - } - - public MetadataFileItem(String uid, String name, boolean isExternal) { - this(uid); - this.name = name; - this.nameWithType = name; - this.fullName = uid; - this.isExternal = isExternal; - } - - public MetadataFileItem(String uid, List specs) { - this(uid); - this.specForJava = specs; - } - - public String getUid() { - return uid; - } - - public String getId() { - return id; - } + private final String uid; + private String id; + private String parent; + private List children = new ArrayList<>(); + + private HashMap childrenSummaries = new HashMap<>(); + + private List packageChildrenSummaries = new ArrayList<>(); + private String href; + private String[] langs; + private String name; + private String nameWithType; + private String fullName; + private String overload; + private String overridden; + private String type; + private String javatype; + + @JsonProperty("package") + private String packageName; + + private String summary; + private Syntax syntax; + private List inheritance; + + @JsonProperty("implements") + private List interfaces; + + private List exceptions; + private boolean isExternal; + + @JsonProperty("spec.java") + private List specForJava = new ArrayList<>(); + + @JsonProperty("inheritedMembers") + private List inheritedMethods = new ArrayList<>(); + + private String status; + + @Override + public int compareTo(MetadataFileItem item) { + return this.getUid().compareTo(item.getUid()); + } + + public MetadataFileItem(String[] langs, String uid) { + this(uid); + this.langs = langs; + } + + public MetadataFileItem(String uid) { + this.uid = uid; + } + + public MetadataFileItem(String uid, String name, boolean isExternal) { + this(uid); + this.name = name; + this.nameWithType = name; + this.fullName = uid; + this.isExternal = isExternal; + } + + public MetadataFileItem(String uid, List specs) { + this(uid); + this.specForJava = specs; + } + + public String getUid() { + return uid; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getParent() { + return parent; + } + + public void setParent(String parent) { + this.parent = parent; + } + + public List getChildren() { + Collections.sort(children); + return children; + } + + public HashMap getChildrenSummaries() { + return childrenSummaries; + } + + public List getPackageChildrenSummaries() { + return packageChildrenSummaries; + } + + public String getHref() { + return href; + } + + public void setHref(String href) { + this.href = href; + } + + public String[] getLangs() { + return langs; + } + + public String getName() { + return name; + } - public void setId(String id) { - this.id = id; - } - - public String getParent() { - return parent; - } - - public void setParent(String parent) { - this.parent = parent; - } - - public List getChildren() { - Collections.sort(children); - return children; - } - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public String[] getLangs() { - return langs; - } - - public String getName() { - return name; - } + public void setName(String name) { + this.name = name; + } - public void setName(String name) { - this.name = name; - } + public String getNameWithType() { + return nameWithType; + } - public String getNameWithType() { - return nameWithType; - } + public void setNameWithType(String nameWithType) { + this.nameWithType = nameWithType; + } - public void setNameWithType(String nameWithType) { - this.nameWithType = nameWithType; - } + public String getFullName() { + return fullName; + } - public String getFullName() { - return fullName; - } + public void setFullName(String fullName) { + this.fullName = fullName; + } + + public String getOverload() { + return overload; + } + + public void setOverload(String overload) { + this.overload = handleGenericForOverLoad(overload); + } + + public String getType() { + return type; + } - public void setFullName(String fullName) { - this.fullName = fullName; - } + public String getJavaType() { + return javatype; + } - public String getOverload() { - return overload; - } + public void setType(String type) { + this.type = type; + } - public void setOverload(String overload) { - this.overload = handleGenericForOverLoad(overload); - } + public void setJavaType(String javaType) { + this.javatype = javaType; + } - public String getType() { - return type; - } + public String getPackageName() { + return packageName; + } - public void setType(String type) { - this.type = type; - } + public void setPackageName(String packageName) { + this.packageName = packageName; + } - public String getPackageName() { - return packageName; - } + public String getSummary() { + return summary; + } - public void setPackageName(String packageName) { - this.packageName = packageName; - } + public void setSummary(String summary) { + this.summary = summary; + } - public String getSummary() { - return summary; - } + public Syntax getSyntax() { + return syntax; + } - public void setSummary(String summary) { - this.summary = summary; - } + public void setSyntax(Syntax syntax) { + this.syntax = syntax; + } - public Syntax getSyntax() { - return syntax; - } + public List getInheritance() { + return inheritance; + } - public void setSyntax(Syntax syntax) { - this.syntax = syntax; - } + public void setInheritance(List superclass) { + this.inheritance = (superclass == null) ? null : superclass; + } - public List getInheritance() { - return inheritance; - } + public List getInterfaces() { + return interfaces; + } - public void setInheritance(List superclass) { - this.inheritance = (superclass == null) ? null : superclass; - } + public void setInheritedMethods(List inheritedMethods) { + this.inheritedMethods = (inheritedMethods == null) ? null : inheritedMethods; + } - public List getInterfaces() { - return interfaces; - } + public List getInheritedMethods() { + return inheritedMethods; + } - public void setInheritedMethods(List inheritedMethods) { - this.inheritedMethods = (inheritedMethods == null) ? null : inheritedMethods; - } + public List getSpecForJava() { + return specForJava; + } - public List getInheritedMethods() { - return inheritedMethods; - } + public void setInterfaces(List interfaces) { + this.interfaces = interfaces; + } - public List getSpecForJava() { - return specForJava; - } + public List getExceptions() { + return exceptions; + } - public void setInterfaces(List interfaces) { - this.interfaces = interfaces; - } + public void setExceptions(List exceptions) { + this.exceptions = exceptions; + } - public List getExceptions() { - return exceptions; + public void setContent(String content) { + if (syntax == null) { + syntax = new Syntax(); } + syntax.setContent(content); + } - public void setExceptions(List exceptions) { - this.exceptions = exceptions; + public void setTypeParameters(List typeParameters) { + if (syntax == null) { + syntax = new Syntax(); } + syntax.setTypeParameters(typeParameters); + } - public void setContent(String content) { - if (syntax == null) { - syntax = new Syntax(); - } - syntax.setContent(content); + public void setParameters(List parameters) { + if (syntax == null) { + syntax = new Syntax(); } + syntax.setParameters(parameters); + } - public void setTypeParameters(List typeParameters) { - if (syntax == null) { - syntax = new Syntax(); - } - syntax.setTypeParameters(typeParameters); + public void setReturn(Return returnValue) { + if (syntax == null) { + syntax = new Syntax(); } + syntax.setReturnValue(returnValue); + } - public void setParameters(List parameters) { - if (syntax == null) { - syntax = new Syntax(); - } - syntax.setParameters(parameters); - } + public void setOverridden(String overridden) { + this.overridden = overridden; + } - public void setReturn(Return returnValue) { - if (syntax == null) { - syntax = new Syntax(); - } - syntax.setReturnValue(returnValue); - } + public String getOverridden() { + return overridden; + } - public void setOverridden(String overridden) { - this.overridden = overridden; + @Override + public boolean equals(Object o) { + if (this == o) { + return true; } - public String getOverridden() { - return overridden; + if (o == null || getClass() != o.getClass()) { + return false; } - @Override - public boolean equals(Object o) { - if (this == o) { return true; } + MetadataFileItem that = (MetadataFileItem) o; - if (o == null || getClass() != o.getClass()) { return false; } + return uid.equals(that.uid); + } - MetadataFileItem that = (MetadataFileItem) o; + @Override + public int hashCode() { + return uid.hashCode(); + } - return uid.equals(that.uid); - } - - @Override - public int hashCode() { - return uid.hashCode(); - } + public Boolean getIsExternal() { + return isExternal ? true : null; + } - public Boolean getIsExternal() { - return isExternal ? true : null; - } + public void setIsExternal(boolean external) { + isExternal = external; + } - public void setIsExternal(boolean external) { - isExternal = external; - } - - public String handleGenericForOverLoad(String value) { - return RegExUtils.removeAll(value, "<\\w+(,\\s*\\w+)*>"); - } + public String handleGenericForOverLoad(String value) { + return RegExUtils.removeAll(value, "<\\w+(,\\s*\\w+)*>"); + } - public String getStatus() { return status; } + public String getStatus() { + return status; + } - public void setStatus(String status) { this.status = status; } + public void setStatus(String status) { + this.status = status; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MethodParameter.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MethodParameter.java index 2c6d5c05..981805a0 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MethodParameter.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/MethodParameter.java @@ -2,29 +2,29 @@ public class MethodParameter { - private final String id; - private final String type; - private String description; + private final String id; + private final String type; + private String description; - public MethodParameter(String id, String type, String description) { - this.id = id; - this.type = type; - this.description = description; - } + public MethodParameter(String id, String type, String description) { + this.id = id; + this.type = type; + this.description = description; + } - public String getId() { - return id; - } + public String getId() { + return id; + } - public String getType() { - return type; - } + public String getType() { + return type; + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ProjectContents.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ProjectContents.java index 629110ff..b2263df4 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ProjectContents.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/ProjectContents.java @@ -21,19 +21,19 @@ // wraps guides + tocItems with product name hierarchy // [name: project-name, [items: [...]]] public class ProjectContents { - private final String name; - private final List items; + private final String name; + private final List items; - public ProjectContents(String name, List items) { - this.name = name; - this.items = items; - } + public ProjectContents(String name, List items) { + this.name = name; + this.items = items; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public List getItems() { - return items; - } -} \ No newline at end of file + public List getItems() { + return items; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Return.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Return.java index 712c2828..7872bc0b 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Return.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Return.java @@ -4,29 +4,30 @@ public class Return { - @JsonProperty("type") - private final String returnType; - @JsonProperty("description") - private String returnDescription; - - public Return(String returnType, String returnDescription) { - this.returnType = returnType; - this.returnDescription = returnDescription; - } - - public Return(String returnType) { - this.returnType = returnType; - } - - public String getReturnType() { - return returnType; - } - - public String getReturnDescription() { - return returnDescription; - } - - public void setReturnDescription(String returnDescription) { - this.returnDescription = returnDescription; - } + @JsonProperty("type") + private final String returnType; + + @JsonProperty("description") + private String returnDescription; + + public Return(String returnType, String returnDescription) { + this.returnType = returnType; + this.returnDescription = returnDescription; + } + + public Return(String returnType) { + this.returnType = returnType; + } + + public String getReturnType() { + return returnType; + } + + public String getReturnDescription() { + return returnDescription; + } + + public void setReturnDescription(String returnDescription) { + this.returnDescription = returnDescription; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/SpecViewModel.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/SpecViewModel.java index 999e642c..654d4cb1 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/SpecViewModel.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/SpecViewModel.java @@ -1,64 +1,63 @@ package com.microsoft.model; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import org.apache.commons.lang3.StringUtils; - import java.util.*; +import org.apache.commons.lang3.StringUtils; @JsonPropertyOrder({"uid", "name", "fullName", "isExternal", "href"}) public class SpecViewModel { - private String uid; - private String name; - private String fullName; - private boolean isExternal; - private String href; - - public SpecViewModel(String uid, String fullName) { - this.uid = uid; - this.name = getShortName(fullName); - this.fullName = fullName; - } - - public String getUid() { - return uid; - } - - public String getName() { - return name; - } - - public String getFullName() { - return fullName; - } - - String getShortName(String fullName) { - - StringBuilder singleValue = new StringBuilder(); - Optional.ofNullable(fullName).ifPresent( - Param -> { - List strList = new ArrayList<>(); - strList = Arrays.asList(StringUtils.split(Param, ".")); - Collections.reverse(strList); - singleValue.append(strList.get(0)); - } - ); - return singleValue.toString(); - } - - public void setIsExternal(boolean isExternal) { - this.isExternal = isExternal; - } - - public boolean getIsExternal() { - return isExternal; - } - - public void setHref(String href) { - this.href = href; - } - - public String getHref() { - return href; - } + private String uid; + private String name; + private String fullName; + private boolean isExternal; + private String href; + + public SpecViewModel(String uid, String fullName) { + this.uid = uid; + this.name = getShortName(fullName); + this.fullName = fullName; + } + + public String getUid() { + return uid; + } + + public String getName() { + return name; + } + + public String getFullName() { + return fullName; + } + + String getShortName(String fullName) { + + StringBuilder singleValue = new StringBuilder(); + Optional.ofNullable(fullName) + .ifPresent( + Param -> { + List strList = new ArrayList<>(); + strList = Arrays.asList(StringUtils.split(Param, ".")); + Collections.reverse(strList); + singleValue.append(strList.get(0)); + }); + return singleValue.toString(); + } + + public void setIsExternal(boolean isExternal) { + this.isExternal = isExternal; + } + + public boolean getIsExternal() { + return isExternal; + } + + public void setHref(String href) { + this.href = href; + } + + public String getHref() { + return href; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java index c70600dd..1ca7ea0e 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java @@ -17,10 +17,12 @@ package com.microsoft.model; public enum Status { - DEPRECATED, ALPHA, BETA; + DEPRECATED, + ALPHA, + BETA; - @Override - public String toString() { - return name().toLowerCase(); - } + @Override + public String toString() { + return name().toLowerCase(); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/StubPackageToc.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/StubPackageToc.java new file mode 100644 index 00000000..92802fa6 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/StubPackageToc.java @@ -0,0 +1,60 @@ +package com.microsoft.model; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; + +public class StubPackageToc { + static final String STUBS = "Stubs"; + static final String SETTINGS = "Settings"; + static final String CALLABLE_FACTORIES = "Callable factories"; + static final String UNCATEGORIZED = "Other"; + + private final LinkedHashMap> visibleCategories = new LinkedHashMap<>(); + + public StubPackageToc() { + // Order here determines final organization order. + visibleCategories.put(STUBS, new ArrayList<>()); + visibleCategories.put(SETTINGS, new ArrayList<>()); + visibleCategories.put(CALLABLE_FACTORIES, new ArrayList<>()); + visibleCategories.put(UNCATEGORIZED, new ArrayList<>()); + } + + public void addStub(TocItem tocItem) { + visibleCategories.get(STUBS).add(tocItem); + } + + public void addSettings(TocItem tocItem) { + visibleCategories.get(SETTINGS).add(tocItem); + } + + public void addCallableFactory(TocItem tocItem) { + visibleCategories.get(CALLABLE_FACTORIES).add(tocItem); + } + + public void addUncategorized(TocItem tocItem) { + visibleCategories.get(UNCATEGORIZED).add(tocItem); + } + + /** Build a list of TocItems for inclusion in the library's table of contents */ + public List toList() { + List toc = new ArrayList<>(); + + visibleCategories.forEach( + (name, category) -> { + if (!category.isEmpty()) { + toc.add(createCategory(name, category)); + } + }); + + return toc; + } + + private TocItem createCategory(String name, List items) { + TocItem category = new TocItem(name, name, null); + items.sort(Comparator.comparing(TocItem::getName)); + category.getItems().addAll(items); + return category; + } +} diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Syntax.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Syntax.java index d7a84acc..f5bfcf04 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Syntax.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Syntax.java @@ -1,46 +1,47 @@ package com.microsoft.model; import com.fasterxml.jackson.annotation.JsonProperty; - import java.util.List; public class Syntax { - private String content; - private List parameters; - @JsonProperty("return") - private Return returnValue; - private List typeParameters; + private String content; + private List parameters; + + @JsonProperty("return") + private Return returnValue; + + private List typeParameters; - public String getContent() { - return content; - } + public String getContent() { + return content; + } - public void setContent(String content) { - this.content = content; - } + public void setContent(String content) { + this.content = content; + } - public List getParameters() { - return parameters; - } + public List getParameters() { + return parameters; + } - public void setParameters(List parameters) { - this.parameters = parameters; - } + public void setParameters(List parameters) { + this.parameters = parameters; + } - public Return getReturnValue() { - return returnValue; - } + public Return getReturnValue() { + return returnValue; + } - public void setReturnValue(Return returnValue) { - this.returnValue = returnValue; - } + public void setReturnValue(Return returnValue) { + this.returnValue = returnValue; + } - public List getTypeParameters() { - return typeParameters; - } + public List getTypeParameters() { + return typeParameters; + } - public void setTypeParameters(List typeParameters) { - this.typeParameters = typeParameters; - } + public void setTypeParameters(List typeParameters) { + this.typeParameters = typeParameters; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java index 4ee95c89..42ce1e0d 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocContents.java @@ -20,34 +20,51 @@ import java.util.List; public class TocContents { - private final String projectName; - private final List contents = new ArrayList<>(); - - public TocContents(String projectName, List items) { - this.projectName = projectName; - - if (projectName == null || projectName.equals("")) { - contents.addAll(items); - } else { - // only include product hierarchy and guides if projectName included - createTocContents(projectName, items); - } - } + private final String projectName; + private final List contents = new ArrayList<>(); - private void createTocContents(String projectName, List items) { - List tocItems = new ArrayList<>(); - // combine guides and tocItems - tocItems.add(new Guide("Version history", "history.md")); - tocItems.addAll(items); - // wrap guides + tocItems with product hierarchy - contents.add(new ProjectContents(projectName, tocItems)); - } + public TocContents( + String projectName, + boolean disableChangelog, + boolean disableLibraryOverview, + List items) { + this.projectName = projectName; - public List getContents() { - return contents; + if (projectName == null || projectName.equals("")) { + contents.addAll(items); + } else { + // only include product hierarchy and guides if projectName included + createTocContents(projectName, disableChangelog, disableLibraryOverview, items); } + } - public String getProjectName() { - return projectName; + private void createTocContents( + String projectName, + boolean disableChangelog, + boolean disableLibraryOverview, + List items) { + List tocItems = new ArrayList<>(); + // combine guides and tocItems + // If disableLibraryOverview is enabled, then generate old overview. Otherwise generate the new + // library overview. + if (!disableLibraryOverview) { + tocItems.add(new Guide("Overview", "overview.md")); + } else { + tocItems.add(new Guide("Overview", "overview.html")); + } + if (!disableChangelog) { + tocItems.add(new Guide("Version history", "history.md")); } -} \ No newline at end of file + tocItems.addAll(items); + // wrap guides + tocItems with product hierarchy + contents.add(new ProjectContents(projectName, tocItems)); + } + + public List getContents() { + return contents; + } + + public String getProjectName() { + return projectName; + } +} 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 cef0fb26..7919c2ca 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 @@ -1,42 +1,50 @@ package com.microsoft.model; import com.microsoft.util.YamlUtil; - 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 { - private final static String TOC_FILE_HEADER = "### YamlMime:TableOfContent\n"; - private final static String TOC_FILE_NAME = "toc.yml"; - private final String outputPath; - private final String projectName; - - public TocFile(String outputPath, String projectName) { - this.outputPath = outputPath; - this.projectName = projectName; - } - - public void addTocItem(TocItem packageTocItem) { - add(packageTocItem); - } - - protected void sortByUid() { - Collections.sort(this, Comparator.comparing(TocItem::getUid)); - } - - @Override - public String getFileContent() { - sortByUid(); - List tocContents = new TocContents(projectName, this).getContents(); - return TOC_FILE_HEADER + YamlUtil.objectToYamlString(tocContents); - } - - @Override - public String getFileNameWithPath() { - return outputPath + File.separator + TOC_FILE_NAME; - } + private static final String TOC_FILE_HEADER = "### YamlMime:TableOfContent\n"; + private static final String TOC_FILE_NAME = "toc.yml"; + private final String outputPath; + private final String projectName; + private final boolean disableChangelog; + + private final boolean disableLibraryOverview; + + public TocFile( + String outputPath, + String projectName, + boolean disableChangelog, + boolean disableLibraryOverview) { + this.outputPath = outputPath; + this.projectName = projectName; + this.disableChangelog = disableChangelog; + this.disableLibraryOverview = disableLibraryOverview; + } + + public void addTocItem(TocItem packageTocItem) { + add(packageTocItem); + } + + protected void sortByUid() { + Collections.sort(this, (a, b) -> a.getUid().compareToIgnoreCase(b.getUid())); + } + + @Override + public String getFileContent() { + sortByUid(); + List tocContents = + new TocContents(projectName, disableChangelog, disableLibraryOverview, this).getContents(); + return TOC_FILE_HEADER + YamlUtil.objectToYamlString(tocContents); + } + + @Override + public String getFileNameWithPath() { + return outputPath + File.separator + TOC_FILE_NAME; + } } 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 bdbd3b43..5b36c704 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,45 +1,70 @@ package com.microsoft.model; +import com.google.common.base.MoreObjects; import java.util.ArrayList; import java.util.List; public class TocItem { - private String uid; - private String name; - private String status; - private String heading; - private List items = new ArrayList<>(); + private String uid; + private String name; + private String status; - public TocItem(String uid, String name) { - this.uid = uid; - this.name = name; - } + private String href; - public TocItem(String uid, String name, String status) { - this.uid = uid; - this.name = name; - this.status = status; - } + private Boolean packageOverview = false; + private String heading; + private List items = new ArrayList<>(); - public TocItem(String heading) { - this.heading = heading; - } + public TocItem(String uid, String name) { + this.uid = uid; + this.name = name; + } - public String getUid() { - return uid; - } + public TocItem(String uid, String name, String href, boolean packageOverview) { + this.uid = uid; + this.name = name; + this.href = href; + this.packageOverview = packageOverview; + } - public String getName() { - return name; - } + public TocItem(String uid, String name, String status) { + this.uid = uid; + this.name = name; + this.status = status; + } - public List getItems() { - return items; - } + public TocItem(String heading) { + this.heading = heading; + } - public String getStatus() { return status; } + public String getHref() { + return href; + } - public String getHeading() { return heading; } + public String getUid() { + return uid; + } + + public String getName() { + return name; + } + + public List getItems() { + return items; + } + + public String getStatus() { + return status; + } + + 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/main/java/com/microsoft/model/TocTypeMap.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocTypeMap.java index 55c470d6..55cacb17 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocTypeMap.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TocTypeMap.java @@ -15,29 +15,39 @@ */ package com.microsoft.model; -import org.apache.commons.lang3.tuple.Pair; - -import javax.lang.model.element.ElementKind; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; +import javax.lang.model.element.ElementKind; public class TocTypeMap extends HashMap> { - public TocTypeMap() { - this.put(ElementKind.CLASS.name(), new ArrayList<>()); - this.put(ElementKind.INTERFACE.name(), new ArrayList<>()); - this.put(ElementKind.ENUM.name(), new ArrayList<>()); - this.put(ElementKind.ANNOTATION_TYPE.name(), new ArrayList<>()); - this.put("EXCEPTION", new ArrayList<>()); - } + public TocTypeMap() { + this.put(ElementKind.CLASS.name(), new ArrayList<>()); + this.put(ElementKind.INTERFACE.name(), new ArrayList<>()); + this.put(ElementKind.ENUM.name(), new ArrayList<>()); + this.put(ElementKind.ANNOTATION_TYPE.name(), new ArrayList<>()); + this.put("EXCEPTION", new ArrayList<>()); + } + + public List getTitleList() { + return List.of( + new KindTitle(ElementKind.INTERFACE.name(), "Interfaces"), + new KindTitle(ElementKind.CLASS.name(), "Classes"), + new KindTitle(ElementKind.ENUM.name(), "Enums"), + new KindTitle(ElementKind.ANNOTATION_TYPE.name(), "Annotation Types"), + new KindTitle("EXCEPTION", "Exceptions")); + } - public List getTitleList() { - return List.of( - new KindTitle(ElementKind.INTERFACE.name(), "Interfaces"), - new KindTitle(ElementKind.CLASS.name(), "Classes"), - new KindTitle(ElementKind.ENUM.name(), "Enums"), - new KindTitle(ElementKind.ANNOTATION_TYPE.name(),"Annotation Types"), - new KindTitle("EXCEPTION", "Exceptions")); - } + public List toList() { + return getTitleList().stream() + .filter(kindTitle -> get(kindTitle.getElementKind()).size() > 0) + .flatMap( + kindTitle -> { + get(kindTitle.getElementKind()).add(0, new TocItem(kindTitle.getTitle())); + return get(kindTitle.getElementKind()).stream(); + }) + .collect(Collectors.toList()); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TypeParameter.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TypeParameter.java index df2a5a3c..557c61b1 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TypeParameter.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/TypeParameter.java @@ -2,13 +2,13 @@ public class TypeParameter { - private final String id; + private final String id; - public TypeParameter(String id) { - this.id = id; - } + public TypeParameter(String id) { + this.id = id; + } - public String getId() { - return id; - } + public String getId() { + return id; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/YmlFile.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/YmlFile.java index 63c7554d..6743acc7 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/YmlFile.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/YmlFile.java @@ -2,7 +2,7 @@ public interface YmlFile { - String getFileContent(); + String getFileContent(); - String getFileNameWithPath(); + String getFileNameWithPath(); } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/CommentHelper.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/CommentHelper.java index f5dc9fed..eac5d636 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/CommentHelper.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/CommentHelper.java @@ -1,88 +1,86 @@ package com.microsoft.util; import com.sun.source.doctree.DocTree; - -import javax.lang.model.element.Element; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; +import javax.lang.model.element.Element; public class CommentHelper { - public Element element; - public List inlineTags = Collections.emptyList(); - private Utils utils; - private boolean hasInheritDocTag = false; - - public CommentHelper(Element element, Utils utils) { - this.element = element; - this.utils = utils; - this.inlineTags = utils.getFullBody(element); - this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); + public Element element; + public List inlineTags = Collections.emptyList(); + private Utils utils; + private boolean hasInheritDocTag = false; + + public CommentHelper(Element element, Utils utils) { + this.element = element; + this.utils = utils; + this.inlineTags = utils.getFullBody(element); + this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); + } + + public CommentHelper(Element element, Utils utils, List inlineTags) { + this.element = element; + this.utils = utils; + this.inlineTags = inlineTags; + this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); + } + + /** + * Returns true if the method has no comments, or a lone @inheritDoc. + * + * @return true if there are no comments, false otherwise + */ + public boolean isSimpleOverride() { + return inlineTags.isEmpty() || (inlineTags.size() == 1 && hasInheritDocTag); + } + + public boolean hasInheritDocTag() { + return this.hasInheritDocTag; + } + + public CommentHelper copy() { + if (this.element == null) { + throw new NullPointerException(); } + CommentHelper clone = new CommentHelper(this.element, this.utils); + return clone; + } - public CommentHelper(Element element, Utils utils, List inlineTags) { - this.element = element; - this.utils = utils; - this.inlineTags = inlineTags; - this.hasInheritDocTag = utils.hasInlineTag(inlineTags, DocTree.Kind.INHERIT_DOC); - } + public CommentHelper inherit(CommentHelper chInheritFrom) { + List mergedTags = new ArrayList<>(); - /** - * Returns true if the method has no comments, or a lone @inheritDoc. - * - * @return true if there are no comments, false otherwise - */ - public boolean isSimpleOverride() { - return inlineTags.isEmpty() || - (inlineTags.size() == 1 && hasInheritDocTag); + if (this.isSimpleOverride()) mergedTags = chInheritFrom.inlineTags; + else { + mergedTags = inheritInlineTags(this, chInheritFrom); } - public boolean hasInheritDocTag() { - return this.hasInheritDocTag; - } + return new CommentHelper(this.element, this.utils, mergedTags); + } - public CommentHelper copy() { - if (this.element == null) { - throw new NullPointerException(); - } - CommentHelper clone = new CommentHelper(this.element, this.utils); - return clone; + List inheritInlineTags(CommentHelper origin, CommentHelper chInheritFrom) { + List mergedTags = new ArrayList<>(); + if (!origin.isSimpleOverride() && !origin.hasInheritDocTag) { + return origin.inlineTags; } - public CommentHelper inherit(CommentHelper chInheritFrom) { - List mergedTags = new ArrayList<>(); + // Get the index of "{@inheritedDoc}". + int index = + origin.inlineTags.stream() + .map(e -> e.getKind()) + .collect(Collectors.toList()) + .indexOf(DocTree.Kind.INHERIT_DOC); - if (this.isSimpleOverride()) - mergedTags = chInheritFrom.inlineTags; - else { - mergedTags = inheritInlineTags(this, chInheritFrom); - } + // Replace the "{@inheritedDoc}" with inherited inlineTags. + mergedTags = origin.inlineTags.stream().collect(Collectors.toList()); + mergedTags.remove(index); - return new CommentHelper(this.element, this.utils, mergedTags); + for (DocTree d : chInheritFrom.inlineTags) { + mergedTags.add(index, d); + index++; } - List inheritInlineTags(CommentHelper origin, CommentHelper chInheritFrom) { - List mergedTags = new ArrayList<>(); - if (!origin.isSimpleOverride() && !origin.hasInheritDocTag) { - return origin.inlineTags; - } - - // Get the index of "{@inheritedDoc}". - int index = origin.inlineTags.stream().map(e -> e.getKind()) - .collect(Collectors.toList()) - .indexOf(DocTree.Kind.INHERIT_DOC); - - // Replace the "{@inheritedDoc}" with inherited inlineTags. - mergedTags = origin.inlineTags.stream().collect(Collectors.toList()); - mergedTags.remove(index); - - for (DocTree d : chInheritFrom.inlineTags - ) { - mergedTags.add(index, d); - index++; - } - - return mergedTags; - } + return mergedTags; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/ElementUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/ElementUtil.java index 54b8ac64..1212ce08 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/ElementUtil.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/ElementUtil.java @@ -1,56 +1,82 @@ package com.microsoft.util; -import org.apache.commons.lang3.StringUtils; - -import javax.lang.model.element.Element; -import javax.lang.model.element.PackageElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.ElementFilter; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import javax.lang.model.element.Element; +import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.ElementFilter; +import org.apache.commons.lang3.StringUtils; public class ElementUtil { - private final Set excludePackages = new HashSet<>(); - private final Set excludeClasses = new HashSet<>(); + private static final int INITIAL_CAPACITY = 1000000; + private final Set excludePackages = new HashSet<>(); + private final Set excludeClasses = new HashSet<>(); - public ElementUtil(String[] excludePackages, String[] excludeClasses) { - this.excludePackages.addAll(Stream.of(excludePackages) - .map(o -> Pattern.compile(o)).collect(Collectors.toSet())); - this.excludeClasses.addAll(Stream.of(excludeClasses) - .map(o -> Pattern.compile(o)).collect(Collectors.toSet())); - } + private final Map> elementMap; + private final Map> elementSortedMap; - public List extractSortedElements(Element element) { - // Need to apply sorting, because order of result items for Element.getEnclosedElements() depend on JDK implementation - // By default, exclude private and package-private items - // todo allow pass parameter for filter items by access modifiers - return ElementFilter.typesIn(element.getEnclosedElements()).stream() - .filter(o -> !Utils.isPrivateOrPackagePrivate(o)) - .filter(o -> !matchAnyPattern(excludeClasses, String.valueOf(o.getQualifiedName()))) - .sorted((o1, o2) -> - StringUtils.compare(String.valueOf(o1.getSimpleName()), String.valueOf(o2.getSimpleName())) - ).collect(Collectors.toList()); - } + public ElementUtil(String[] excludePackages, String[] excludeClasses) { + this.excludePackages.addAll( + Stream.of(excludePackages).map(o -> Pattern.compile(o)).collect(Collectors.toSet())); + this.excludeClasses.addAll( + Stream.of(excludeClasses).map(o -> Pattern.compile(o)).collect(Collectors.toSet())); + this.elementMap = new ConcurrentHashMap<>(INITIAL_CAPACITY); + this.elementSortedMap = new ConcurrentHashMap<>(INITIAL_CAPACITY); + } - public List extractPackageElements(Set elements) { - return ElementFilter.packagesIn(elements).stream() - .filter(o -> !matchAnyPattern(excludePackages, String.valueOf(o))) - .sorted((o1, o2) -> - StringUtils.compare(String.valueOf(o1.getSimpleName()), String.valueOf(o2.getSimpleName())) - ).collect(Collectors.toList()); - } + public List extractSortedElements(Element element) { + elementSortedMap.computeIfAbsent(element, this::extractSortedElementsInternal); + return elementSortedMap.get(element); + } + + private List extractSortedElementsInternal(Element element) { + // Need to apply sorting, because order of result items for Element.getEnclosedElements() depend + // on JDK implementation + // By default, exclude private and package-private items + // todo allow pass parameter for filter items by access modifiers + return ElementFilter.typesIn(getEnclosedElements(element)).stream() + .filter(o -> !Utils.isPrivateOrPackagePrivate(o)) + .filter(o -> !matchAnyPattern(excludeClasses, String.valueOf(o.getQualifiedName()))) + .sorted( + (o1, o2) -> + StringUtils.compare( + String.valueOf(o1.getSimpleName()), String.valueOf(o2.getSimpleName()))) + .collect(Collectors.toList()); + } + + public List getEnclosedElements(Element element) { + elementMap.computeIfAbsent(element, this::getEnclosedElementsInternal); + return elementMap.get(element); + } + + private List getEnclosedElementsInternal(Element element) { + return element.getEnclosedElements(); + } + + public List extractPackageElements(Set elements) { + return ElementFilter.packagesIn(elements).stream() + .filter(o -> !matchAnyPattern(excludePackages, String.valueOf(o))) + .sorted( + (o1, o2) -> + StringUtils.compare( + String.valueOf(o1.getSimpleName()), String.valueOf(o2.getSimpleName()))) + .collect(Collectors.toList()); + } - boolean matchAnyPattern(Set patterns, String stringToCheck) { - for (Pattern pattern : patterns) { - if (pattern.matcher(stringToCheck).matches()) { - return true; - } - } - return false; + boolean matchAnyPattern(Set patterns, String stringToCheck) { + for (Pattern pattern : patterns) { + if (pattern.matcher(stringToCheck).matches()) { + return true; + } } + return false; + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/FileUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/FileUtil.java index cbad4f7e..1d00bc67 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/FileUtil.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/FileUtil.java @@ -1,7 +1,8 @@ package com.microsoft.util; +import com.microsoft.build.PackageOverviewFile; +import com.microsoft.model.LibraryOverviewFile; import com.microsoft.model.YmlFile; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -9,21 +10,27 @@ public class FileUtil { - /** - * Dump string to file. Create required folders when needed - */ - public static void dumpToFile(String content, String fileName) { + /** Dump string to file. Create required folders when needed */ + public static void dumpToFile(String content, String fileName) { - try { - Path path = Paths.get(fileName); - Files.createDirectories(path.getParent()); - Files.write(path, content.getBytes()); - } catch (IOException ioe) { - throw new RuntimeException("Error during dump to file", ioe); - } + try { + Path path = Paths.get(fileName); + Files.createDirectories(path.getParent()); + Files.write(path, content.getBytes()); + } catch (IOException ioe) { + throw new RuntimeException("Error during dump to file", ioe); } + } - public static void dumpToFile(YmlFile ymlFile) { - dumpToFile(ymlFile.getFileContent(), ymlFile.getFileNameWithPath()); - } + public static void dumpToFile(YmlFile ymlFile) { + dumpToFile(ymlFile.getFileContent(), ymlFile.getFileNameWithPath()); + } + + public static void dumpToFile(LibraryOverviewFile libraryOverviewFile) { + dumpToFile(libraryOverviewFile.getFileContent(), libraryOverviewFile.getFileNameWithPath()); + } + + public static void dumpToFile(PackageOverviewFile packageOverviewFile) { + dumpToFile(packageOverviewFile.getFileContent(), packageOverviewFile.getFileNameWithPath()); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/OptionsFileUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/OptionsFileUtil.java index bd5f0c18..2605f2bc 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/OptionsFileUtil.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/OptionsFileUtil.java @@ -9,30 +9,32 @@ public class OptionsFileUtil { - public static String[] processOptionsFile(String filename) { - List jargs = new ArrayList<>(); + public static List processOptionsFile(String filename) { + List jargs = new ArrayList<>(); - String options = readOptionsFromFile(filename); - StringTokenizer tokens = new StringTokenizer(options); - while (tokens.hasMoreTokens()) { - jargs.add(tokens.nextToken()); - } - - return jargs.toArray(new String[0]); + String options = readOptionsFromFile(filename); + StringTokenizer tokens = new StringTokenizer(options); + while (tokens.hasMoreTokens()) { + jargs.add(tokens.nextToken()); } - private static String readOptionsFromFile(String filename) { - StringBuffer buffer = new StringBuffer(); - try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filename))) { - String line; - while ((line = bufferedReader.readLine()) != null) { - buffer.append(line).append("\n"); - } - } catch (IOException ioe) { - buffer.setLength(0); - throw new RuntimeException("Error during reading options from file", ioe); - } + return jargs; + } - return buffer.toString(); + private static String readOptionsFromFile(String filename) { + StringBuffer buffer = new StringBuffer(); + try (BufferedReader bufferedReader = new BufferedReader(new FileReader(filename))) { + String line; + while ((line = bufferedReader.readLine()) != null) { + // remove single quote at the head and tail + String trimmedLine = line.replaceAll("^'|'$", ""); + buffer.append(trimmedLine).append("\n"); + } + } catch (IOException ioe) { + buffer.setLength(0); + throw new RuntimeException("Error during reading options from file", ioe); } + + return buffer.toString(); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/Utils.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/Utils.java index ba155915..ebc67ef3 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/Utils.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/Utils.java @@ -1,261 +1,253 @@ package com.microsoft.util; +import static com.sun.source.doctree.DocTree.Kind.ERRONEOUS; +import static javax.lang.model.type.TypeKind.DECLARED; + import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocTree; -import jdk.javadoc.doclet.DocletEnvironment; - -import javax.lang.model.element.*; -import javax.lang.model.type.TypeKind; -import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.Elements; -import javax.lang.model.util.Types; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; - -import static com.sun.source.doctree.DocTree.Kind.ERRONEOUS; -import static javax.lang.model.type.TypeKind.DECLARED; +import javax.lang.model.element.*; +import javax.lang.model.type.TypeKind; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.Elements; +import javax.lang.model.util.Types; +import jdk.javadoc.doclet.DocletEnvironment; public class Utils { - public final DocletEnvironment docletEnvironment; - public final Elements elementUtils; - public final Types typeUtils; - - public Utils(DocletEnvironment docEnv) { - docletEnvironment = docEnv; - elementUtils = docEnv.getElementUtils(); - typeUtils = docEnv.getTypeUtils(); - } - - public static boolean isPackagePrivate(Element e) { - return !(isPublic(e) || isPrivate(e) || isProtected(e)); - } - - public static boolean isPrivate(Element e) { - return e.getModifiers().contains(Modifier.PRIVATE); - } - - public static boolean isProtected(Element e) { - return e.getModifiers().contains(Modifier.PROTECTED); - } - - public static boolean isPublic(Element e) { - return e.getModifiers().contains(Modifier.PUBLIC); - } - - public static boolean isPrivateOrPackagePrivate(Element e) { - return isPrivate(e) || isPackagePrivate(e); - } - - public static boolean isNoType(TypeMirror t) { - return t.getKind() == TypeKind.NONE; - } - - public boolean isStatic(Element e) { - return e.getModifiers().contains(Modifier.STATIC); - } - - /** - * Returns true if the method has no comments, or a lone @inheritDoc. - * - * @param m a method - * @return true if there are no comments, false otherwise - */ - public boolean isSimpleOverride(ExecutableElement m) { - - if (!getBlockTags(m).isEmpty()) - return false; - - List fullBody = getFullBody(m); - return fullBody.isEmpty() || - (fullBody.size() == 1 && fullBody.get(0).getKind().equals(DocTree.Kind.INHERIT_DOC)); - } - - public boolean hasInlineTag(List inlineTags, DocTree.Kind kind) { - for (DocTree dt : inlineTags) { - if (dt.getKind() == kind) { - return true; - } - } - return false; - } - - public Element getMemberBySignature(TypeElement te, ElementKind kind, String signature) { - return getMembers(te, kind).stream() - .filter(e -> e.toString().equals(signature)) - .findFirst().orElse(null); - } - - public TypeElement getObjectType() { - return elementUtils.getTypeElement("java.lang.Object"); - } - - /** - * Return the element of given type. - */ - public TypeElement asTypeElement(TypeMirror t) { - if (t.getKind() != TypeKind.NONE) { - TypeElement element = (TypeElement) docletEnvironment.getTypeUtils().asElement(t); - return element; - } else return null; - } - - /** - * Return the lexically enclosing element for a nested type. - * The inherited items will not be listed. - */ - public TypeElement getEnclosingTypeElement(Element e) { - if (e.getKind() == ElementKind.PACKAGE) - return null; - Element encl = e.getEnclosingElement(); - ElementKind kind = encl.getKind(); - if (kind == ElementKind.PACKAGE) - return null; - while (!(kind.isClass() || kind.isInterface())) { - encl = encl.getEnclosingElement(); - kind = encl.getKind(); - } - return (TypeElement) encl; - } - - /** - * Follow the same behavior with Standard doclet. - * Return the ExecutableElement being overridden by given method, - * when a method in a class overrides a method in a superclass. - * For following cases, they will be marked as "Specified by": - *
    - *
  • a method in an interface overrides a method in a superinterface
  • - *
  • a method in a class implements a method in an interface
  • - *
- * todo add "Specified by" to yaml. - */ - public ExecutableElement overriddenMethod(ExecutableElement method) { - if (isStatic(method)) { - return null; - } - final TypeElement origin = getEnclosingTypeElement(method); - for (TypeMirror t = getSuperType(origin); - t.getKind() == DECLARED; - t = getSuperType(asTypeElement(t))) { - TypeElement te = asTypeElement(t); - if (te == null) { - return null; - } - - for (Element e : getMembers(te, ElementKind.METHOD)) { - ExecutableElement ee = (ExecutableElement) e; - if (elementUtils.overrides(method, ee, origin) - ) { - return ee; - } - } - if (t.equals(getObjectType().asType())) - return null; - } + public final DocletEnvironment docletEnvironment; + public final Elements elements; + public final Types typeUtils; + private final ElementUtil elementUtil; + + public Utils(DocletEnvironment docEnv, ElementUtil elementUtil) { + this.docletEnvironment = docEnv; + this.elements = docEnv.getElementUtils(); + this.typeUtils = docEnv.getTypeUtils(); + this.elementUtil = elementUtil; + } + + public static boolean isPackagePrivate(Element e) { + return !(isPublic(e) || isPrivate(e) || isProtected(e)); + } + + public static boolean isPrivate(Element e) { + return e.getModifiers().contains(Modifier.PRIVATE); + } + + public static boolean isProtected(Element e) { + return e.getModifiers().contains(Modifier.PROTECTED); + } + + public static boolean isPublic(Element e) { + return e.getModifiers().contains(Modifier.PUBLIC); + } + + public static boolean isPrivateOrPackagePrivate(Element e) { + return isPrivate(e) || isPackagePrivate(e); + } + + public static boolean isNoType(TypeMirror t) { + return t.getKind() == TypeKind.NONE; + } + + public boolean isStatic(Element e) { + return e.getModifiers().contains(Modifier.STATIC); + } + + /** + * Returns true if the method has no comments, or a lone @inheritDoc. + * + * @param m a method + * @return true if there are no comments, false otherwise + */ + public boolean isSimpleOverride(ExecutableElement m) { + + if (!getBlockTags(m).isEmpty()) return false; + + List fullBody = getFullBody(m); + return fullBody.isEmpty() + || (fullBody.size() == 1 && fullBody.get(0).getKind().equals(DocTree.Kind.INHERIT_DOC)); + } + + public boolean hasInlineTag(List inlineTags, DocTree.Kind kind) { + for (DocTree dt : inlineTags) { + if (dt.getKind() == kind) { + return true; + } + } + return false; + } + + public Element getMemberBySignature(TypeElement te, ElementKind kind, String signature) { + return getMembers(te, kind).stream() + .filter(e -> e.toString().equals(signature)) + .findFirst() + .orElse(null); + } + + public TypeElement getObjectType() { + return elements.getTypeElement("java.lang.Object"); + } + + /** Return the element of given type. */ + public TypeElement asTypeElement(TypeMirror t) { + if (t.getKind() != TypeKind.NONE) { + TypeElement element = (TypeElement) docletEnvironment.getTypeUtils().asElement(t); + return element; + } else return null; + } + + /** + * Return the lexically enclosing element for a nested type. The inherited items will not be + * listed. + */ + public TypeElement getEnclosingTypeElement(Element e) { + if (e.getKind() == ElementKind.PACKAGE) return null; + Element encl = e.getEnclosingElement(); + ElementKind kind = encl.getKind(); + if (kind == ElementKind.PACKAGE) return null; + while (!(kind.isClass() || kind.isInterface())) { + encl = encl.getEnclosingElement(); + kind = encl.getKind(); + } + return (TypeElement) encl; + } + + /** + * Follow the same behavior with Standard doclet. Return the ExecutableElement being overridden by + * given method, when a method in a class overrides a method in a superclass. For following cases, + * they will be marked as "Specified by": + * + *
    + *
  • a method in an interface overrides a method in a superinterface + *
  • a method in a class implements a method in an interface + *
+ * + * todo add "Specified by" to yaml. + */ + public ExecutableElement overriddenMethod(ExecutableElement method) { + if (isStatic(method)) { + return null; + } + final TypeElement origin = getEnclosingTypeElement(method); + for (TypeMirror t = getSuperType(origin); + t.getKind() == DECLARED; + t = getSuperType(asTypeElement(t))) { + TypeElement te = asTypeElement(t); + if (te == null) { return null; - } + } - public TypeMirror getSuperType(TypeElement te) { - TypeMirror t = te.getSuperclass(); - return getType(t); - } - - private TypeMirror getType(TypeMirror t) { - return (isNoType(t)) ? getObjectType().asType() : t; - } - - public Optional getDocCommentTree(Element element) { - return Optional.ofNullable(docletEnvironment.getDocTrees().getDocCommentTree(element)); - } - - protected List getFullBody(Element element) { - return getDocCommentTree(element) - .map(DocCommentTree::getFullBody) - .orElse(Collections.emptyList()); - } - - public static List filteredList(List dlist, DocTree.Kind... select) { - List list = new ArrayList<>(); - if (select == null) - return dlist; - for (DocTree dt : dlist) { - if (dt.getKind() != ERRONEOUS) { - for (DocTree.Kind kind : select) { - if (dt.getKind() == kind) { - list.add(dt); - } - } - } + for (Element e : getMembers(te, ElementKind.METHOD)) { + ExecutableElement ee = (ExecutableElement) e; + if (elements.overrides(method, ee, origin)) { + return ee; } - return list; - } - - private List getBlockTags0(Element element, DocTree.Kind... kinds) { - Optional dcTree = getDocCommentTree(element); - if (dcTree.isEmpty()) - return Collections.emptyList(); - - return filteredList(dcTree.get().getBlockTags(), kinds); - } - - public List getBlockTags(Element element) { - return getBlockTags0(element, (DocTree.Kind[]) null); - } - - public List removeBlockTag(List dctree, DocTree.Kind kind) { - return dctree.stream() - .filter(dc -> !dc.getKind().equals(kind)) - .collect(Collectors.toList()); - } - - /** - * Returns a list of visible enclosed members of given kind, - * declared in this type element, and does not include - * any inherited members or extra members. - * - * @return a list of visible enclosed members in this type - */ - public List getMembers(TypeElement te, ElementKind kind) { - return te.getEnclosedElements().stream() - .filter(e -> e.getKind() == kind && !isPrivateOrPackagePrivate(e)) - .collect(Collectors.toList()); - } - - /** - * Returns a list of methods being implemented by given method. - * When a method in an interface overrides a method its superinterface, - * it will be considered as "implemented", instead of "overridden". - * - * @return a list of implemented methods - */ - public List getImplementedMethods(String signature, TypeElement encl, List implementedMethods) { - if (encl == null) { - return implementedMethods; + } + if (t.equals(getObjectType().asType())) return null; + } + return null; + } + + public TypeMirror getSuperType(TypeElement te) { + TypeMirror t = te.getSuperclass(); + return getType(t); + } + + private TypeMirror getType(TypeMirror t) { + return (isNoType(t)) ? getObjectType().asType() : t; + } + + public Optional getDocCommentTree(Element element) { + return Optional.ofNullable(docletEnvironment.getDocTrees().getDocCommentTree(element)); + } + + protected List getFullBody(Element element) { + return getDocCommentTree(element) + .map(DocCommentTree::getFullBody) + .orElse(Collections.emptyList()); + } + + public static List filteredList( + List dlist, DocTree.Kind... select) { + List list = new ArrayList<>(); + if (select == null) return dlist; + for (DocTree dt : dlist) { + if (dt.getKind() != ERRONEOUS) { + for (DocTree.Kind kind : select) { + if (dt.getKind() == kind) { + list.add(dt); + } } - - for (TypeElement interfaceType : getImplementedInterfaces(encl)) { - Element implementedMethod = getMemberBySignature(interfaceType, ElementKind.METHOD, signature); - if (implementedMethod != null) { - implementedMethods.add(implementedMethod); - } - // We need to search every implemented interface of the Inheritance chain. - getImplementedMethods(signature, interfaceType, implementedMethods); - } - return implementedMethods; - } - - /** - * Returns a list of implemented interface type elements of given type element. - * Follow Standard doclet, search in the order of appearance following the word implements in declaration. - * - * @return a list of implemented interfaces - */ - public List getImplementedInterfaces(TypeElement element) { - return element.getInterfaces().stream() - .map(e -> asTypeElement(e)) - .collect(Collectors.toList()); - } + } + } + return list; + } + + private List getBlockTags0(Element element, DocTree.Kind... kinds) { + Optional dcTree = getDocCommentTree(element); + if (dcTree.isEmpty()) return Collections.emptyList(); + + return filteredList(dcTree.get().getBlockTags(), kinds); + } + + public List getBlockTags(Element element) { + return getBlockTags0(element, (DocTree.Kind[]) null); + } + + public List removeBlockTag(List dctree, DocTree.Kind kind) { + return dctree.stream().filter(dc -> !dc.getKind().equals(kind)).collect(Collectors.toList()); + } + + /** + * Returns a list of visible enclosed members of given kind, declared in this type element, and + * does not include any inherited members or extra members. + * + * @return a list of visible enclosed members in this type + */ + public List getMembers(TypeElement te, ElementKind kind) { + return elementUtil.getEnclosedElements(te).stream() + .filter(e -> e.getKind() == kind && !isPrivateOrPackagePrivate(e)) + .collect(Collectors.toList()); + } + + /** + * Returns a list of methods being implemented by given method. When a method in an interface + * overrides a method its superinterface, it will be considered as "implemented", instead of + * "overridden". + * + * @return a list of implemented methods + */ + public List getImplementedMethods( + String signature, TypeElement encl, List implementedMethods) { + if (encl == null) { + return implementedMethods; + } + + for (TypeElement interfaceType : getImplementedInterfaces(encl)) { + Element implementedMethod = + getMemberBySignature(interfaceType, ElementKind.METHOD, signature); + if (implementedMethod != null) { + implementedMethods.add(implementedMethod); + } + // We need to search every implemented interface of the Inheritance chain. + getImplementedMethods(signature, interfaceType, implementedMethods); + } + return implementedMethods; + } + + /** + * Returns a list of implemented interface type elements of given type element. Follow Standard + * doclet, search in the order of appearance following the word implements in declaration. + * + * @return a list of implemented interfaces + */ + public List getImplementedInterfaces(TypeElement element) { + return element.getInterfaces().stream().map(e -> asTypeElement(e)).collect(Collectors.toList()); + } } diff --git a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java index dad67134..5a4f8f0f 100644 --- a/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/util/YamlUtil.java @@ -8,30 +8,38 @@ import org.apache.commons.lang3.StringUtils; public class YamlUtil { - private static final ObjectMapper mapper = new ObjectMapper(new YAMLFactory() - .disable(Feature.WRITE_DOC_START_MARKER) - .disable(Feature.SPLIT_LINES) - ) - .setSerializationInclusion(Include.NON_NULL) - .setSerializationInclusion(Include.NON_EMPTY); + private static final ObjectMapper mapper = + new ObjectMapper( + new YAMLFactory() + .disable(Feature.WRITE_DOC_START_MARKER) + .disable(Feature.SPLIT_LINES)) + .setSerializationInclusion(Include.NON_NULL) + .setSerializationInclusion(Include.NON_EMPTY); - public static String objectToYamlString(Object object) { - try { - return mapper.writeValueAsString(object); - } catch (JsonProcessingException jpe) { - throw new RuntimeException("Could not serialize object to yaml string", jpe); - } + public static String objectToYamlString(Object object) { + try { + return mapper.writeValueAsString(object); + } catch (JsonProcessingException jpe) { + throw new RuntimeException("Could not serialize object to yaml string", jpe); } + } - public static String cleanupHtml(String text) { - if (StringUtils.isBlank(text)) { - return text; - } - return text.replaceAll("
([^<]+)
","$1") - .replaceAll("
", "
")
-                .replaceAll("`([^`]+)`", "$1")
-                .replaceAll("\\[([^]]+)]\\(([^)]+)\\)", "$1")
-                .replaceAll("\\[([^]]+)]\\[([^]]+)\\]", "$1")
-                .replaceAll("==+([^=]+)==+", "

$1

"); + public static String cleanupHtml(String text) { + if (StringUtils.isBlank(text)) { + return text; } + return text.replaceAll("
([^<]+)
", "$1") + .replaceAll("
", "
")
+        .replaceAll("<([A-Z][^<]+||)>", "<$1>")
+        .replaceAll("`([^`]+)`", "$1")
+        .replaceAll("\\[([^]]+)]\\(([^)]+)\\)", "$1")
+        .replaceAll("\\{@link *\"([^\\{]+)\" *\\}", "$1")
+        .replaceAll(
+            "\\[([^]]+)]\\[([^]]+)\\]",
+            "$1")
+        .replaceAll(
+            "\\{@link *([^\\{\"]+) *\\}",
+            "$1")
+        .replaceAll("=======================([^=]+)=======================", "

$1

"); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/google/docfx/doclet/RepoMetadataTest.java b/third_party/docfx-doclet-143274/src/test/java/com/google/docfx/doclet/RepoMetadataTest.java new file mode 100644 index 00000000..3b7d3317 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/google/docfx/doclet/RepoMetadataTest.java @@ -0,0 +1,29 @@ +package com.google.docfx.doclet; + +import static org.junit.Assert.assertEquals; + +import com.google.gson.Gson; +import org.junit.Test; + +public class RepoMetadataTest { + + @Test + public void testParseWithLibraryPathOverrides() { + String json = + "{ " + + "\"distribution_name\": \"com.google.cloud:google-cloud-firestore\", " + + "\"library_path_overrides\": { " + + " \"FirestoreAdminClient\": \"google-cloud-firestore-admin\" " + + "}, " + + "\"repo\": \"googleapis/java-firestore\" " + + "}"; + + RepoMetadata metadata = new Gson().fromJson(json, RepoMetadata.class); + + assertEquals("google-cloud-firestore", metadata.getArtifactId()); + // Verify the map is populated correctly + assertEquals( + "google-cloud-firestore-admin", + metadata.getLibraryPathOverrides().get("FirestoreAdminClient")); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/BuilderUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/BuilderUtilTest.java new file mode 100644 index 00000000..b64e5fc7 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/BuilderUtilTest.java @@ -0,0 +1,140 @@ +/* + * 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.build; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.model.MethodParameter; +import com.microsoft.model.Syntax; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Test; + +public class BuilderUtilTest { + @Test + public void populateUidValues() { + MetadataFile classMetadataFile = new MetadataFile("output", "name"); + + MetadataFileItem ownerClassItem = + buildMetadataFileItem("a.b.OwnerClass", "Not important summary value"); + ownerClassItem.setNameWithType("OwnerClass"); + MetadataFileItem item1 = buildMetadataFileItem("UID unknown class", "UnknownClass"); + populateSyntax(item1, "SomeClass#someMethod(String param)"); + MetadataFileItem item2 = + buildMetadataFileItem("UID known class", "SomeClass#someMethod(String param)"); + MetadataFileItem item3 = + buildMetadataFileItem("UID method only", "#someMethod2(String p1, String p2)"); + classMetadataFile.getItems().addAll(Arrays.asList(ownerClassItem, item1, item2, item3)); + + MetadataFileItem reference1 = new MetadataFileItem("a.b.SomeClass.someMethod(String param)"); + reference1.setNameWithType("SomeClass.someMethod(String param)"); + MetadataFileItem reference2 = + new MetadataFileItem("a.b.OwnerClass.someMethod2(String p1, String p2)"); + reference2.setNameWithType("OwnerClass.someMethod2(String p1, String p2)"); + classMetadataFile.getReferences().addAll(Arrays.asList(reference1, reference2)); + + BuilderUtil.populateUidValues(Collections.emptyList(), Arrays.asList(classMetadataFile)); + + assertEquals( + "Wrong summary for unknown class", + item1.getSummary(), + "Bla bla UnknownClass bla"); + assertEquals( + "Wrong syntax description", + item1.getSyntax().getParameters().get(0).getDescription(), + "One two SomeClass#someMethod(String param) three"); + assertEquals( + "Wrong summary for known class", + item2.getSummary(), + "Bla bla SomeClass#someMethod(String param) bla"); + assertEquals( + "Wrong summary for method", + item3.getSummary(), + "Bla bla #someMethod2(String p1, String p2) bla"); + } + + private MetadataFileItem buildMetadataFileItem(String uid, String value) { + MetadataFileItem item = new MetadataFileItem(uid); + item.setSummary( + String.format( + "Bla bla %s bla", + value, value)); + return item; + } + + private void populateSyntax(MetadataFileItem item, String value) { + Syntax syntax = new Syntax(); + String methodParamDescription = + String.format( + "One two %s three", + value, value); + syntax.setParameters( + Arrays.asList( + new MethodParameter("method param id", "method param type", methodParamDescription))); + item.setSyntax(syntax); + } + + @Test + public void determineUidByLinkContent() { + Map lookup = + new HashMap<>() { + { + put("SomeClass", "a.b.c.SomeClass"); + put("SomeClass.someMethod()", "a.b.c.SomeClass.someMethod()"); + put("SomeClass.someMethod(String param)", "a.b.c.SomeClass.someMethod(String param)"); + } + }; + + LookupContext lookupContext = new LookupContext(lookup, lookup); + assertEquals( + "Wrong result for class", + BuilderUtil.resolveUidByLookup("SomeClass", lookupContext), + "a.b.c.SomeClass"); + assertEquals( + "Wrong result for method", + BuilderUtil.resolveUidFromLinkContent("SomeClass#someMethod()", lookupContext), + "a.b.c.SomeClass.someMethod()"); + assertEquals( + "Wrong result for method with param", + BuilderUtil.resolveUidFromLinkContent("SomeClass#someMethod(String param)", lookupContext), + "a.b.c.SomeClass.someMethod(String param)"); + + assertEquals( + "Wrong result for unknown class", + BuilderUtil.resolveUidByLookup("UnknownClass", lookupContext), + ""); + assertEquals("Wrong result for null", BuilderUtil.resolveUidByLookup(null, lookupContext), ""); + assertEquals( + "Wrong result for whitespace", BuilderUtil.resolveUidByLookup(" ", lookupContext), ""); + } + + @Test + public void splitUidWithGenericsIntoClassNames() { + List result = + BuilderUtil.splitUidWithGenericsIntoClassNames("a.b.c.List>"); + + assertEquals("Wrong result list size", result.size(), 3); + assertTrue("Wrong result list content", result.contains("a.b.c.List")); + assertTrue("Wrong result list content", result.contains("df.mn.ClassOne")); + assertTrue("Wrong result list content", result.contains("tr.T")); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ClassBuilderTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ClassBuilderTest.java new file mode 100644 index 00000000..a09a5371 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ClassBuilderTest.java @@ -0,0 +1,140 @@ +/* + * 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.build; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + +import com.google.docfx.doclet.RepoMetadata; +import com.google.testing.compile.CompilationRule; +import com.microsoft.lookup.ClassItemsLookup; +import com.microsoft.lookup.ClassLookup; +import com.microsoft.lookup.PackageLookup; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.util.ElementUtil; +import com.sun.source.util.DocTrees; +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import javax.lang.model.element.Name; // Required for mocking getSimpleName() +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; +import jdk.javadoc.doclet.DocletEnvironment; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.mockito.Mockito; + +public class ClassBuilderTest { + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private ClassBuilder classBuilder; + private DocletEnvironment environment; + private DocTrees docTrees; + + @Before + public void setup() { + elements = rule.getElements(); + environment = Mockito.mock(DocletEnvironment.class); + docTrees = Mockito.mock(DocTrees.class); + ElementUtil elementUtil = new ElementUtil(new String[0], new String[0]); + ClassLookup classLookup = new ClassLookup(environment, elementUtil); + PackageLookup packageLookup = new PackageLookup(environment); + classBuilder = + new ClassBuilder( + elementUtil, + classLookup, + new ClassItemsLookup(environment, elementUtil), + "./target", + packageLookup, + new ReferenceBuilder(environment, classLookup, elementUtil)); + } + + @Test + public void addConstructorsInfoWhenOnlyDefaultConstructor() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + MetadataFile container = new MetadataFile("output", "name"); + when(environment.getElementUtils()).thenReturn(elements); + when(environment.getDocTrees()).thenReturn(docTrees); + + classBuilder.addConstructorsInfo(element, container); + + assertEquals( + "Wrong file name", container.getFileNameWithPath(), "output" + File.separator + "name"); + assertEquals("Container should contain constructor item", container.getItems().size(), 1); + } + + @Test + public void addConstructorsInfo() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + MetadataFile container = new MetadataFile("output", "name"); + when(environment.getElementUtils()).thenReturn(elements); + when(environment.getDocTrees()).thenReturn(docTrees); + + classBuilder.addConstructorsInfo(element, container); + + assertEquals( + "Wrong file name", container.getFileNameWithPath(), "output" + File.separator + "name"); + Collection constructorItems = container.getItems(); + assertEquals("Container should contain 2 constructor items", constructorItems.size(), 2); + } + + @Test + public void createClientOverviewTable_usesLibraryPathOverride() { + // 1. Setup Mock RepoMetadata + RepoMetadata repoMetadata = new RepoMetadata(); + repoMetadata.setRepo("googleapis/java-firestore"); + repoMetadata.setDistributionName("com.google.cloud:google-cloud-firestore:1.0.0"); + + Map overrides = new HashMap<>(); + overrides.put("FirestoreAdminClient", "google-cloud-firestore-admin"); + repoMetadata.setLibraryPathOverrides(overrides); + + // 2. Mock ClassLookup and Element + ClassLookup classLookup = Mockito.mock(ClassLookup.class); + TypeElement classElement = Mockito.mock(TypeElement.class); + + Name simpleName = Mockito.mock(Name.class); + when(simpleName.toString()).thenReturn("FirestoreAdminClient"); + when(classElement.getSimpleName()).thenReturn(simpleName); + + when(classLookup.extractUid(classElement)) + .thenReturn("com.google.cloud.firestore.v1.FirestoreAdminClient"); + + // 3. Test + ClassBuilder builder = new ClassBuilder(null, classLookup, null, null, null, null); + + try { + java.lang.reflect.Method method = + ClassBuilder.class.getDeclaredMethod( + "createClientOverviewTable", TypeElement.class, RepoMetadata.class); + method.setAccessible(true); + String html = (String) method.invoke(builder, classElement, repoMetadata); + + // 4. Verify link contains "google-cloud-firestore-admin" and the double slash "//" + assertTrue( + "Link should use the override directory", + html.contains( + "googleapis/java-firestore/tree/main//google-cloud-firestore-admin/src/main/java")); + + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupContextTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupContextTest.java index 1c8872b3..b634e355 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupContextTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupContextTest.java @@ -1,52 +1,53 @@ package com.microsoft.build; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.*; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; - -import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; public class LookupContextTest { - private LookupContext lookupContext; - private Map globalLookup = new HashMap<>(); - private Map localLookup = new LinkedHashMap<>(); - private String[] localKeys = {"local key 1", "local key 2"}; - private String[] localValues = {"local value 1", "local value 2"}; - private String globalKey = "global key"; - private String globalValue = "global value"; - private String unknownKey = "unknown key"; - - @Before - public void setUp() { - localLookup.put(localKeys[0], localValues[0]); - localLookup.put(localKeys[1], localValues[1]); - globalLookup.put(globalKey, globalValue); - globalLookup.putAll(localLookup); - lookupContext = new LookupContext(globalLookup, localLookup); - } - - @Test - public void resolve() { - assertEquals("Wrong value for global key", lookupContext.resolve(globalKey), globalValue); - assertEquals("Wrong value for local key 1", lookupContext.resolve(localKeys[0]), localValues[0]); - assertEquals("Wrong value for local key 2", lookupContext.resolve(localKeys[1]), localValues[1]); - assertNull("Wrong value for unknown key", lookupContext.resolve(unknownKey)); - } - - @Test - public void getOwnerUid() { - assertEquals("Wrong ownerUid", lookupContext.getOwnerUid(), localKeys[0]); - } - - @Test - public void containsKey() { - assertTrue("Wrong value for global key", lookupContext.containsKey(globalKey)); - assertTrue("Wrong value for local key 1", lookupContext.containsKey(localKeys[0])); - assertTrue("Wrong value for local key 2", lookupContext.containsKey(localKeys[1])); - assertFalse("Wrong value for unknown key", lookupContext.containsKey(unknownKey)); - } + private LookupContext lookupContext; + private Map globalLookup = new HashMap<>(); + private Map localLookup = new LinkedHashMap<>(); + private String[] localKeys = {"local key 1", "local key 2"}; + private String[] localValues = {"local value 1", "local value 2"}; + private String globalKey = "global key"; + private String globalValue = "global value"; + private String unknownKey = "unknown key"; + + @Before + public void setUp() { + localLookup.put(localKeys[0], localValues[0]); + localLookup.put(localKeys[1], localValues[1]); + globalLookup.put(globalKey, globalValue); + globalLookup.putAll(localLookup); + lookupContext = new LookupContext(globalLookup, localLookup); + } + + @Test + public void resolve() { + assertEquals("Wrong value for global key", lookupContext.resolve(globalKey), globalValue); + assertEquals( + "Wrong value for local key 1", lookupContext.resolve(localKeys[0]), localValues[0]); + assertEquals( + "Wrong value for local key 2", lookupContext.resolve(localKeys[1]), localValues[1]); + assertNull("Wrong value for unknown key", lookupContext.resolve(unknownKey)); + } + + @Test + public void getOwnerUid() { + assertEquals("Wrong ownerUid", lookupContext.getOwnerUid(), localKeys[0]); + } + + @Test + public void containsKey() { + assertTrue("Wrong value for global key", lookupContext.containsKey(globalKey)); + assertTrue("Wrong value for local key 1", lookupContext.containsKey(localKeys[0])); + assertTrue("Wrong value for local key 2", lookupContext.containsKey(localKeys[1])); + assertFalse("Wrong value for unknown key", lookupContext.containsKey(unknownKey)); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupTest.java index a3e85226..60de26bc 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/LookupTest.java @@ -1,84 +1,93 @@ package com.microsoft.build; +import static org.junit.Assert.*; + import com.microsoft.model.MetadataFile; import com.microsoft.model.MetadataFileItem; -import org.junit.Before; -import org.junit.Test; - import java.util.ArrayList; import java.util.List; - -import static org.junit.Assert.*; +import org.junit.Before; +import org.junit.Test; public class LookupTest { - private Lookup lookup; - private String packageUid = "package uid"; - private String packageNameWithType = "package name with type"; - private String classUid = "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String,boolean)"; - private String classNameWithType = "Person.setFirstName(String firstName, boolean flag)"; + private Lookup lookup; + private String packageUid = "package uid"; + private String packageNameWithType = "package name with type"; + private String classUid = + "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String,boolean)"; + private String classNameWithType = "Person.setFirstName(String firstName, boolean flag)"; - private List packageFiles = new ArrayList<>() {{ - MetadataFile packageFile = new MetadataFile("package path", "package name"); - packageFile.getItems().add(buildMetadataFileItem(packageUid, packageNameWithType)); - add(packageFile); - }}; - private List classFiles = new ArrayList<>() {{ - MetadataFile classFile = new MetadataFile("class path", "class name"); - classFile.getItems().add(buildMetadataFileItem(classUid, classNameWithType)); - add(classFile); - }}; + private List packageFiles = + new ArrayList<>() { + { + MetadataFile packageFile = new MetadataFile("package path", "package name"); + packageFile.getItems().add(buildMetadataFileItem(packageUid, packageNameWithType)); + add(packageFile); + } + }; + private List classFiles = + new ArrayList<>() { + { + MetadataFile classFile = new MetadataFile("class path", "class name"); + classFile.getItems().add(buildMetadataFileItem(classUid, classNameWithType)); + add(classFile); + } + }; - @Before - public void setUp() { - lookup = new Lookup(packageFiles, classFiles); - } + @Before + public void setUp() { + lookup = new Lookup(packageFiles, classFiles); + } - @Test - public void buildContext() { - LookupContext context = lookup.buildContext(classFiles.get(0)); + @Test + public void buildContext() { + LookupContext context = lookup.buildContext(classFiles.get(0)); - String[] localKeys = { - // Uid as is - "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String,boolean)", - // Uid as is with spaces between params - "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean)", - // Uid with param types without package - "com.microsoft.samples.subpackage.Person.setFirstName(String,boolean)", - // Uid with param types without package with spaces between params - "com.microsoft.samples.subpackage.Person.setFirstName(String, boolean)", - // Uid without package - "Person.setFirstName(java.lang.String,boolean)", - // Uid without package with spaces between params - "Person.setFirstName(java.lang.String, boolean)", + String[] localKeys = { + // Uid as is + "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String,boolean)", + // Uid as is with spaces between params + "com.microsoft.samples.subpackage.Person.setFirstName(java.lang.String, boolean)", + // Uid with param types without package + "com.microsoft.samples.subpackage.Person.setFirstName(String,boolean)", + // Uid with param types without package with spaces between params + "com.microsoft.samples.subpackage.Person.setFirstName(String, boolean)", + // Uid without package + "Person.setFirstName(java.lang.String,boolean)", + // Uid without package with spaces between params + "Person.setFirstName(java.lang.String, boolean)", - // Name with type as is - "Person.setFirstName(String, boolean)", - // Name with type without generics - "Person.setFirstName(String firstName, boolean flag)", - // Name with type without generics and param names - "Person.setFirstName(String, boolean)", - // Name with type without generics and param names without spaces between params - "Person.setFirstName(String,boolean)" - }; - assertEquals("Wrong owner uid", context.getOwnerUid(), "Person.setFirstName(String firstName, boolean flag)"); + // Name with type as is + "Person.setFirstName(String, boolean)", + // Name with type without generics + "Person.setFirstName(String firstName, boolean flag)", + // Name with type without generics and param names + "Person.setFirstName(String, boolean)", + // Name with type without generics and param names without spaces between params + "Person.setFirstName(String,boolean)" + }; + assertEquals( + "Wrong owner uid", + context.getOwnerUid(), + "Person.setFirstName(String firstName, boolean flag)"); - for (String localKey : localKeys) { - assertTrue("Context should contain local key=" + localKey, context.containsKey(localKey)); - assertEquals("Wrong value for local key=" + localKey, context.resolve(localKey), classUid); - } + for (String localKey : localKeys) { + assertTrue("Context should contain local key=" + localKey, context.containsKey(localKey)); + assertEquals("Wrong value for local key=" + localKey, context.resolve(localKey), classUid); + } - assertTrue("Context should contain global key", context.containsKey(packageNameWithType)); - assertTrue("Context should contain global value as a key", context.containsKey(packageUid)); - assertEquals("Wrong value for global key", context.resolve(packageNameWithType), packageUid); - assertEquals("Wrong value for local value as a key", context.resolve(packageUid), packageUid); + assertTrue("Context should contain global key", context.containsKey(packageNameWithType)); + assertTrue("Context should contain global value as a key", context.containsKey(packageUid)); + assertEquals("Wrong value for global key", context.resolve(packageNameWithType), packageUid); + assertEquals("Wrong value for local value as a key", context.resolve(packageUid), packageUid); - assertFalse("Context shouldn't contain unknown key", context.containsKey("unknown key")); - } + assertFalse("Context shouldn't contain unknown key", context.containsKey("unknown key")); + } - private MetadataFileItem buildMetadataFileItem(String uid, String nameWithType) { - MetadataFileItem result = new MetadataFileItem(uid); - result.setNameWithType(nameWithType); - return result; - } + private MetadataFileItem buildMetadataFileItem(String uid, String nameWithType) { + MetadataFileItem result = new MetadataFileItem(uid); + result.setNameWithType(nameWithType); + return result; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/PackageOverviewFileTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/PackageOverviewFileTest.java new file mode 100644 index 00000000..9a7ca4a2 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/PackageOverviewFileTest.java @@ -0,0 +1,61 @@ +package com.microsoft.build; + +import static com.microsoft.build.PackageOverviewFile.extractPackageBaseURIBeforeVersion; +import static org.junit.Assert.assertEquals; + +import com.google.common.collect.ImmutableList; +import com.google.testing.compile.CompilationRule; +import java.util.regex.Pattern; +import javax.lang.model.element.PackageElement; +import javax.lang.model.util.Elements; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; + +public class PackageOverviewFileTest { + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + + @Before + public void setup() { + elements = rule.getElements(); + PackageElement element = elements.getPackageElement("com.microsoft.samples"); + } + + @Test + public void testExtractPackageBaseURIBeforeVersion() { + Pattern pattern = Pattern.compile("(.*?)(v\\d+.*?)(?:\\.|$)"); + String packageName = "com.google.cloud.speech.v1"; + ImmutableList packageInfo_1 = extractPackageBaseURIBeforeVersion(packageName, pattern); + assertEquals("com.google.cloud.speech.", packageInfo_1.get(0)); + assertEquals("v1", packageInfo_1.get(1)); + + packageName = "com.google.cloud.speech.v1p5"; + ImmutableList packageInfo_2 = extractPackageBaseURIBeforeVersion(packageName, pattern); + assertEquals("com.google.cloud.speech.", packageInfo_2.get(0)); + assertEquals("v1p5", packageInfo_2.get(1)); + + packageName = "com.google.cloud.speech.v2.stub"; + ImmutableList packageInfo_3 = extractPackageBaseURIBeforeVersion(packageName, pattern); + assertEquals("com.google.cloud.speech.", packageInfo_3.get(0)); + assertEquals("v2", packageInfo_3.get(1)); + + packageName = "com.google.cloud.speech.velocity"; + ImmutableList packageInfo_4 = extractPackageBaseURIBeforeVersion(packageName, pattern); + assertEquals("N/A", packageInfo_4.get(0)); + assertEquals("N/A", packageInfo_4.get(1)); + } + + @Test + public void testWithLineBreaks() { + String uid = + "com.google.cloud.securitycenter.v2.AttackPathName.OrganizationLocationSimulationValuedResourceAttackPathBuilder"; + String converted = PackageOverviewFile.withLineBreaks(uid); + assertEquals( + "com.google.cloud.securitycenter.v2.AttackPathName.OrganizationLocationSimulationValuedResourceAttackPathBuilder", + converted); + + String nonMatchable = "123non-matchable"; + assertEquals(nonMatchable, PackageOverviewFile.withLineBreaks(nonMatchable)); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ReferenceBuilderTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ReferenceBuilderTest.java new file mode 100644 index 00000000..71354f42 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/ReferenceBuilderTest.java @@ -0,0 +1,124 @@ +/* + * 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.build; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.microsoft.lookup.ClassLookup; +import com.microsoft.model.MetadataFile; +import com.microsoft.model.MetadataFileItem; +import com.microsoft.util.ElementUtil; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import jdk.javadoc.doclet.DocletEnvironment; +import org.apache.commons.lang3.RegExUtils; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + +public class ReferenceBuilderTest { + + private ReferenceBuilder referenceBuilder; + + @Before + public void setup() { + DocletEnvironment environment = Mockito.mock(DocletEnvironment.class); + ElementUtil elementUtil = new ElementUtil(new String[0], new String[0]); + ClassLookup classLookup = new ClassLookup(environment, elementUtil); + referenceBuilder = new ReferenceBuilder(environment, classLookup, elementUtil); + } + + @Test + public void expandComplexGenericsInReferences() { + MetadataFile classMetadataFile = new MetadataFile("path", "name"); + MetadataFileItem referenceItem = new MetadataFileItem("a.b.c.List>"); + Set references = classMetadataFile.getReferences(); + references.add(referenceItem); + + referenceBuilder.expandComplexGenericsInReferences(classMetadataFile); + + assertEquals("Wrong references amount", references.size(), 4); + + List content = + references.stream().map(MetadataFileItem::getUid).collect(Collectors.toList()); + assertTrue("Wrong references content", content.contains("a.b.c.List")); + assertTrue("Wrong references content", content.contains("df.mn.ClassOne")); + assertTrue("Wrong references content", content.contains("tr.T")); + assertTrue("Wrong references content", content.contains("a.b.c.List>")); + } + + // todo add test case to cover reference item with in package + @Test + public void buildRefItem() { + buildRefItemAndCheckAssertions("java.lang.Some.String", "java.lang.Some.String", "String"); + buildRefItemAndCheckAssertions("java.lang.Some.String[]", "java.lang.Some.String[]", "String"); + } + + private void buildRefItemAndCheckAssertions( + String initialValue, String expectedUid, String expectedName) { + MetadataFileItem result = referenceBuilder.buildRefItem(initialValue); + + assertEquals("Wrong uid", result.getUid(), expectedUid); + assertEquals( + "Wrong name", + result.getSpecForJava().iterator().next().getUid(), + RegExUtils.removeAll(expectedUid, "\\[\\]$")); + assertEquals("Wrong name", result.getSpecForJava().iterator().next().getName(), expectedName); + assertEquals( + "Wrong fullName", + result.getSpecForJava().iterator().next().getFullName(), + RegExUtils.removeAll(expectedUid, "\\[\\]$")); + } + + @Test + public void getJavaReferenceHref() { + String result1 = referenceBuilder.getJavaReferenceHref("java.lang.Object"); + String result2 = + referenceBuilder.getJavaReferenceHref("java.lang.Object.equals(java.lang.Object)"); + String result3 = referenceBuilder.getJavaReferenceHref("java.lang.Object.notify()"); + String result4 = referenceBuilder.getJavaReferenceHref("java.util.List"); + String result5 = referenceBuilder.getJavaReferenceHref("java.lang.Object.wait(long,int)"); + String result6 = referenceBuilder.getJavaReferenceHref("java.lang.Object.getClass()"); + String result7 = referenceBuilder.getJavaReferenceHref("java.io.IOException"); + String result8 = referenceBuilder.getJavaReferenceHref("java.io.InputStream"); + String result9 = referenceBuilder.getJavaReferenceHref("java.lang.Enum.hashCode()"); + String result10 = referenceBuilder.getJavaReferenceHref("java.nio.ByteBuffer"); + String result11 = + referenceBuilder.getJavaReferenceHref( + "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)"); + String result12 = referenceBuilder.getJavaReferenceHref(""); + String result13 = referenceBuilder.getJavaReferenceHref(null); + + String baseURL = "https://docs.oracle.com/javase/8/docs/api/"; + + assertEquals(baseURL + "java/lang/Object.html", result1); + assertEquals(baseURL + "java/lang/Object.html#equals-java.lang.Object-", result2); + assertEquals(baseURL + "java/lang/Object.html#notify--", result3); + assertEquals(baseURL + "java/util/List.html", result4); + assertEquals(baseURL + "java/lang/Object.html#wait-long-int-", result5); + assertEquals(baseURL + "java/lang/Object.html#getClass--", result6); + assertEquals(baseURL + "java/io/IOException.html", result7); + assertEquals(baseURL + "java/io/InputStream.html", result8); + assertEquals(baseURL + "java/lang/Enum.html#hashCode--", result9); + assertEquals(baseURL + "java/nio/ByteBuffer.html", result10); + assertEquals( + baseURL + "java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-", result11); + assertEquals(baseURL, result12); + assertEquals(baseURL, result13); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/TocTypeMapTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/TocTypeMapTest.java new file mode 100644 index 00000000..0f58ae07 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/TocTypeMapTest.java @@ -0,0 +1,48 @@ +package com.microsoft.build; + +import static org.junit.Assert.assertEquals; + +import com.microsoft.model.TocItem; +import com.microsoft.model.TocTypeMap; +import java.util.List; +import javax.lang.model.element.ElementKind; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; + +@RunWith(MockitoJUnitRunner.class) +public class TocTypeMapTest { + + @Test + public void testToList() { + TocTypeMap typeMap = new TocTypeMap(); + TocItem classToc = new TocItem("uid1", "name1"); + TocItem interfaceToc = new TocItem("uid2", "name2"); + TocItem enumToc = new TocItem("uid3", "name3"); + TocItem annotationToc = new TocItem("uid4", "name4"); + TocItem exceptionToc = new TocItem("uid5", "name5"); + + typeMap.get(ElementKind.CLASS.name()).add(classToc); + typeMap.get(ElementKind.INTERFACE.name()).add(interfaceToc); + typeMap.get(ElementKind.ENUM.name()).add(enumToc); + typeMap.get(ElementKind.ANNOTATION_TYPE.name()).add(annotationToc); + typeMap.get("EXCEPTION").add(exceptionToc); + + List tocItems = typeMap.toList(); + + assertEquals("Interfaces", tocItems.get(0).getHeading()); + assertEquals(interfaceToc, tocItems.get(1)); + + assertEquals("Classes", tocItems.get(2).getHeading()); + assertEquals(classToc, tocItems.get(3)); + + assertEquals("Enums", tocItems.get(4).getHeading()); + assertEquals(enumToc, tocItems.get(5)); + + assertEquals("Annotation Types", tocItems.get(6).getHeading()); + assertEquals(annotationToc, tocItems.get(7)); + + assertEquals("Exceptions", tocItems.get(8).getHeading()); + assertEquals(exceptionToc, tocItems.get(9)); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/YmlFilesBuilderTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/YmlFilesBuilderTest.java deleted file mode 100644 index bd0aa3a3..00000000 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/build/YmlFilesBuilderTest.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.microsoft.build; - -import com.google.testing.compile.CompilationRule; -import com.microsoft.model.*; -import com.sun.source.util.DocTrees; -import jdk.javadoc.doclet.DocletEnvironment; -import org.apache.commons.lang3.RegExUtils; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mockito; -import org.mockito.junit.MockitoJUnitRunner; - -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; -import java.io.File; -import java.util.*; -import java.util.stream.Collectors; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class YmlFilesBuilderTest { - - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private YmlFilesBuilder ymlFilesBuilder; - private DocletEnvironment environment; - private DocTrees docTrees; - - @Before - public void setup() { - elements = rule.getElements(); - environment = Mockito.mock(DocletEnvironment.class); - docTrees = Mockito.mock(DocTrees.class); - ymlFilesBuilder = new YmlFilesBuilder(environment, "./target", new String[]{}, new String[]{}, "google-cloud-product"); - } - - @Test - public void addConstructorsInfoWhenOnlyDefaultConstructor() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - MetadataFile container = new MetadataFile("output", "name"); - when(environment.getElementUtils()).thenReturn(elements); - when(environment.getDocTrees()).thenReturn(docTrees); - - ymlFilesBuilder.addConstructorsInfo(element, container); - - assertEquals("Wrong file name", container.getFileNameWithPath(), "output" + File.separator + "name"); - assertEquals("Container should contain constructor item", container.getItems().size(), 1); - } - - @Test - public void addConstructorsInfo() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - MetadataFile container = new MetadataFile("output", "name"); - when(environment.getElementUtils()).thenReturn(elements); - when(environment.getDocTrees()).thenReturn(docTrees); - - ymlFilesBuilder.addConstructorsInfo(element, container); - - assertEquals("Wrong file name", container.getFileNameWithPath(), "output" + File.separator + "name"); - Collection constructorItems = container.getItems(); - assertEquals("Container should contain 2 constructor items", constructorItems.size(), 2); - } - - //todo add test case to cover reference item with in package - @Test - public void buildRefItem() { - buildRefItemAndCheckAssertions("java.lang.Some.String", "java.lang.Some.String", "String"); - buildRefItemAndCheckAssertions("java.lang.Some.String[]", "java.lang.Some.String[]", "String"); - } - - private void buildRefItemAndCheckAssertions(String initialValue, String expectedUid, String expectedName) { - MetadataFileItem result = ymlFilesBuilder.buildRefItem(initialValue); - - assertEquals("Wrong uid", result.getUid(), expectedUid); - assertEquals("Wrong name", result.getSpecForJava().iterator().next().getUid(), RegExUtils.removeAll(expectedUid, "\\[\\]$")); - assertEquals("Wrong name", result.getSpecForJava().iterator().next().getName(), expectedName); - assertEquals("Wrong fullName", result.getSpecForJava().iterator().next().getFullName(), RegExUtils.removeAll(expectedUid, "\\[\\]$")); - } - - @Test - public void populateUidValues() { - MetadataFile classMetadataFile = new MetadataFile("output", "name"); - - MetadataFileItem ownerClassItem = buildMetadataFileItem("a.b.OwnerClass", "Not important summary value"); - ownerClassItem.setNameWithType("OwnerClass"); - MetadataFileItem item1 = buildMetadataFileItem("UID unknown class", "UnknownClass"); - populateSyntax(item1, "SomeClass#someMethod(String param)"); - MetadataFileItem item2 = buildMetadataFileItem("UID known class", "SomeClass#someMethod(String param)"); - MetadataFileItem item3 = buildMetadataFileItem("UID method only", "#someMethod2(String p1, String p2)"); - classMetadataFile.getItems().addAll(Arrays.asList(ownerClassItem, item1, item2, item3)); - - MetadataFileItem reference1 = new MetadataFileItem("a.b.SomeClass.someMethod(String param)"); - reference1.setNameWithType("SomeClass.someMethod(String param)"); - MetadataFileItem reference2 = new MetadataFileItem("a.b.OwnerClass.someMethod2(String p1, String p2)"); - reference2.setNameWithType("OwnerClass.someMethod2(String p1, String p2)"); - classMetadataFile.getReferences().addAll(Arrays.asList(reference1, reference2)); - - ymlFilesBuilder.populateUidValues(Collections.emptyList(), Arrays.asList(classMetadataFile)); - - assertEquals("Wrong summary for unknown class", item1.getSummary(), - "Bla bla UnknownClass bla"); - assertEquals("Wrong syntax description", item1.getSyntax().getParameters().get(0).getDescription(), - "One two SomeClass#someMethod(String param) three"); - assertEquals("Wrong summary for known class", item2.getSummary(), - "Bla bla SomeClass#someMethod(String param) bla"); - assertEquals("Wrong summary for method", item3.getSummary(), - "Bla bla #someMethod2(String p1, String p2) bla"); - - } - - private MetadataFileItem buildMetadataFileItem(String uid, String value) { - MetadataFileItem item = new MetadataFileItem(uid); - item.setSummary( - String.format("Bla bla %s bla", value, value)); - return item; - } - - private void populateSyntax(MetadataFileItem item, String value) { - Syntax syntax = new Syntax(); - String methodParamDescription = String - .format("One two %s three", value, value); - syntax.setParameters( - Arrays.asList(new MethodParameter("method param id", "method param type", methodParamDescription))); - item.setSyntax(syntax); - } - - @Test - public void determineUidByLinkContent() { - Map lookup = new HashMap<>() {{ - put("SomeClass", "a.b.c.SomeClass"); - put("SomeClass.someMethod()", "a.b.c.SomeClass.someMethod()"); - put("SomeClass.someMethod(String param)", "a.b.c.SomeClass.someMethod(String param)"); - }}; - - LookupContext lookupContext = new LookupContext(lookup, lookup); - assertEquals("Wrong result for class", ymlFilesBuilder. - resolveUidByLookup("SomeClass", lookupContext), "a.b.c.SomeClass"); - assertEquals("Wrong result for method", ymlFilesBuilder. - resolveUidFromLinkContent("SomeClass#someMethod()", lookupContext), "a.b.c.SomeClass.someMethod()"); - assertEquals("Wrong result for method with param", ymlFilesBuilder. - resolveUidFromLinkContent("SomeClass#someMethod(String param)", lookupContext), - "a.b.c.SomeClass.someMethod(String param)"); - - assertEquals("Wrong result for unknown class", ymlFilesBuilder. - resolveUidByLookup("UnknownClass", lookupContext), ""); - assertEquals("Wrong result for null", ymlFilesBuilder.resolveUidByLookup(null, lookupContext), ""); - assertEquals("Wrong result for whitespace", ymlFilesBuilder.resolveUidByLookup(" ", lookupContext), ""); - } - - @Test - public void splitUidWithGenericsIntoClassNames() { - List result = ymlFilesBuilder.splitUidWithGenericsIntoClassNames("a.b.c.List>"); - - assertEquals("Wrong result list size", result.size(), 3); - assertTrue("Wrong result list content", result.contains("a.b.c.List")); - assertTrue("Wrong result list content", result.contains("df.mn.ClassOne")); - assertTrue("Wrong result list content", result.contains("tr.T")); - } - - @Test - public void expandComplexGenericsInReferences() { - MetadataFile classMetadataFile = new MetadataFile("path", "name"); - MetadataFileItem referenceItem = new MetadataFileItem("a.b.c.List>"); - Set references = classMetadataFile.getReferences(); - references.add(referenceItem); - - ymlFilesBuilder.expandComplexGenericsInReferences(classMetadataFile); - - assertEquals("Wrong references amount", references.size(), 4); - - List content = references.stream().map(MetadataFileItem::getUid).collect(Collectors.toList()); - assertTrue("Wrong references content", content.contains("a.b.c.List")); - assertTrue("Wrong references content", content.contains("df.mn.ClassOne")); - assertTrue("Wrong references content", content.contains("tr.T")); - assertTrue("Wrong references content", content.contains("a.b.c.List>")); - } - - - @Test - public void getJavaReferenceHref(){ - String result1 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Object"); - String result2 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Object.equals(java.lang.Object)"); - String result3 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Object.notify()"); - String result4 = ymlFilesBuilder.getJavaReferenceHref("java.util.List"); - String result5 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Object.wait(long,int)"); - String result6 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Object.getClass()"); - String result7 = ymlFilesBuilder.getJavaReferenceHref("java.io.IOException"); - String result8 = ymlFilesBuilder.getJavaReferenceHref("java.io.InputStream"); - String result9 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Enum.hashCode()"); - String result10 = ymlFilesBuilder.getJavaReferenceHref("java.nio.ByteBuffer"); - String result11 = ymlFilesBuilder.getJavaReferenceHref("java.lang.Enum.valueOf(java.lang.Class,java.lang.String)"); - String result12 = ymlFilesBuilder.getJavaReferenceHref(""); - String result13 = ymlFilesBuilder.getJavaReferenceHref(null); - - String baseURL = "https://docs.oracle.com/javase/8/docs/api/"; - - assertEquals(baseURL + "java/lang/Object.html", result1); - assertEquals(baseURL + "java/lang/Object.html#equals-java.lang.Object-", result2); - assertEquals(baseURL + "java/lang/Object.html#notify--", result3); - assertEquals(baseURL + "java/util/List.html", result4); - assertEquals(baseURL + "java/lang/Object.html#wait-long-int-", result5); - assertEquals(baseURL + "java/lang/Object.html#getClass--", result6); - assertEquals(baseURL + "java/io/IOException.html", result7); - assertEquals(baseURL + "java/io/InputStream.html", result8); - assertEquals(baseURL + "java/lang/Enum.html#hashCode--", result9); - assertEquals(baseURL + "java/nio/ByteBuffer.html", result10); - assertEquals(baseURL + "java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-", result11); - assertEquals(baseURL, result12); - assertEquals(baseURL, result13); - } - - @Test - public void joinTocTypeItems(){ - TocTypeMap typeMap = new TocTypeMap(); - TocItem classToc = new TocItem("uid1", "name1"); - TocItem interfaceToc = new TocItem("uid2", "name2"); - TocItem enumToc = new TocItem("uid3", "name3"); - TocItem annotationToc = new TocItem("uid4", "name4"); - TocItem exceptionToc = new TocItem("uid5", "name5"); - - typeMap.get(ElementKind.CLASS.name()).add(classToc); - typeMap.get(ElementKind.INTERFACE.name()).add(interfaceToc); - typeMap.get(ElementKind.ENUM.name()).add(enumToc); - typeMap.get(ElementKind.ANNOTATION_TYPE.name()).add(annotationToc); - typeMap.get("EXCEPTION").add(exceptionToc); - - List tocItems = ymlFilesBuilder.joinTocTypeItems(typeMap); - - assertEquals("Interfaces", tocItems.get(0).getHeading()); - assertEquals(interfaceToc, tocItems.get(1)); - - assertEquals("Classes", tocItems.get(2).getHeading()); - assertEquals(classToc, tocItems.get(3)); - - assertEquals("Enums", tocItems.get(4).getHeading()); - assertEquals(enumToc, tocItems.get(5)); - - assertEquals("Annotation Types", tocItems.get(6).getHeading()); - assertEquals(annotationToc, tocItems.get(7)); - - assertEquals("Exceptions", tocItems.get(8).getHeading()); - assertEquals(exceptionToc, tocItems.get(9)); - } - -} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocFxDocletTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocFxDocletTest.java index 47caf06d..d342f780 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocFxDocletTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/doclet/DocFxDocletTest.java @@ -1,65 +1,65 @@ package com.microsoft.doclet; +import static org.junit.Assert.assertEquals; + import com.microsoft.doclet.DocFxDoclet.CustomOption; import com.microsoft.doclet.DocFxDoclet.FakeOptionForCompatibilityWithStandardDoclet; +import java.util.Arrays; +import java.util.List; +import javax.lang.model.SourceVersion; import jdk.javadoc.doclet.Doclet.Option.Kind; import org.junit.Before; import org.junit.Test; -import javax.lang.model.SourceVersion; -import java.util.Arrays; -import java.util.List; - -import static org.junit.Assert.assertEquals; - public class DocFxDocletTest { - private DocFxDoclet doclet; + private DocFxDoclet doclet; - @Before - public void setup() { - doclet = new DocFxDoclet(); - } + @Before + public void setup() { + doclet = new DocFxDoclet(); + } - @Test - public void getSupportedSourceVersion() { - assertEquals("Wrong version used", doclet.getSupportedSourceVersion(), SourceVersion.latest()); - } + @Test + public void getSupportedSourceVersion() { + assertEquals("Wrong version used", doclet.getSupportedSourceVersion(), SourceVersion.latest()); + } - @Test - public void getDocletName() { - assertEquals("Wrong doclet name", doclet.getName(), "DocFxDoclet"); - } + @Test + public void getDocletName() { + assertEquals("Wrong doclet name", doclet.getName(), "DocFxDoclet"); + } - @Test - public void testCustomOptionCreation() { - String description = "Some desc"; - List names = Arrays.asList("name 1", "name 2"); - String params = "Some params"; + @Test + public void testCustomOptionCreation() { + String description = "Some desc"; + List names = Arrays.asList("name 1", "name 2"); + String params = "Some params"; - CustomOption option = new CustomOption(description, names, params) { - @Override - public boolean process(String option, List arguments) { - return false; - } + CustomOption option = + new CustomOption(description, names, params) { + @Override + public boolean process(String option, List arguments) { + return false; + } }; - assertEquals("Wrong args count", option.getArgumentCount(), 1); - assertEquals("Wrong description", option.getDescription(), description); - assertEquals("Wrong kind", option.getKind(), Kind.STANDARD); - assertEquals("Wrong names", option.getNames(), names); - assertEquals("Wrong params", option.getParameters(), params); - } + assertEquals("Wrong args count", option.getArgumentCount(), 1); + assertEquals("Wrong description", option.getDescription(), description); + assertEquals("Wrong kind", option.getKind(), Kind.STANDARD); + assertEquals("Wrong names", option.getNames(), names); + assertEquals("Wrong params", option.getParameters(), params); + } - @Test - public void testFakeOptionCreation() { - FakeOptionForCompatibilityWithStandardDoclet option = - new FakeOptionForCompatibilityWithStandardDoclet("Some description", "title"); + @Test + public void testFakeOptionCreation() { + FakeOptionForCompatibilityWithStandardDoclet option = + new FakeOptionForCompatibilityWithStandardDoclet("Some description", "title"); - assertEquals("Wrong args count", option.getArgumentCount(), 1); - assertEquals("Wrong description", option.getDescription(), "Some description"); - assertEquals("Wrong kind", option.getKind(), Kind.STANDARD); - assertEquals("Wrong names", option.getNames(), Arrays.asList("title")); - assertEquals("Wrong params", option.getParameters(), "none"); - } + assertEquals("Wrong args count", option.getArgumentCount(), 1); + assertEquals("Wrong description", option.getDescription(), "Some description"); + assertEquals("Wrong kind", option.getKind(), Kind.STANDARD); + assertEquals("Wrong names", option.getNames(), Arrays.asList("title")); + assertEquals("Wrong params", option.getParameters(), "none"); + } } 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 7cb916e0..e4c9b46c 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,10 +1,10 @@ package com.microsoft.doclet; -import com.microsoft.util.FileUtilTest; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; +import com.microsoft.util.FileUtilTest; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -12,74 +12,105 @@ import java.nio.file.Path; import java.util.List; import java.util.stream.Collectors; - -import static org.junit.Assert.assertEquals; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class DocletRunnerTest { - private final String PARAMS_DIR = "src/test/resources/test-doclet-params.txt"; - private final String EXPECTED_GENERATED_FILES_DIR = "src/test/resources/expected-generated-files"; - private final String OUTPUT_DIR = "target/test-out"; - - private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); - private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); - private final PrintStream originalOut = System.out; - private final PrintStream originalErr = System.err; - - @Before - public void cleanup() throws IOException { - FileUtilTest.deleteDirectory(OUTPUT_DIR); - - System.setOut(new PrintStream(outContent)); - System.setErr(new PrintStream(errContent)); + private final String PARAMS_DIR = "src/test/resources/test-doclet-params.txt"; + private final String EXPECTED_GENERATED_FILES_DIR = "src/test/resources/expected-generated-files"; + private final String OUTPUT_DIR = "target/test-out"; + + private final ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + private final ByteArrayOutputStream errContent = new ByteArrayOutputStream(); + private final PrintStream originalOut = System.out; + private final PrintStream originalErr = System.err; + + @Before + public void cleanup() throws IOException { + FileUtilTest.deleteDirectory(OUTPUT_DIR); + + System.setOut(new PrintStream(outContent)); + System.setErr(new PrintStream(errContent)); + } + + @After + public void restoreStreams() { + System.setOut(originalOut); + System.setErr(originalErr); + } + + @Test + public void testFilesGenerationWhenNoParams() { + DocletRunner.main(new String[] {}); + + assertEquals( + "Wrong System.err content", + errContent.toString().trim(), + "Usage: java DocletRunner "); + } + + @Test + public void testFilesGenerationWhenTargetFileDoesNotExist() { + try { + DocletRunner.main(new String[] {"some-name.txt"}); + fail(); + } catch (RuntimeException ex) { + assertEquals( + "Wrong System.err content", + errContent.toString().trim(), + "File 'some-name.txt' does not exist"); } - - @After - public void restoreStreams() { - System.setOut(originalOut); - System.setErr(originalErr); - } - - @Test - public void testFilesGenerationWhenNoParams() { - DocletRunner.main(new String[]{}); - - assertEquals("Wrong System.err content", - errContent.toString().trim(), "Usage: java DocletRunner "); - } - - @Test - public void testFilesGenerationWhenTargetFileDoesNotExist() { - DocletRunner.main(new String[]{"some-name.txt"}); - - assertEquals("Wrong System.err content", - errContent.toString().trim(), "File 'some-name.txt' does not exist"); + } + + @Test + public void testFilesGeneration() throws IOException { + DocletRunner.run( + new String[] {PARAMS_DIR}, + new DocletRunner.EnvironmentToArgumentsBuilder() + .add("artifactVersion", "0.18.0") + .add("librariesBomVersion", "26.19.0") + .add( + "repoMetadataFilePath", "./src/test/java/com/microsoft/samples/.repo-metadata.json") + .build()); + + List expectedFilePaths = + 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()); + + String generatedFileContent = Files.readString(generatedFilePath); + String expectedFileContent = Files.readString(expectedFilePath); + + String[] generatedFileLines = generatedFileContent.split("\n"); + String[] expectedFileLines = expectedFileContent.split("\n"); + + assertEquals( + "Unexpected amount of lines in file " + generatedFilePath, + expectedFileLines.length, + generatedFileLines.length); + + for (int i = 0; i < generatedFileLines.length; i++) { + assertEquals( + "Wrong file content for file " + generatedFilePath, + expectedFileLines[i], + generatedFileLines[i]); + } } + } - @Test - public void testFilesGeneration() throws IOException { - DocletRunner.main(new String[]{PARAMS_DIR}); + 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()); - 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()); - - for (Path expectedFilePath : expectedFilePaths) { - Path generatedFilePath = Path.of(OUTPUT_DIR, expectedFilePath.getFileName().toString()); - - String generatedFileContent = Files.readString(generatedFilePath); - String expectedFileContent = Files.readString(expectedFilePath); - - String[] generatedFileLines = generatedFileContent.split("\n"); - String[] expectedFileLines = expectedFileContent.split("\n"); - - assertEquals("Unexpected amount of lines in file " + generatedFilePath, generatedFileLines.length, - expectedFileLines.length); - - for (int i = 0; i < generatedFileLines.length; i++) { - assertEquals("Wrong file content for file " + generatedFilePath, - generatedFileLines[i], expectedFileLines[i]); - } - } - } + assertThat(generatedFilenames).containsExactlyElementsIn(expectedFilenames); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java index f41140fd..f53a7594 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/BaseLookupTest.java @@ -1,11 +1,21 @@ package com.microsoft.lookup; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.mockito.Mockito.*; + import com.google.testing.compile.CompilationRule; import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.*; import com.sun.source.doctree.*; import com.sun.source.doctree.DocTree.Kind; import com.sun.source.util.DocTrees; +import java.util.Arrays; +import java.util.Collections; +import java.util.Set; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; import jdk.javadoc.doclet.DocletEnvironment; import org.junit.Before; import org.junit.Rule; @@ -14,233 +24,285 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; -import java.util.Arrays; -import java.util.Collections; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.mockito.Mockito.*; - @RunWith(MockitoJUnitRunner.class) public class BaseLookupTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private DocletEnvironment environment; - private DocTrees docTrees; - private DocCommentTree docCommentTree; - private TextTree textTree; - private LinkTree linkTree; - private ReferenceTree referenceTree; - private LiteralTree literalTree; - private BaseLookup baseLookup; - private ExtendedMetadataFileItem lastBuiltItem; - - @Before - public void setup() { - elements = rule.getElements(); - environment = Mockito.mock(DocletEnvironment.class); - docTrees = Mockito.mock(DocTrees.class); - docCommentTree = Mockito.mock(DocCommentTree.class); - textTree = Mockito.mock(TextTree.class); - linkTree = Mockito.mock(LinkTree.class); - referenceTree = Mockito.mock(ReferenceTree.class); - literalTree = Mockito.mock(LiteralTree.class); - - baseLookup = new BaseLookup<>(environment) { - @Override - protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { - lastBuiltItem = buildExtendedMetadataFileItem(element); - return lastBuiltItem; - } + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private DocletEnvironment environment; + private DocTrees docTrees; + private DocCommentTree docCommentTree; + private TextTree textTree; + private LinkTree linkTree; + private ReferenceTree referenceTree; + private LiteralTree literalTree; + private TypeElement typeElement; + private BaseLookup baseLookup; + private ExtendedMetadataFileItem lastBuiltItem; + + @Before + public void setup() { + elements = rule.getElements(); + environment = Mockito.mock(DocletEnvironment.class); + docTrees = Mockito.mock(DocTrees.class); + docCommentTree = Mockito.mock(DocCommentTree.class); + textTree = Mockito.mock(TextTree.class); + linkTree = Mockito.mock(LinkTree.class); + referenceTree = Mockito.mock(ReferenceTree.class); + literalTree = Mockito.mock(LiteralTree.class); + typeElement = Mockito.mock(TypeElement.class); + + baseLookup = + new BaseLookup<>(environment) { + @Override + protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { + lastBuiltItem = buildExtendedMetadataFileItem(element); + return lastBuiltItem; + } }; - } - - @Test - public void determineComment() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); - doReturn(Arrays.asList(textTree, linkTree)).when(docCommentTree).getFullBody(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(linkTree.getKind()).thenReturn(Kind.LINK); - when(linkTree.getReference()).thenReturn(referenceTree); - when(referenceTree.getSignature()).thenReturn("Some#signature"); - when(textTree.toString()).thenReturn("Some text 1"); - - String result = baseLookup.determineComment(element); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(element); - verify(docCommentTree).getFullBody(); - verify(textTree).getKind(); - verify(linkTree).getKind(); - verify(linkTree).getReference(); - verify(linkTree).getLabel(); - assertEquals("Wrong result", result, "Some text 1Some#signature"); - } - - @Test - public void makeTypeShort() { - assertEquals("Wrong result for primitive type", baseLookup.makeTypeShort("int"), "int"); - assertEquals("Wrong result", baseLookup.makeTypeShort("java.lang.String"), "String"); - assertEquals("Wrong result for inner class", - baseLookup.makeTypeShort("org.apache.commons.lang3.arch.Processor.Arch"), "Processor.Arch"); - assertEquals("Wrong result for class with generic", - baseLookup.makeTypeShort("java.util.List"), "List"); - assertEquals("Wrong result for inner class with generic", - baseLookup.makeTypeShort("java.util.List.Custom"), "List.Custom"); - assertEquals("Wrong result for inner class with complex generic", - baseLookup.makeTypeShort("a.b.c.D.E.G>>"), "D.E.G>>"); - assertEquals("Wrong result for inner class with generic & inheritance", - baseLookup.makeTypeShort("a.b.G"), "G"); - } - - @Test - public void buildXrefTag() { - when(linkTree.getReference()).thenReturn(referenceTree); - when(referenceTree.getSignature()).thenReturn("Some#signature"); - when(linkTree.getLabel()).thenReturn(Collections.emptyList()); - - String result = baseLookup.buildXrefTag(linkTree); - - assertEquals("Wrong result", result, - "Some#signature"); - } - - @Test - public void buildXrefTagWhenLabelPresents() { - when(linkTree.getReference()).thenReturn(referenceTree); - when(referenceTree.getSignature()).thenReturn("Some#signature"); - doReturn(Arrays.asList(textTree)).when(linkTree).getLabel(); - String labelValue = "IamLabel"; - when(textTree.toString()).thenReturn(labelValue); - - String result = baseLookup.buildXrefTag(linkTree); - - assertEquals("Wrong result", result, - "" + labelValue + ""); - } - - @Test - public void buildCodeTag() { - String tagContent = "Some text"; - when(literalTree.getBody()).thenReturn(textTree); - when(textTree.toString()).thenReturn(tagContent); - - String result = baseLookup.buildCodeTag(literalTree); - - assertEquals("Wrong result", result, "" + tagContent + ""); - } - - @Test - public void expandLiteralBody() { - String tagContent = "Some text"; - when(literalTree.getBody()).thenReturn(textTree); - when(textTree.toString()).thenReturn(tagContent); - - String result = baseLookup.expandLiteralBody(literalTree); - - assertEquals("Wrong result", result, tagContent); - } - - @Test - public void replaceLinksAndCodes() { - when(linkTree.getReference()).thenReturn(referenceTree); - when(referenceTree.getSignature()).thenReturn("Some#signature"); - when(linkTree.getLabel()).thenReturn(Collections.emptyList()); - String textTreeContent = "Some text content"; - when(literalTree.getBody()).thenReturn(textTree); - when(textTree.toString()).thenReturn(textTreeContent); - when(linkTree.getKind()).thenReturn(Kind.LINK); - when(literalTree.getKind()).thenReturn(Kind.CODE); - when(textTree.getKind()).thenReturn(Kind.TEXT); - - String result = baseLookup.replaceLinksAndCodes(Arrays.asList(linkTree, literalTree, textTree)); - - assertEquals("Wrong result", result, "" - + "Some#signatureSome text content" + textTreeContent); - } - - @Test - public void resolve() { - TypeElement element1 = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - TypeElement element2 = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); - - ExtendedMetadataFileItem resultForKey1 = baseLookup.resolve(element1); - ExtendedMetadataFileItem resultForKey2 = baseLookup.resolve(element2); - ExtendedMetadataFileItem consequenceCallResultForKey1 = baseLookup.resolve(element1); - - assertEquals("Consequence call should return same instance", resultForKey1, consequenceCallResultForKey1); - assertNotEquals("Resolve for another key should return another instance", resultForKey2, resultForKey1); - } - - @Test - public void testExtractMethods() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - - assertEquals("Wrong packageName", baseLookup.extractPackageName(element), lastBuiltItem.getPackageName()); - assertEquals("Wrong fullName", baseLookup.extractFullName(element), lastBuiltItem.getFullName()); - assertEquals("Wrong name", baseLookup.extractName(element), lastBuiltItem.getName()); - assertEquals("Wrong href", baseLookup.extractHref(element), lastBuiltItem.getHref()); - assertEquals("Wrong parent", baseLookup.extractParent(element), lastBuiltItem.getParent()); - assertEquals("Wrong id", baseLookup.extractId(element), lastBuiltItem.getId()); - assertEquals("Wrong uid", baseLookup.extractUid(element), lastBuiltItem.getUid()); - assertEquals("Wrong nameWithType", baseLookup.extractNameWithType(element), lastBuiltItem.getNameWithType()); - assertEquals("Wrong methodContent", baseLookup.extractMethodContent(element), - lastBuiltItem.getMethodContent()); - assertEquals("Wrong fieldContent", baseLookup.extractFieldContent(element), lastBuiltItem.getFieldContent()); - assertEquals("Wrong constructorContent", baseLookup.extractConstructorContent(element), - lastBuiltItem.getConstructorContent()); - assertEquals("Wrong overload", baseLookup.extractOverload(element), lastBuiltItem.getOverload()); - assertEquals("Wrong parameters", baseLookup.extractParameters(element), lastBuiltItem.getParameters()); - assertEquals("Wrong exceptions", baseLookup.extractExceptions(element), lastBuiltItem.getExceptions()); - - assertEquals("Wrong return", baseLookup.extractReturn(element).getReturnType(), - lastBuiltItem.getReturn().getReturnType()); - assertEquals("Wrong return", baseLookup.extractReturn(element).getReturnDescription(), - lastBuiltItem.getReturn().getReturnDescription()); - - assertEquals("Wrong summary", baseLookup.extractSummary(element), lastBuiltItem.getSummary()); - assertEquals("Wrong type", baseLookup.extractType(element), lastBuiltItem.getType()); - assertEquals("Wrong content", baseLookup.extractContent(element), lastBuiltItem.getContent()); - assertEquals("Wrong typeParameters", baseLookup.extractTypeParameters(element), - lastBuiltItem.getTypeParameters()); - assertEquals("Wrong superclass", baseLookup.extractSuperclass(element), lastBuiltItem.getSuperclass()); - assertEquals("Wrong interfaces", baseLookup.extractInterfaces(element), lastBuiltItem.getInterfaces()); - assertEquals("Wrong tocName", baseLookup.extractTocName(element), lastBuiltItem.getTocName()); - assertEquals("Wrong references", baseLookup.extractReferences(element), lastBuiltItem.getReferences()); - } - - private ExtendedMetadataFileItem buildExtendedMetadataFileItem(Element element) { - ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(String.valueOf(element)); - result.setPackageName("Some package name"); - result.setFullName("Some full name"); - result.setName("Some name"); - result.setHref("Some href"); - result.setParent("Some parent"); - result.setId("Some id"); - result.setNameWithType("Some name with type"); - result.setMethodContent("Some method content"); - result.setFieldContent("Some field content"); - result.setConstructorContent("Some constructor content"); - result.setOverload("Some overload"); - result.setParameters(Arrays.asList(new MethodParameter("method id", "method type", "method desc"))); - result.setExceptions(Arrays.asList(new ExceptionItem("ex type", "ex desc"))); - result.setReturn(new Return("return type", "return desc")); - result.setSummary("Some summary"); - result.setType("Some type"); - result.setContent("Some content"); - result.setTypeParameters(Arrays.asList(new TypeParameter("type param id"))); - result.setSuperclass(Arrays.asList("Some ")); - result.setInterfaces(Arrays.asList("Some interface")); - result.setTocName("Some toc name"); - result.addReferences(Set.of(new MetadataFileItem("ref uid"))); - return result; - } + } + + @Test + public void determineComment() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); + doReturn(Arrays.asList(textTree, linkTree)).when(docCommentTree).getFullBody(); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(linkTree.getKind()).thenReturn(Kind.LINK); + when(linkTree.getReference()).thenReturn(referenceTree); + when(referenceTree.getSignature()).thenReturn("Some#signature"); + when(textTree.toString()).thenReturn("Some text 1"); + + String result = baseLookup.determineComment(element); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(element); + verify(docCommentTree).getFullBody(); + verify(textTree).getKind(); + verify(linkTree).getKind(); + verify(linkTree).getReference(); + verify(linkTree).getLabel(); + assertEquals( + "Wrong result", + result, + "Some text 1Some#signature"); + } + + @Test + public void makeTypeShort() { + assertEquals("Wrong result for primitive type", baseLookup.makeTypeShort("int"), "int"); + assertEquals("Wrong result", baseLookup.makeTypeShort("java.lang.String"), "String"); + assertEquals( + "Wrong result for inner class", + baseLookup.makeTypeShort("org.apache.commons.lang3.arch.Processor.Arch"), + "Processor.Arch"); + assertEquals( + "Wrong result for class with generic", + baseLookup.makeTypeShort("java.util.List"), + "List"); + assertEquals( + "Wrong result for inner class with generic", + baseLookup.makeTypeShort("java.util.List.Custom"), + "List.Custom"); + assertEquals( + "Wrong result for inner class with complex generic", + baseLookup.makeTypeShort("a.b.c.D.E.G>>"), + "D.E.G>>"); + assertEquals( + "Wrong result for inner class with generic & inheritance", + baseLookup.makeTypeShort("a.b.G"), + "G"); + } + + @Test + public void buildXrefTag() { + when(linkTree.getReference()).thenReturn(referenceTree); + when(referenceTree.getSignature()).thenReturn("Some#signature"); + when(linkTree.getLabel()).thenReturn(Collections.emptyList()); + + String result = baseLookup.buildXrefTag(linkTree); + + assertEquals( + "Wrong result", + result, + "Some#signature"); + } + + @Test + public void buildXrefTagWhenLabelPresents() { + when(linkTree.getReference()).thenReturn(referenceTree); + when(referenceTree.getSignature()).thenReturn("Some#signature"); + doReturn(Arrays.asList(textTree)).when(linkTree).getLabel(); + String labelValue = "IamLabel"; + when(textTree.toString()).thenReturn(labelValue); + + String result = baseLookup.buildXrefTag(linkTree); + + assertEquals( + "Wrong result", + result, + "" + + labelValue + + ""); + } + + @Test + public void buildCodeTag() { + String tagContent = "Some text ≤"; + when(literalTree.getBody()).thenReturn(textTree); + when(textTree.toString()).thenReturn(tagContent); + + String result = baseLookup.buildCodeTag(literalTree); + + assertEquals("Wrong result", result, "" + tagContent + ""); + } + + @Test + public void expandLiteralBody() { + String tagContent = "Some text ≤ \u2264"; + when(literalTree.getBody()).thenReturn(textTree); + when(textTree.toString()).thenReturn(tagContent); + + String result = baseLookup.expandLiteralBody(literalTree); + String expected = "Some text ≤ ≤"; + + assertEquals("Wrong result", result, expected); + } + + @Test + public void replaceLinksAndCodes() { + when(linkTree.getReference()).thenReturn(referenceTree); + when(referenceTree.getSignature()).thenReturn("Some#signature"); + when(linkTree.getLabel()).thenReturn(Collections.emptyList()); + String textTreeContent = "Some text content ≤ \u2264"; + when(literalTree.getBody()).thenReturn(textTree); + when(textTree.toString()).thenReturn(textTreeContent); + when(linkTree.getKind()).thenReturn(Kind.LINK); + when(literalTree.getKind()).thenReturn(Kind.CODE); + when(textTree.getKind()).thenReturn(Kind.TEXT); + + String result = baseLookup.replaceLinksAndCodes(Arrays.asList(linkTree, literalTree, textTree)); + + assertEquals( + "Wrong result", + result, + "" + + "Some#signatureSome text content ≤ ≤" + + textTreeContent); + } + + @Test + public void resolve() { + TypeElement element1 = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + TypeElement element2 = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); + + ExtendedMetadataFileItem resultForKey1 = baseLookup.resolve(element1); + ExtendedMetadataFileItem resultForKey2 = baseLookup.resolve(element2); + ExtendedMetadataFileItem consequenceCallResultForKey1 = baseLookup.resolve(element1); + + assertEquals( + "Consequence call should return same instance", + resultForKey1, + consequenceCallResultForKey1); + assertNotEquals( + "Resolve for another key should return another instance", resultForKey2, resultForKey1); + } + + @Test + public void testExtractMethods() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + + assertEquals( + "Wrong packageName", + baseLookup.extractPackageName(element), + lastBuiltItem.getPackageName()); + assertEquals( + "Wrong fullName", baseLookup.extractFullName(element), lastBuiltItem.getFullName()); + assertEquals("Wrong name", baseLookup.extractName(element), lastBuiltItem.getName()); + assertEquals("Wrong href", baseLookup.extractHref(element), lastBuiltItem.getHref()); + assertEquals("Wrong parent", baseLookup.extractParent(element), lastBuiltItem.getParent()); + assertEquals("Wrong id", baseLookup.extractId(element), lastBuiltItem.getId()); + assertEquals("Wrong uid", baseLookup.extractUid(element), lastBuiltItem.getUid()); + assertEquals( + "Wrong nameWithType", + baseLookup.extractNameWithType(element), + lastBuiltItem.getNameWithType()); + assertEquals( + "Wrong methodContent", + baseLookup.extractMethodContent(element), + lastBuiltItem.getMethodContent()); + assertEquals( + "Wrong fieldContent", + baseLookup.extractFieldContent(element), + lastBuiltItem.getFieldContent()); + assertEquals( + "Wrong constructorContent", + baseLookup.extractConstructorContent(element), + lastBuiltItem.getConstructorContent()); + assertEquals( + "Wrong overload", baseLookup.extractOverload(element), lastBuiltItem.getOverload()); + assertEquals( + "Wrong parameters", baseLookup.extractParameters(element), lastBuiltItem.getParameters()); + assertEquals( + "Wrong exceptions", baseLookup.extractExceptions(element), lastBuiltItem.getExceptions()); + + assertEquals( + "Wrong return", + baseLookup.extractReturn(element).getReturnType(), + lastBuiltItem.getReturn().getReturnType()); + assertEquals( + "Wrong return", + baseLookup.extractReturn(element).getReturnDescription(), + lastBuiltItem.getReturn().getReturnDescription()); + + assertEquals("Wrong summary", baseLookup.extractSummary(element), lastBuiltItem.getSummary()); + assertEquals("Wrong type", baseLookup.extractType(element), lastBuiltItem.getType()); + assertEquals("Wrong content", baseLookup.extractContent(element), lastBuiltItem.getContent()); + assertEquals( + "Wrong typeParameters", + baseLookup.extractTypeParameters(element), + lastBuiltItem.getTypeParameters()); + assertEquals( + "Wrong superclass", baseLookup.extractSuperclass(element), lastBuiltItem.getSuperclass()); + assertEquals( + "Wrong interfaces", baseLookup.extractInterfaces(element), lastBuiltItem.getInterfaces()); + assertEquals("Wrong tocName", baseLookup.extractTocName(element), lastBuiltItem.getTocName()); + assertEquals( + "Wrong references", baseLookup.extractReferences(element), lastBuiltItem.getReferences()); + } + + private ExtendedMetadataFileItem buildExtendedMetadataFileItem(Element element) { + ExtendedMetadataFileItem result = new ExtendedMetadataFileItem(String.valueOf(element)); + result.setPackageName("Some package name"); + result.setFullName("Some full name"); + result.setName("Some name"); + result.setHref("Some href"); + result.setParent("Some parent"); + result.setId("Some id"); + result.setNameWithType("Some name with type"); + result.setMethodContent("Some method content"); + result.setFieldContent("Some field content"); + result.setConstructorContent("Some constructor content"); + result.setOverload("Some overload"); + result.setParameters( + Arrays.asList(new MethodParameter("method id", "method type", "method desc"))); + result.setExceptions(Arrays.asList(new ExceptionItem("ex type", "ex desc"))); + result.setReturn(new Return("return type", "return desc")); + result.setSummary("Some summary"); + result.setType("Some type"); + result.setJavaType("Some type"); + result.setContent("Some content"); + result.setTypeParameters(Arrays.asList(new TypeParameter("type param id"))); + result.setSuperclass(Arrays.asList("Some ")); + result.setInterfaces(Arrays.asList("Some interface")); + result.setTocName("Some toc name"); + result.addReferences(Set.of(new MetadataFileItem("ref uid"))); + return result; + } + + @Test + public void testExtractJavaType() { + assertEquals("Wrong javaType", baseLookup.extractJavaType(typeElement), null); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassItemsLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassItemsLookupTest.java index cecc9784..950987d4 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassItemsLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassItemsLookupTest.java @@ -1,12 +1,35 @@ package com.microsoft.lookup; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + import com.google.testing.compile.CompilationRule; import com.microsoft.model.ExceptionItem; import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; -import com.sun.source.doctree.*; +import com.microsoft.util.ElementUtil; +import com.sun.source.doctree.DeprecatedTree; +import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocTree.Kind; +import com.sun.source.doctree.IdentifierTree; +import com.sun.source.doctree.ParamTree; +import com.sun.source.doctree.ReturnTree; +import com.sun.source.doctree.TextTree; +import com.sun.source.doctree.ThrowsTree; import com.sun.source.util.DocTrees; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import javax.lang.model.element.Element; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.VariableElement; +import javax.lang.model.util.ElementFilter; +import javax.lang.model.util.Elements; import jdk.javadoc.doclet.DocletEnvironment; import org.junit.Before; import org.junit.Rule; @@ -15,278 +38,291 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import javax.lang.model.element.ExecutableElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.element.VariableElement; -import javax.lang.model.util.ElementFilter; -import javax.lang.model.util.Elements; -import java.util.Arrays; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.mockito.Mockito.*; - @RunWith(MockitoJUnitRunner.class) public class ClassItemsLookupTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private DocletEnvironment environment; - private DocTrees docTrees; - private DocCommentTree docCommentTree; - private ParamTree paramTree; - private ThrowsTree throwsTree; - private ReturnTree returnTree; - private DeprecatedTree deprecatedTree; - private TextTree textTree; - private IdentifierTree identifierTree; - private ClassItemsLookup classItemsLookup; - - @Before - public void setup() { - elements = rule.getElements(); - environment = Mockito.mock(DocletEnvironment.class); - docTrees = Mockito.mock(DocTrees.class); - docCommentTree = Mockito.mock(DocCommentTree.class); - paramTree = Mockito.mock(ParamTree.class); - throwsTree = Mockito.mock(ThrowsTree.class); - returnTree = Mockito.mock(ReturnTree.class); - deprecatedTree = Mockito.mock(DeprecatedTree.class); - textTree = Mockito.mock(TextTree.class); - identifierTree = Mockito.mock(IdentifierTree.class); - classItemsLookup = new ClassItemsLookup(environment); - - } - - @Test - public void extractParameters() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); - doReturn(Arrays.asList(paramTree)).when(docCommentTree).getBlockTags(); - when(paramTree.getKind()).thenReturn(Kind.PARAM); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(paramTree.getName()).thenReturn(identifierTree); - doReturn(Arrays.asList(textTree)).when(paramTree).getDescription(); - when(textTree.toString()).thenReturn("some text bla", "some text bla-bla"); - when(identifierTree.toString()).thenReturn("incomingDamage", "damageType"); - - List result = classItemsLookup.extractParameters(method); - - verify(environment, times(2)).getDocTrees(); - verify(docTrees, times(2)).getDocCommentTree(method); - verify(docCommentTree, times(2)).getBlockTags(); - assertEquals("Wrong parameters count", result.size(), 2); - - assertEquals("Wrong first param id", result.get(0).getId(), "incomingDamage"); - assertEquals("Wrong first param type", result.get(0).getType(), "int"); - assertEquals("Wrong first param description", result.get(0).getDescription(), "some text bla"); - - assertEquals("Wrong second param id", result.get(1).getId(), "damageType"); - assertEquals("Wrong second param type", result.get(1).getType(), "java.lang.String"); - assertEquals("Wrong second param description", result.get(1).getDescription(), "some text bla-bla"); - } - - @Test - public void extractParameterDescription() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - String paramName = "incomingDamage"; - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); - doReturn(Arrays.asList(paramTree)).when(docCommentTree).getBlockTags(); - when(paramTree.getKind()).thenReturn(Kind.PARAM); - doReturn(identifierTree).when(paramTree).getName(); - doReturn(Arrays.asList(textTree)).when(paramTree).getDescription(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(textTree.toString()).thenReturn("some weird text"); - when(identifierTree.toString()).thenReturn(paramName); - - String result = classItemsLookup.extractParameterDescription(method, paramName); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(method); - verify(docCommentTree).getBlockTags(); - assertEquals("Wrong param description", result, "some weird text"); - } - - @Test - public void extractExceptions() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); - doReturn(Arrays.asList(throwsTree)).when(docCommentTree).getBlockTags(); - when(throwsTree.getKind()).thenReturn(Kind.THROWS); - doReturn(Arrays.asList(textTree)).when(throwsTree).getDescription(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(textTree.toString()).thenReturn("some text"); - - List result = classItemsLookup.extractExceptions(method); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(method); - verify(docCommentTree).getBlockTags(); - verify(throwsTree).getKind(); - assertEquals("Wrong exceptions count", result.size(), 1); - assertEquals("Wrong type", result.get(0).getType(), "java.lang.IllegalArgumentException"); - assertEquals("Wrong description", result.get(0).getDescription(), "some text"); - } - - @Test - public void extractExceptionDescription() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); - doReturn(Arrays.asList(throwsTree)).when(docCommentTree).getBlockTags(); - when(throwsTree.getKind()).thenReturn(Kind.THROWS); - doReturn(Arrays.asList(textTree)).when(throwsTree).getDescription(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(textTree.toString()).thenReturn("some weird text"); - - String result = classItemsLookup.extractExceptionDescription(method); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(method); - verify(docCommentTree).getBlockTags(); - verify(throwsTree).getKind(); - assertEquals("Wrong description", result, "some weird text"); - } - - @Test - public void extractReturnForExecutableElement() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method0 = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - ExecutableElement method1 = ElementFilter.methodsIn(element.getEnclosedElements()).get(1); - ExecutableElement method2 = ElementFilter.methodsIn(element.getEnclosedElements()).get(2); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method0)).thenReturn(docCommentTree); - when(docTrees.getDocCommentTree(method1)).thenReturn(docCommentTree); - doReturn(Arrays.asList(returnTree)).when(docCommentTree).getBlockTags(); - when(returnTree.getKind()).thenReturn(Kind.RETURN); - doReturn(Arrays.asList(textTree)).when(returnTree).getDescription(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(textTree.toString()).thenReturn("bla", "bla-bla"); - - checkReturnForExecutableElement(method0, "int", "bla"); - checkReturnForExecutableElement(method1, "java.lang.String", "bla-bla"); - checkVoidReturnForExecutableElement(method2); - - verify(environment, times(2)).getDocTrees(); - verify(docTrees).getDocCommentTree(method0); - verify(docTrees).getDocCommentTree(method1); - verify(docCommentTree, times(2)).getBlockTags(); - verify(returnTree, times(2)).getKind(); - verify(textTree, times(2)).getKind(); - } - - private void checkReturnForExecutableElement(ExecutableElement executableElement, String expectedType, - String expectedDescription) { - Return result = classItemsLookup.extractReturn(executableElement); - - assertEquals(result.getReturnType(), expectedType); - assertEquals(result.getReturnDescription(), expectedDescription); - } - - private void checkVoidReturnForExecutableElement(ExecutableElement executableElement) { - assertNull(classItemsLookup.extractReturn(executableElement)); - } - - @Test - public void extractReturnDescription() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExecutableElement method0 = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method0)).thenReturn(docCommentTree); - doReturn(Arrays.asList(returnTree)).when(docCommentTree).getBlockTags(); - when(returnTree.getKind()).thenReturn(Kind.RETURN); - when(textTree.getKind()).thenReturn(Kind.TEXT); - doReturn(Arrays.asList(textTree)).when(returnTree).getDescription(); - when(textTree.toString()).thenReturn("bla-bla description"); - - String result = classItemsLookup.extractReturnDescription(method0); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(method0); - verify(docCommentTree).getBlockTags(); - verify(returnTree).getKind(); - assertEquals("Wrong description", result, "bla-bla description"); - } - - @Test - public void extractReturnForVariableElement() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - - checkReturnForVariableElement(element, 0, "java.lang.String"); - checkReturnForVariableElement(element, 1, "java.lang.String"); - checkReturnForVariableElement(element, 2, "int"); - checkReturnForVariableElement(element, 3, "int"); - checkReturnForVariableElement(element, 4, "java.lang.String"); - } - - private void checkReturnForVariableElement(TypeElement element, int variableNumber, String expectedType) { - VariableElement variableElement = ElementFilter.fieldsIn(element.getEnclosedElements()).get(variableNumber); - - Return result = classItemsLookup.extractReturn(variableElement); - - assertEquals(result.getReturnType(), expectedType); - } - - @Test - public void convertFullNameToOverload() { - assertEquals("Wrong result", classItemsLookup.convertFullNameToOverload( - "com.microsoft.samples.SuperHero.successfullyAttacked(int,java.lang.String)"), - "com.microsoft.samples.SuperHero.successfullyAttacked*"); - - assertEquals("Wrong result for case with generics", classItemsLookup.convertFullNameToOverload( - "com.microsoft.samples.subpackage.Display.show()"), - "com.microsoft.samples.subpackage.Display.show*"); - - assertEquals("Wrong result for constructor case", classItemsLookup.convertFullNameToOverload( - "com.microsoft.samples.SuperHero.SuperHero()"), - "com.microsoft.samples.SuperHero.SuperHero*"); - } - - @Test - public void determineTypeForEnumConstant() { - TypeElement element = elements - .getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); - - assertEquals(classItemsLookup.determineType(element.getEnclosedElements().get(0)), "Field"); - assertEquals(classItemsLookup.determineType(element.getEnclosedElements().get(1)), "Field"); - } - - @Test - public void extractDeprecatedDescription() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); - ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); - String depMsg = "Deprecated Message :("; - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); - doReturn(Arrays.asList(deprecatedTree)).when(docCommentTree).getBlockTags(); - when(deprecatedTree.getKind()).thenReturn(Kind.DEPRECATED); - - doReturn(Arrays.asList(textTree)).when(deprecatedTree).getBody(); - when(textTree.getKind()).thenReturn(Kind.TEXT); - when(textTree.toString()).thenReturn(depMsg); - - String result = classItemsLookup.extractDeprecatedDescription(method); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(method); - verify(docCommentTree).getBlockTags(); - verify(deprecatedTree).getKind(); - assertEquals("Wrong description", result, depMsg); - } + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private List allGenderElements; + private List allPersonElements; + private DocletEnvironment environment; + private DocTrees docTrees; + private DocCommentTree docCommentTree; + private ParamTree paramTree; + private ThrowsTree throwsTree; + private ReturnTree returnTree; + private DeprecatedTree deprecatedTree; + private TextTree textTree; + private IdentifierTree identifierTree; + private ClassItemsLookup classItemsLookup; + + @Before + public void setup() { + elements = rule.getElements(); + allGenderElements = + elements + .getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender") + .getEnclosedElements() + .stream() + .collect(Collectors.toList()); + allPersonElements = + elements + .getTypeElement("com.microsoft.samples.subpackage.Person") + .getEnclosedElements() + .stream() + .collect(Collectors.toList()); + environment = Mockito.mock(DocletEnvironment.class); + docTrees = Mockito.mock(DocTrees.class); + docCommentTree = Mockito.mock(DocCommentTree.class); + paramTree = Mockito.mock(ParamTree.class); + throwsTree = Mockito.mock(ThrowsTree.class); + returnTree = Mockito.mock(ReturnTree.class); + deprecatedTree = Mockito.mock(DeprecatedTree.class); + textTree = Mockito.mock(TextTree.class); + identifierTree = Mockito.mock(IdentifierTree.class); + classItemsLookup = new ClassItemsLookup(environment, Mockito.mock(ElementUtil.class)); + } + + @Test + public void extractParameters() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); + doReturn(Arrays.asList(paramTree)).when(docCommentTree).getBlockTags(); + when(paramTree.getKind()).thenReturn(Kind.PARAM); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(paramTree.getName()).thenReturn(identifierTree); + doReturn(Arrays.asList(textTree)).when(paramTree).getDescription(); + when(textTree.toString()).thenReturn("some text bla", "some text bla-bla"); + when(identifierTree.toString()).thenReturn("incomingDamage", "damageType"); + + List result = classItemsLookup.extractParameters(method); + + verify(environment, times(2)).getDocTrees(); + verify(docTrees, times(2)).getDocCommentTree(method); + verify(docCommentTree, times(2)).getBlockTags(); + assertEquals("Wrong parameters count", result.size(), 2); + + assertEquals("Wrong first param id", result.get(0).getId(), "incomingDamage"); + assertEquals("Wrong first param type", result.get(0).getType(), "int"); + assertEquals("Wrong first param description", result.get(0).getDescription(), "some text bla"); + + assertEquals("Wrong second param id", result.get(1).getId(), "damageType"); + assertEquals("Wrong second param type", result.get(1).getType(), "java.lang.String"); + assertEquals( + "Wrong second param description", result.get(1).getDescription(), "some text bla-bla"); + } + + @Test + public void extractParameterDescription() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + String paramName = "incomingDamage"; + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); + doReturn(Arrays.asList(paramTree)).when(docCommentTree).getBlockTags(); + when(paramTree.getKind()).thenReturn(Kind.PARAM); + doReturn(identifierTree).when(paramTree).getName(); + doReturn(Arrays.asList(textTree)).when(paramTree).getDescription(); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(textTree.toString()).thenReturn("some weird text"); + when(identifierTree.toString()).thenReturn(paramName); + + String result = classItemsLookup.extractParameterDescription(method, paramName); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(method); + verify(docCommentTree).getBlockTags(); + assertEquals("Wrong param description", result, "some weird text"); + } + + @Test + public void extractExceptions() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); + doReturn(Arrays.asList(throwsTree)).when(docCommentTree).getBlockTags(); + when(throwsTree.getKind()).thenReturn(Kind.THROWS); + doReturn(Arrays.asList(textTree)).when(throwsTree).getDescription(); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(textTree.toString()).thenReturn("some text"); + + List result = classItemsLookup.extractExceptions(method); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(method); + verify(docCommentTree).getBlockTags(); + verify(throwsTree).getKind(); + assertEquals("Wrong exceptions count", result.size(), 1); + assertEquals("Wrong type", result.get(0).getType(), "java.lang.IllegalArgumentException"); + assertEquals("Wrong description", result.get(0).getDescription(), "some text"); + } + + @Test + public void extractExceptionDescription() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method)).thenReturn(docCommentTree); + doReturn(Arrays.asList(throwsTree)).when(docCommentTree).getBlockTags(); + when(throwsTree.getKind()).thenReturn(Kind.THROWS); + doReturn(Arrays.asList(textTree)).when(throwsTree).getDescription(); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(textTree.toString()).thenReturn("some weird text"); + + String result = classItemsLookup.extractExceptionDescription(method); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(method); + verify(docCommentTree).getBlockTags(); + verify(throwsTree).getKind(); + assertEquals("Wrong description", result, "some weird text"); + } + + @Test + public void extractReturnForExecutableElement() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method0 = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + ExecutableElement method1 = ElementFilter.methodsIn(element.getEnclosedElements()).get(1); + ExecutableElement method2 = ElementFilter.methodsIn(element.getEnclosedElements()).get(2); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method0)).thenReturn(docCommentTree); + when(docTrees.getDocCommentTree(method1)).thenReturn(docCommentTree); + doReturn(Arrays.asList(returnTree)).when(docCommentTree).getBlockTags(); + when(returnTree.getKind()).thenReturn(Kind.RETURN); + doReturn(Arrays.asList(textTree)).when(returnTree).getDescription(); + when(textTree.getKind()).thenReturn(Kind.TEXT); + when(textTree.toString()).thenReturn("bla", "bla-bla"); + + checkReturnForExecutableElement(method0, "int", "bla"); + checkReturnForExecutableElement(method1, "java.lang.String", "bla-bla"); + checkVoidReturnForExecutableElement(method2); + + verify(environment, times(2)).getDocTrees(); + verify(docTrees).getDocCommentTree(method0); + verify(docTrees).getDocCommentTree(method1); + verify(docCommentTree, times(2)).getBlockTags(); + verify(returnTree, times(2)).getKind(); + verify(textTree, times(2)).getKind(); + } + + private void checkReturnForExecutableElement( + ExecutableElement executableElement, String expectedType, String expectedDescription) { + Return result = classItemsLookup.extractReturn(executableElement); + + assertEquals(result.getReturnType(), expectedType); + assertEquals(result.getReturnDescription(), expectedDescription); + } + + private void checkVoidReturnForExecutableElement(ExecutableElement executableElement) { + assertNull(classItemsLookup.extractReturn(executableElement)); + } + + @Test + public void extractReturnDescription() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExecutableElement method0 = ElementFilter.methodsIn(element.getEnclosedElements()).get(0); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(method0)).thenReturn(docCommentTree); + doReturn(Arrays.asList(returnTree)).when(docCommentTree).getBlockTags(); + when(returnTree.getKind()).thenReturn(Kind.RETURN); + when(textTree.getKind()).thenReturn(Kind.TEXT); + doReturn(Arrays.asList(textTree)).when(returnTree).getDescription(); + when(textTree.toString()).thenReturn("bla-bla description"); + + String result = classItemsLookup.extractReturnDescription(method0); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(method0); + verify(docCommentTree).getBlockTags(); + verify(returnTree).getKind(); + assertEquals("Wrong description", result, "bla-bla description"); + } + + @Test + public void extractReturnForVariableElement() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + + checkReturnForVariableElement(element, 0, "java.lang.String"); + checkReturnForVariableElement(element, 1, "java.lang.String"); + checkReturnForVariableElement(element, 2, "int"); + checkReturnForVariableElement(element, 3, "int"); + checkReturnForVariableElement(element, 4, "java.lang.String"); + } + + private void checkReturnForVariableElement( + TypeElement element, int variableNumber, String expectedType) { + VariableElement variableElement = + ElementFilter.fieldsIn(element.getEnclosedElements()).get(variableNumber); + + Return result = classItemsLookup.extractReturn(variableElement); + + assertEquals(result.getReturnType(), expectedType); + } + + @Test + public void convertFullNameToOverload() { + assertEquals( + "Wrong result", + classItemsLookup.convertFullNameToOverload( + "com.microsoft.samples.SuperHero.successfullyAttacked(int,java.lang.String)"), + "com.microsoft.samples.SuperHero.successfullyAttacked*"); + + assertEquals( + "Wrong result for case with generics", + classItemsLookup.convertFullNameToOverload( + "com.microsoft.samples.subpackage.Display.show()"), + "com.microsoft.samples.subpackage.Display.show*"); + + assertEquals( + "Wrong result for constructor case", + classItemsLookup.convertFullNameToOverload("com.microsoft.samples.SuperHero.SuperHero()"), + "com.microsoft.samples.SuperHero.SuperHero*"); + } + + @Test + public void determineTypeForEnumConstant() { + TypeElement element = + elements.getTypeElement( + "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); + + assertEquals(classItemsLookup.determineType(element.getEnclosedElements().get(0)), "Field"); + assertEquals(classItemsLookup.determineType(element.getEnclosedElements().get(1)), "Field"); + } + + @Test + public void testExtractJavaTypeStaticMethod() { + Element staticMethod = getElementByName(allGenderElements, "valueOf(java.lang.String)"); + assertEquals("Wrong javaType", "static method", classItemsLookup.extractJavaType(staticMethod)); + } + + @Test + public void testExtractJavaTypeStaticField() { + Element field = getElementByName(allGenderElements, "FEMALE"); + assertEquals("Wrong javaType", "static field", classItemsLookup.extractJavaType(field)); + } + + @Test + public void testExtractJavaTypeNonStatic() { + Element constructor = getElementByName(allGenderElements, "Gender()"); + assertEquals("Wrong javaType", null, classItemsLookup.extractJavaType(constructor)); + + Element nonStaticMethod = getElementByName(allPersonElements, "getFirstName()"); + assertEquals("Wrong javaType", null, classItemsLookup.extractJavaType(nonStaticMethod)); + + Element nonStaticField = getElementByName(allPersonElements, "age"); + assertEquals("Wrong javaType", null, classItemsLookup.extractJavaType(nonStaticField)); + } + + private Element getElementByName(List elements, String name) { + return elements.stream().filter(e -> e.toString().equals(name)).findFirst().orElse(null); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java index d8cf88e3..f70fda8e 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/lookup/ClassLookupTest.java @@ -1,14 +1,25 @@ package com.microsoft.lookup; +import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.when; + import com.google.testing.compile.CompilationRule; import com.microsoft.lookup.model.ExtendedMetadataFileItem; import com.microsoft.model.Status; import com.microsoft.model.TypeParameter; +import com.microsoft.util.ElementUtil; import com.sun.source.doctree.DeprecatedTree; import com.sun.source.doctree.DocCommentTree; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.TextTree; import com.sun.source.util.DocTrees; +import java.util.List; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.Elements; import jdk.javadoc.doclet.DocletEnvironment; import org.junit.Before; import org.junit.Rule; @@ -17,224 +28,209 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; -import java.util.Arrays; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.*; - @RunWith(MockitoJUnitRunner.class) public class ClassLookupTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private ClassLookup classLookup; - private DocletEnvironment environment; - private DocTrees docTrees; - private DocTree docTree; - private DocCommentTree docCommentTree; - private DeprecatedTree deprecatedTree; - private TextTree textTree; - - @Before - public void setup() { - elements = rule.getElements(); - environment = Mockito.mock(DocletEnvironment.class); - classLookup = new ClassLookup(environment); - docTrees = Mockito.mock(DocTrees.class); - docTree = Mockito.mock(DocTree.class); - docCommentTree = Mockito.mock(DocCommentTree.class); - deprecatedTree = Mockito.mock(DeprecatedTree.class); - textTree = Mockito.mock(TextTree.class); - } - - @Test - public void determineTypeParameters() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - - List result = classLookup.determineTypeParameters(element); - - assertEquals("Wrong type params size", result.size(), 1); - assertEquals("Wrong type parameter id", result.get(0).getId(), "T"); - } - - @Test - public void determineSuperclass() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); - - String result = classLookup.determineSuperclass(element); - - assertEquals("Wrong result", result, "java.lang.Object"); - } - - @Test - public void determineSuperclassForChildClass() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - - String result = classLookup.determineSuperclass(element); - - assertEquals("Wrong result", result, "com.microsoft.samples.subpackage.Person"); - } - - @Test - public void determineSuperclassForEnum() { - TypeElement element = elements - .getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); - - String result = classLookup.determineSuperclass(element); - - assertEquals("Wrong result", result, - "java.lang.Enum"); - } - - @Test - public void determineClassContent() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); - - classLookup.populateContent(element, "SuperHero", container); - - assertEquals("Wrong content", container.getContent(), - "public class SuperHero extends Person implements Serializable, Cloneable"); - - - assertTrue("Wrong set of interfaces", container.getInterfaces().contains("java.io.Serializable")); - assertTrue("Wrong set of interfaces", container.getInterfaces().contains("java.lang.Cloneable")); - } - - @Test - public void determineClassContentForInterface() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); - ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); - - classLookup.populateContent(element, "Display", container); - - assertEquals("Wrong content", container.getContent(), - "public interface Display extends Serializable, List>"); - - - assertTrue("Wrong set of interfaces", container.getInterfaces().contains("java.io.Serializable")); - assertTrue("Wrong set of interfaces", container.getInterfaces().contains("java.util.List>")); - } - - @Test - public void determineClassContentForEnum() { - TypeElement element = elements - .getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); - ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); - - classLookup.populateContent(element, "Person.IdentificationInfo.Gender", container); - - assertEquals("Wrong content", container.getContent(), - "public enum Person.IdentificationInfo.Gender extends Enum"); - } - - @Test - public void determineClassContentForStaticClass() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo"); - ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); - - classLookup.populateContent(element, "Person.IdentificationInfo", container); - - assertEquals("Wrong content", container.getContent(), "public static class Person.IdentificationInfo"); - } - - @Test - public void determineTypeForInterface() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); - - assertEquals(classLookup.determineType(element), "Interface"); - } - - @Test - public void determineTypeForEnum() { - TypeElement element = elements - .getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); - - assertEquals(classLookup.determineType(element), "Enum"); - } - - @Test - public void determineTypeForClass() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo"); - - assertEquals(classLookup.determineType(element), "Class"); - } - - @Test - public void extractDeprecatedDescription() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); - String depMsg = "Deprecated Message :("; - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); - doReturn(Arrays.asList(deprecatedTree)).when(docCommentTree).getBlockTags(); - when(deprecatedTree.getKind()).thenReturn(DocTree.Kind.DEPRECATED); - - doReturn(Arrays.asList(textTree)).when(deprecatedTree).getBody(); - when(textTree.getKind()).thenReturn(DocTree.Kind.TEXT); - when(textTree.toString()).thenReturn(depMsg); - - String result = classLookup.extractDeprecatedDescription(element); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(element); - verify(docCommentTree).getBlockTags(); - verify(deprecatedTree).getKind(); - assertEquals("Wrong description", result, depMsg); - } - - @Test - public void extractDeprecatedDescriptionNull() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); - doReturn(Arrays.asList()).when(docCommentTree).getBlockTags(); - - String result = classLookup.extractDeprecatedDescription(element); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(element); - verify(docCommentTree).getBlockTags(); - assertEquals("Wrong description", result, null); - } - - @Test - public void extractStatusDeprecated() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); - - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); - doReturn(Arrays.asList(deprecatedTree)).when(docCommentTree).getBlockTags(); - when(deprecatedTree.getKind()).thenReturn(DocTree.Kind.DEPRECATED); - - String result = classLookup.extractStatus(element); - - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(element); - verify(docCommentTree).getBlockTags(); - verify(deprecatedTree).getKind(); - assertEquals("Wrong description", result, Status.DEPRECATED.toString()); - } - - @Test - public void extractStatusNotDeprecated() { - TypeElement element = elements.getTypeElement("com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private ClassLookup classLookup; + private DocletEnvironment environment; + private DocTrees docTrees; + private DocTree docTree; + private DocCommentTree docCommentTree; + private DeprecatedTree deprecatedTree; + private TextTree textTree; + private TypeMirror typeMirror; + private ClassItemsLookup classItemsLookup; + + @Before + public void setup() { + elements = rule.getElements(); + environment = Mockito.mock(DocletEnvironment.class); + classLookup = new ClassLookup(environment, Mockito.mock(ElementUtil.class)); + docTrees = Mockito.mock(DocTrees.class); + docTree = Mockito.mock(DocTree.class); + docCommentTree = Mockito.mock(DocCommentTree.class); + deprecatedTree = Mockito.mock(DeprecatedTree.class); + textTree = Mockito.mock(TextTree.class); + typeMirror = Mockito.mock(TypeMirror.class); + classItemsLookup = new ClassItemsLookup(environment, Mockito.mock(ElementUtil.class)); + + when(environment.getDocTrees()).thenReturn(docTrees); + } + + @Test + public void determineTypeParameters() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + + List result = classLookup.determineTypeParameters(element); + + assertEquals("Wrong type params size", result.size(), 1); + assertEquals("Wrong type parameter id", result.get(0).getId(), "T"); + } + + @Test + public void determineSuperclass() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Person"); + + String result = classLookup.determineSuperclass(element); + + assertEquals("Wrong result", result, "java.lang.Object"); + } + + @Test + public void determineSuperclassForChildClass() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + + String result = classLookup.determineSuperclass(element); + + assertEquals("Wrong result", result, "com.microsoft.samples.subpackage.Person"); + } + + @Test + public void determineSuperclassForEnum() { + TypeElement element = + elements.getTypeElement( + "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); + + String result = classLookup.determineSuperclass(element); + + assertEquals( + "Wrong result", + result, + "java.lang.Enum"); + } + + @Test + public void determineClassContent() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); + + classLookup.populateContent(element, "SuperHero", container); + + assertEquals( + "Wrong content", + container.getContent(), + "public class SuperHero extends Person implements Serializable, Cloneable"); + + assertTrue( + "Wrong set of interfaces", container.getInterfaces().contains("java.io.Serializable")); + assertTrue( + "Wrong set of interfaces", container.getInterfaces().contains("java.lang.Cloneable")); + } + + @Test + public void determineClassContentForInterface() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); + ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); + + classLookup.populateContent(element, "Display", container); + + assertEquals( + "Wrong content", + container.getContent(), + "public interface Display extends Serializable, List>"); + + assertTrue( + "Wrong set of interfaces", container.getInterfaces().contains("java.io.Serializable")); + assertTrue( + "Wrong set of interfaces", + container + .getInterfaces() + .contains("java.util.List>")); + } + + @Test + public void determineClassContentForEnum() { + TypeElement element = + elements.getTypeElement( + "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); + ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); + + classLookup.populateContent(element, "Person.IdentificationInfo.Gender", container); + + assertEquals( + "Wrong content", + container.getContent(), + "public enum Person.IdentificationInfo.Gender extends Enum"); + } - when(environment.getDocTrees()).thenReturn(docTrees); - when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); - doReturn(Arrays.asList()).when(docCommentTree).getBlockTags(); - - String result = classLookup.extractStatus(element); + @Test + public void determineClassContentForStaticClass() { + TypeElement element = + elements.getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo"); + ExtendedMetadataFileItem container = new ExtendedMetadataFileItem("UID"); + + classLookup.populateContent(element, "Person.IdentificationInfo", container); - verify(environment).getDocTrees(); - verify(docTrees).getDocCommentTree(element); - verify(docCommentTree).getBlockTags(); - assertEquals("Wrong description", result, null); - } + assertEquals( + "Wrong content", container.getContent(), "public static class Person.IdentificationInfo"); + } + + @Test + public void determineTypeForInterface() { + TypeElement element = elements.getTypeElement("com.microsoft.samples.subpackage.Display"); + + assertEquals(classLookup.determineType(element), "Interface"); + } + + @Test + public void determineTypeForEnum() { + TypeElement element = + elements.getTypeElement( + "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender"); + + assertEquals(classLookup.determineType(element), "Enum"); + } + + @Test + public void determineTypeForClass() { + TypeElement element = + elements.getTypeElement("com.microsoft.samples.subpackage.Person.IdentificationInfo"); + + assertEquals(classLookup.determineType(element), "Class"); + } + + @Test + public void extractStatus_deprecated() { + TypeElement element = + elements.getTypeElement( + "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations"); + + String result = classLookup.extractStatus(element); + + assertEquals("Wrong description", result, Status.DEPRECATED.toString()); + } + + @Test + public void extractStatus_notDeprecated() { + TypeElement element = + elements.getTypeElement("com.microsoft.samples.agreements.AgreementMetaData"); + + String result = classLookup.extractStatus(element); + + assertNull("Wrong description", result); + } + + @Test + public void testExtractJavaType() { + TypeElement typeElement = + elements.getTypeElement("com.microsoft.samples.google.ValidationException"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), "exception"); + + typeElement = elements.getTypeElement("com.microsoft.samples.google.RecognitionAudio"); + assertNull("Wrong javaType", classLookup.extractJavaType(typeElement)); + + typeElement = elements.getTypeElement("com.microsoft.samples.google.BetaApi"); + assertEquals("Wrong javaType", classLookup.extractJavaType(typeElement), "annotationtype"); + + typeElement = elements.getTypeElement("com.microsoft.samples.IPartner"); + assertNull("Wrong javaType", classLookup.extractJavaType(typeElement)); + } + + @Test + public void testExtractStatus_class_beta() { + TypeElement betaApi = elements.getTypeElement("com.microsoft.samples.google.BetaApi"); + assertThat(classLookup.extractStatus(betaApi)).isEqualTo("beta"); + } } 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 4a381022..91d1d95b 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,7 +1,19 @@ 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; import org.junit.Before; import org.junit.Rule; @@ -10,46 +22,214 @@ import org.mockito.Mockito; import org.mockito.junit.MockitoJUnitRunner; -import javax.lang.model.element.PackageElement; -import javax.lang.model.util.Elements; - -import static org.junit.Assert.assertEquals; - @RunWith(MockitoJUnitRunner.class) public class PackageLookupTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private PackageLookup packageLookup; - private DocletEnvironment environment; + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private PackageLookup packageLookup; + private DocletEnvironment environment; + + @Before + public void setup() { + elements = rule.getElements(); + environment = Mockito.mock(DocletEnvironment.class); + packageLookup = new PackageLookup(environment); + } + + @Test + public void extractPackageContent() { + PackageElement element = elements.getPackageElement("com.microsoft.samples"); + + String result = packageLookup.determinePackageContent(element); + + assertEquals("Wrong result", result, "package com.microsoft.samples"); + } + + @Test + public void extractPackageStatus() { + 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(alpha); + String resultB = packageLookup.extractStatus(beta); + String resultV1 = packageLookup.extractStatus(v1); + + assertThat(resultA).isEqualTo(Status.ALPHA.toString()); + assertThat(resultB).isEqualTo(Status.BETA.toString()); + assertThat(resultV1).isNull(); + } + + @Test + public void testExtractJavaType() { + PackageElement packageElement = + 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"); + } - @Before - public void setup() { - elements = rule.getElements(); - environment = Mockito.mock(DocletEnvironment.class); - packageLookup = new PackageLookup(environment); - } + @Test + public void testFindStubPackage() { + ImmutableList packages = + ImmutableList.of( + elements.getPackageElement("com.microsoft.samples.google.v1"), + elements.getPackageElement("com.microsoft.samples.google.v1.stub"), + elements.getPackageElement("com.microsoft.samples.google.v1beta"), + elements.getPackageElement("com.microsoft.samples.google")); - @Test - public void extractPackageContent() { - PackageElement element = elements.getPackageElement("com.microsoft.samples"); + List foundStubPackages = + packageLookup.findStubPackages( + elements.getPackageElement("com.microsoft.samples.google.v1"), packages); + assertThat(foundStubPackages).isNotEmpty(); + assertThat(foundStubPackages).hasSize(1); + assertThat(toPackageName(foundStubPackages.get(0))) + .isEqualTo("com.microsoft.samples.google.v1.stub"); - String result = packageLookup.determinePackageContent(element); + List notFoundStubPackageOfStubPackage = + packageLookup.findStubPackages( + elements.getPackageElement("com.microsoft.samples.google.v1.stub"), packages); + assertThat(notFoundStubPackageOfStubPackage).isEmpty(); - assertEquals("Wrong result", result, "package com.microsoft.samples"); - } + List notFoundStubPackage = + packageLookup.findStubPackages( + elements.getPackageElement("com.microsoft.samples.google"), packages); + assertThat(notFoundStubPackage).isEmpty(); + } - @Test - public void extractPackageStatus() { - PackageElement elementBeta = elements.getPackageElement("com.microsoft.samples.google.v1beta"); - PackageElement elementAlpha = elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"); + @Test + public void testIsApiStubPackage() { + assertThat( + packageLookup.isApiVersionStubPackage( + elements.getPackageElement("com.microsoft.samples.google.v1"))) + .isFalse(); + assertThat( + packageLookup.isApiVersionStubPackage( + elements.getPackageElement("com.microsoft.samples.google.v1.stub"))) + .isTrue(); + assertThat( + packageLookup.isApiVersionStubPackageName("com.microsoft.samples.google.v1.stub.child")) + .isTrue(); - String resultA = packageLookup.extractStatus(elementAlpha.getQualifiedName().toString()); - String resultB = packageLookup.extractStatus(elementBeta.getQualifiedName().toString()); + assertThat(packageLookup.isApiVersionStubPackageName("a")).isFalse(); + // False due to not being an API version package, even though it ends in .stub + assertThat(packageLookup.isApiVersionStubPackageName("a.stub")).isFalse(); + } - assertEquals("Wrong result", resultA, Status.ALPHA.toString()); - assertEquals("Wrong result", resultB, Status.BETA.toString()); - } + private List toPackageNames(List packages) { + return packages.stream().map(this::toPackageName).collect(Collectors.toList()); + } + private String toPackageName(PackageElement pkg) { + return String.valueOf(pkg.getQualifiedName()); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/ApiVersionPackageTocTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/ApiVersionPackageTocTest.java new file mode 100644 index 00000000..693bc87b --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/ApiVersionPackageTocTest.java @@ -0,0 +1,71 @@ +package com.microsoft.model; + +import static com.google.common.truth.Truth.assertThat; + +import java.util.List; +import org.junit.Test; + +public class ApiVersionPackageTocTest { + private static final TocItem TOC_ITEM = new TocItem("a", "b", ""); + + private final ApiVersionPackageToc toc = new ApiVersionPackageToc(); + + @Test + public void testUncategorized() { + toc.addUncategorized(TOC_ITEM); + List tocItems = toc.toList(); + + assertThat(tocItems).hasSize(1); + + TocItem allOthers = tocItems.get(0); + assertThat(allOthers.getName()).isEqualTo(ApiVersionPackageToc.ALL_OTHERS); + assertThat(allOthers.getItems()).hasSize(1); + + TocItem uncategorized = allOthers.getItems().get(0); + assertThat(uncategorized.getName()).isEqualTo(ApiVersionPackageToc.UNCATEGORIZED); + assertThat(uncategorized.getItems()).hasSize(1); + assertThat(uncategorized.getItems().get(0)).isEqualTo(TOC_ITEM); + } + + @Test + public void testClients() { + toc.addClient(TOC_ITEM); + List tocItems = toc.toList(); + + assertThat(tocItems).hasSize(1); + + TocItem clients = tocItems.get(0); + assertThat(clients.getName()).isEqualTo(ApiVersionPackageToc.CLIENTS); + assertThat(clients.getItems()).hasSize(1); + assertThat(clients.getItems().get(0)).isEqualTo(TOC_ITEM); + } + + @Test + public void testVisibleAndHidden() { + toc.addRequestOrResponse(TOC_ITEM); + toc.addSettings(new TocItem("TestSettings", "TestSettings", "")); + toc.addInterface(new TocItem("iTest", "iTest", "")); + + List tocItems = toc.toList(); + + assertThat(tocItems).hasSize(3); + + TocItem settings = tocItems.get(0); + assertThat(settings.getName()).isEqualTo(ApiVersionPackageToc.SETTINGS); + assertThat(settings.getItems()).hasSize(1); + assertThat(settings.getItems().get(0).getName()).isEqualTo("TestSettings"); + + TocItem reqsAndResponses = tocItems.get(1); + assertThat(reqsAndResponses.getName()).isEqualTo(ApiVersionPackageToc.REQUESTS_AND_RESPONSES); + assertThat(reqsAndResponses.getItems()).hasSize(1); + assertThat(reqsAndResponses.getItems().get(0)).isEqualTo(TOC_ITEM); + + TocItem allOthers = tocItems.get(2); + assertThat(allOthers.getName()).isEqualTo(ApiVersionPackageToc.ALL_OTHERS); + assertThat(allOthers.getItems()).hasSize(1); + TocItem uncategorized = allOthers.getItems().get(0); + assertThat(uncategorized.getName()).isEqualTo(ApiVersionPackageToc.INTERFACES); + assertThat(uncategorized.getItems()).hasSize(1); + assertThat(uncategorized.getItems().get(0).getName()).isEqualTo("iTest"); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/MetadataFileItemTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/MetadataFileItemTest.java index 422fdca3..a5a9bd8f 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/MetadataFileItemTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/MetadataFileItemTest.java @@ -1,155 +1,165 @@ package com.microsoft.model; -import org.junit.Test; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; import java.util.List; - -import static org.junit.Assert.*; +import org.junit.Test; public class MetadataFileItemTest { - @Test - public void testEquals() { - MetadataFileItem object1 = new MetadataFileItem("123"); - MetadataFileItem object2 = new MetadataFileItem("1234"); - MetadataFileItem object3 = new MetadataFileItem("123"); - - assertTrue("Should be equal to self", object1.equals(object1)); - assertFalse("Should not be equal to null", object1.equals(null)); - assertFalse("Should not be equal to object of another type", object1.equals(123)); - assertFalse("Should not be equal to object with another uid", object1.equals(object2)); - assertTrue("Should be equal to object with same uid", object1.equals(object3)); - } - - @Test - public void testHashCode() { - String uid = "123"; - MetadataFileItem object = new MetadataFileItem(uid); - - assertEquals("Wrong result", uid.hashCode(), object.hashCode()); - } - - @Test - public void setTypeParameters() { - MetadataFileItem object = new MetadataFileItem("123"); - List typeParams = new ArrayList<>(); - - object.setTypeParameters(typeParams); - - assertNotNull("Syntax should not be null", object.getSyntax()); - assertEquals("Wrong typeParameters value", object.getSyntax().getTypeParameters(), typeParams); - } - - @Test - public void setTypeParametersWhenSyntaxAlreadyPresent() { - MetadataFileItem object = new MetadataFileItem("123"); - Syntax existingSyntax = new Syntax(); - object.setSyntax(existingSyntax); - List typeParams = new ArrayList<>(); - - object.setTypeParameters(typeParams); - - assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); - assertEquals("Wrong typeParameters value", object.getSyntax().getTypeParameters(), typeParams); - } - - @Test - public void setParameters() { - MetadataFileItem object = new MetadataFileItem("123"); - List params = new ArrayList<>(); - - object.setParameters(params); - - assertNotNull("Syntax should not be null", object.getSyntax()); - assertEquals("Wrong parameters value", object.getSyntax().getParameters(), params); - } - - @Test - public void setParametersWhenSyntaxAlreadyPresent() { - MetadataFileItem object = new MetadataFileItem("123"); - Syntax existingSyntax = new Syntax(); - object.setSyntax(existingSyntax); - List params = new ArrayList<>(); - - object.setParameters(params); - - assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); - assertEquals("Wrong parameters value", object.getSyntax().getParameters(), params); - } - - @Test - public void setReturn() { - MetadataFileItem object = new MetadataFileItem("123"); - Return returnValue = new Return("type"); - - object.setReturn(returnValue); - - assertNotNull("Syntax should not be null", object.getSyntax()); - assertEquals("Wrong return value", object.getSyntax().getReturnValue(), returnValue); - } - - @Test - public void setReturnWhenSyntaxAlreadyPresent() { - MetadataFileItem object = new MetadataFileItem("123"); - Syntax existingSyntax = new Syntax(); - object.setSyntax(existingSyntax); - Return returnValue = new Return("type"); - - object.setReturn(returnValue); - - assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); - assertEquals("Wrong return value", object.getSyntax().getReturnValue(), returnValue); - } - - @Test - public void setContent() { - MetadataFileItem object = new MetadataFileItem("123"); - String content = "Some content"; - - object.setContent(content); - - assertNotNull("Syntax should not be null", object.getSyntax()); - assertEquals("Wrong content value", object.getSyntax().getContent(), content); - } - - @Test - public void setContentWhenSyntaxAlreadyPresent() { - MetadataFileItem object = new MetadataFileItem("123"); - Syntax existingSyntax = new Syntax(); - object.setSyntax(existingSyntax); - String content = "Some content"; + @Test + public void testEquals() { + MetadataFileItem object1 = new MetadataFileItem("123"); + MetadataFileItem object2 = new MetadataFileItem("1234"); + MetadataFileItem object3 = new MetadataFileItem("123"); - object.setContent(content); + assertTrue("Should be equal to self", object1.equals(object1)); + assertFalse("Should not be equal to null", object1.equals(null)); + assertFalse("Should not be equal to object of another type", object1.equals(123)); + assertFalse("Should not be equal to object with another uid", object1.equals(object2)); + assertTrue("Should be equal to object with same uid", object1.equals(object3)); + } - assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); - assertEquals("Wrong content value", object.getSyntax().getContent(), content); - } + @Test + public void testHashCode() { + String uid = "123"; + MetadataFileItem object = new MetadataFileItem(uid); - @Test - public void setInheritance() { - MetadataFileItem object = new MetadataFileItem("123"); + assertEquals("Wrong result", uid.hashCode(), object.hashCode()); + } - object.setInheritance(Arrays.asList("Some value")); + @Test + public void setTypeParameters() { + MetadataFileItem object = new MetadataFileItem("123"); + List typeParams = new ArrayList<>(); - assertEquals("Wrong inheritance size", object.getInheritance().size(), 1); - assertTrue("Wrong inheritance content", object.getInheritance().contains("Some value")); - } + object.setTypeParameters(typeParams); - @Test - public void setInheritanceForNull() { - MetadataFileItem object = new MetadataFileItem("123"); + assertNotNull("Syntax should not be null", object.getSyntax()); + assertEquals("Wrong typeParameters value", object.getSyntax().getTypeParameters(), typeParams); + } - object.setInheritance(null); + @Test + public void setTypeParametersWhenSyntaxAlreadyPresent() { + MetadataFileItem object = new MetadataFileItem("123"); + Syntax existingSyntax = new Syntax(); + object.setSyntax(existingSyntax); + List typeParams = new ArrayList<>(); - assertNull("Wrong inheritance", object.getInheritance()); - } + object.setTypeParameters(typeParams); - @Test - public void getIsExternal() { - assertNull("Wrong isExternal when null", (new MetadataFileItem("123")).getIsExternal()); - assertTrue("Wrong isExternal when true", (new MetadataFileItem("123", "name", true)).getIsExternal()); - assertNull("Wrong isExternal when false", (new MetadataFileItem("123", "name", false)).getIsExternal()); - } + assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); + assertEquals("Wrong typeParameters value", object.getSyntax().getTypeParameters(), typeParams); + } + + @Test + public void setParameters() { + MetadataFileItem object = new MetadataFileItem("123"); + List params = new ArrayList<>(); + + object.setParameters(params); + + assertNotNull("Syntax should not be null", object.getSyntax()); + assertEquals("Wrong parameters value", object.getSyntax().getParameters(), params); + } + + @Test + public void setParametersWhenSyntaxAlreadyPresent() { + MetadataFileItem object = new MetadataFileItem("123"); + Syntax existingSyntax = new Syntax(); + object.setSyntax(existingSyntax); + List params = new ArrayList<>(); + + object.setParameters(params); + + assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); + assertEquals("Wrong parameters value", object.getSyntax().getParameters(), params); + } + + @Test + public void setReturn() { + MetadataFileItem object = new MetadataFileItem("123"); + Return returnValue = new Return("type"); + + object.setReturn(returnValue); + + assertNotNull("Syntax should not be null", object.getSyntax()); + assertEquals("Wrong return value", object.getSyntax().getReturnValue(), returnValue); + } + + @Test + public void setReturnWhenSyntaxAlreadyPresent() { + MetadataFileItem object = new MetadataFileItem("123"); + Syntax existingSyntax = new Syntax(); + object.setSyntax(existingSyntax); + Return returnValue = new Return("type"); + + object.setReturn(returnValue); + + assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); + assertEquals("Wrong return value", object.getSyntax().getReturnValue(), returnValue); + } + + @Test + public void setContent() { + MetadataFileItem object = new MetadataFileItem("123"); + String content = "Some content"; + + object.setContent(content); + + assertNotNull("Syntax should not be null", object.getSyntax()); + assertEquals("Wrong content value", object.getSyntax().getContent(), content); + } + + @Test + public void setContentWhenSyntaxAlreadyPresent() { + MetadataFileItem object = new MetadataFileItem("123"); + Syntax existingSyntax = new Syntax(); + object.setSyntax(existingSyntax); + String content = "Some content"; + + object.setContent(content); + + assertEquals("Syntax object should remain the same", object.getSyntax(), existingSyntax); + assertEquals("Wrong content value", object.getSyntax().getContent(), content); + } + + @Test + public void setInheritance() { + MetadataFileItem object = new MetadataFileItem("123"); + + object.setInheritance(Arrays.asList("Some value")); + + assertEquals("Wrong inheritance size", object.getInheritance().size(), 1); + assertTrue("Wrong inheritance content", object.getInheritance().contains("Some value")); + } + + @Test + public void setInheritanceForNull() { + MetadataFileItem object = new MetadataFileItem("123"); + + object.setInheritance(null); + + assertNull("Wrong inheritance", object.getInheritance()); + } + + @Test + public void getIsExternal() { + assertNull("Wrong isExternal when null", (new MetadataFileItem("123")).getIsExternal()); + assertTrue( + "Wrong isExternal when true", (new MetadataFileItem("123", "name", true)).getIsExternal()); + assertNull( + "Wrong isExternal when false", + (new MetadataFileItem("123", "name", false)).getIsExternal()); + } + + @Test + public void setJavaType() { + MetadataFileItem metadataFileItem = new MetadataFileItem("123"); + assertNull("Wrong javaType when null", metadataFileItem.getJavaType()); + metadataFileItem.setJavaType("javaType"); + assertEquals("Wrong javaType when set", "javaType", metadataFileItem.getJavaType()); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java index cff62ebb..62a40698 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java @@ -16,15 +16,15 @@ package com.microsoft.model; -import org.junit.Test; - import static org.junit.Assert.assertEquals; +import org.junit.Test; + public class StatusTest { - @Test - public void statusName() { - String name = Status.DEPRECATED.toString(); - assertEquals("Status should be deprecated", name, "deprecated"); - } -} \ No newline at end of file + @Test + public void statusName() { + String name = Status.DEPRECATED.toString(); + assertEquals("Status should be deprecated", name, "deprecated"); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java index 63d50d25..c3b7d04c 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocContentsTest.java @@ -16,65 +16,113 @@ package com.microsoft.model; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.List; - -import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; public class TocContentsTest { - private TocItem tocItemA; - private TocItem tocItemB; - private TocItem tocItemC; - private List tocItems; - private String projectName = "google-cloud-project"; - - @Before - public void setup() { - tocItemA = new TocItem("A.uid.package.class", "nameA"); - tocItemB = new TocItem("B.uid.package.class", "nameB"); - tocItemC = new TocItem("C.uid.package.class", "nameC"); - - tocItems = new ArrayList<>(); - tocItems.add(tocItemA); - tocItems.add(tocItemB); - tocItems.add(tocItemC); - } - - @Test - public void getContentsWithProjectName() { - // should include ProjectContents and Guides - List tocContents = new TocContents(projectName, tocItems).getContents(); - - assertEquals("Should only include 1 item", tocContents.size(), 1); - assertEquals("Should include ProjectContents", tocContents.get(0).getClass(), ProjectContents.class); - - ProjectContents contents = (ProjectContents) tocContents.get(0); - assertEquals(contents.getName(), "google-cloud-project"); - - List items = contents.getItems(); - assertEquals("Should be 4 items", items.size(), 4); - - assertEquals("Guide should be first", items.get(0).getClass(), Guide.class); - Guide history = (Guide) items.get(0); - assertEquals("Second guide should be Version History", history.getName(), "Version history"); - - assertEquals("Item A should be second", items.get(1), tocItemA); - assertEquals("Item B should be third", items.get(2), tocItemB); - assertEquals("Item C should be fourth", items.get(3), tocItemC); - } - - @Test - public void getContentsNoProjectName() { - List tocContents = new TocContents("", tocItems).getContents(); - - // should not include ProjectContents or Guides - assertEquals("Should be 3 items", tocContents.size(), 3); - assertEquals("Item A should be first", tocContents.get(0), tocItemA); - assertEquals("Item B should be second", tocContents.get(1), tocItemB); - assertEquals("Item C should be third", tocContents.get(2), tocItemC); - } -} \ No newline at end of file + private TocItem tocItemA; + private TocItem tocItemB; + private TocItem tocItemC; + private List tocItems; + private String projectName = "google-cloud-project"; + private boolean disableChangelog = false; + + private boolean disableLibraryOverview = false; + + @Before + public void setup() { + tocItemA = new TocItem("A.uid.package.class", "nameA"); + tocItemB = new TocItem("B.uid.package.class", "nameB"); + tocItemC = new TocItem("C.uid.package.class", "nameC"); + + tocItems = new ArrayList<>(); + tocItems.add(tocItemA); + tocItems.add(tocItemB); + tocItems.add(tocItemC); + } + + @Test + public void getContentsWithProjectName() { + // should include ProjectContents and Guides + List tocContents = + new TocContents(projectName, disableChangelog, disableLibraryOverview, tocItems) + .getContents(); + + assertEquals("Should only include 1 item", tocContents.size(), 1); + assertEquals( + "Should include ProjectContents", tocContents.get(0).getClass(), ProjectContents.class); + + ProjectContents contents = (ProjectContents) tocContents.get(0); + assertEquals(contents.getName(), "google-cloud-project"); + + List items = contents.getItems(); + assertEquals("Should be 5 items", 5, items.size()); + + assertEquals("Guide should be first", items.get(0).getClass(), Guide.class); + Guide overview = (Guide) items.get(0); + assertEquals("First guide should be Overview", overview.getName(), "Overview"); + + assertEquals("Guide should be second", items.get(1).getClass(), Guide.class); + Guide history = (Guide) items.get(1); + assertEquals("Second guide should be Version History", history.getName(), "Version history"); + + assertEquals("Item A should be third", items.get(2), tocItemA); + assertEquals("Item B should be fourth", items.get(3), tocItemB); + assertEquals("Item C should be fifth", items.get(4), tocItemC); + } + + @Test + public void getContentsNoProjectName() { + List tocContents = + new TocContents("", disableChangelog, disableLibraryOverview, tocItems).getContents(); + + // should not include ProjectContents or Guides + assertEquals("Should be 3 items", tocContents.size(), 3); + assertEquals("Item A should be first", tocContents.get(0), tocItemA); + assertEquals("Item B should be second", tocContents.get(1), tocItemB); + assertEquals("Item C should be third", tocContents.get(2), tocItemC); + } + + @Test + public void getContentsWithDisabledChangelog() { + disableChangelog = true; + List tocContents = + new TocContents(projectName, disableChangelog, disableLibraryOverview, tocItems) + .getContents(); + + ProjectContents contents = (ProjectContents) tocContents.get(0); + List items = contents.getItems(); + assertEquals("Should be 4 items", 4, items.size()); + + Guide overview = (Guide) items.get(0); + assertEquals("First guide should be Overview", overview.getName(), "Overview"); + assertEquals("Item A should be second", items.get(1), tocItemA); + assertEquals("Item B should be third", items.get(2), tocItemB); + assertEquals("Item C should be fourth", items.get(3), tocItemC); + } + + @Test + public void getContentsWithDisabledLibraryOverview() { + disableLibraryOverview = true; + List tocContents = + new TocContents(projectName, disableChangelog, disableLibraryOverview, tocItems) + .getContents(); + + ProjectContents contents = (ProjectContents) tocContents.get(0); + List items = contents.getItems(); + assertEquals("Should be 5 items", items.size(), 5); + + Guide overview = (Guide) items.get(0); + assertEquals("First guide should be Overview", overview.getName(), "Overview"); + Guide history = (Guide) items.get(1); + assertEquals("Second guide should be Version History", history.getName(), "Version history"); + assertEquals("Item A should be third", items.get(2), tocItemA); + assertEquals("Item B should be fourth", items.get(3), tocItemB); + assertEquals("Item C should be fifth", items.get(4), tocItemC); + } +} 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 1299b842..6debe229 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,31 +16,56 @@ package com.microsoft.model; -import org.junit.Test; +import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertEquals; +import org.junit.Test; public class TocFileTest { - @Test - public void sortsByUid() { - TocFile tocFile = new TocFile("outputPath", "google-cloud-project"); - 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"); + @Test + public void sortsByUid() { + TocFile tocFile = new TocFile("outputPath", "google-cloud-project", false, false); + 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 olderItem = new TocItem("Older and prerelease packages", "name"); + + tocFile.addTocItem(tocItemC); + tocFile.addTocItem(tocItemA); + tocFile.addTocItem(olderItem); + tocFile.addTocItem(tocItemB); + + assertThat(tocFile).containsExactly(tocItemC, tocItemA, olderItem, tocItemB).inOrder(); + + tocFile.sortByUid(); + + assertThat(tocFile).containsExactly(tocItemA, tocItemB, tocItemC, olderItem).inOrder(); + } + + @Test + public void addsPackageOverviews() { + TocFile tocFile = new TocFile("outputPath", "google-cloud-project", false, false); + 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 olderItem = new TocItem("Older and prerelease packages", "name"); + TocItem packageOverview = + new TocItem("1.uid.package.class", "Package summary", "a.uid.package.class.md", true); - tocFile.addTocItem(tocItemC); - tocFile.addTocItem(tocItemA); - tocFile.addTocItem(tocItemB); + tocFile.addTocItem(tocItemC); + tocFile.addTocItem(tocItemA); + tocFile.addTocItem(olderItem); + tocFile.addTocItem(tocItemB); + tocFile.addTocItem(packageOverview); - 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, packageOverview) + .inOrder(); - tocFile.sortByUid(); + 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); - } -} \ No newline at end of file + assertThat(tocFile) + .containsExactly(packageOverview, tocItemA, tocItemB, tocItemC, olderItem) + .inOrder(); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocTypeMapTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocTypeMapTest.java index 77593e8c..ae06c264 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocTypeMapTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/TocTypeMapTest.java @@ -15,26 +15,29 @@ */ package com.microsoft.model; +import static org.junit.Assert.*; + +import java.util.List; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; -import java.util.List; - -import static org.junit.Assert.*; - @RunWith(MockitoJUnitRunner.class) public class TocTypeMapTest { - @Test - public void elementKindsExistInMap() { - TocTypeMap tocTypeMap = new TocTypeMap(); - List titleList = tocTypeMap.getTitleList(); + @Test + public void elementKindsExistInMap() { + TocTypeMap tocTypeMap = new TocTypeMap(); + List titleList = tocTypeMap.getTitleList(); - assertEquals("Should include 5 items in list", 5, titleList.size()); + assertEquals("Should include 5 items in list", 5, titleList.size()); - titleList.stream().forEach(kindtitle -> assertNotNull("Element kind should exist in map", - tocTypeMap.get(kindtitle.getElementKind()))); + titleList.stream() + .forEach( + kindtitle -> + assertNotNull( + "Element kind should exist in map", + tocTypeMap.get(kindtitle.getElementKind()))); - assertNull("Should not include provided key", tocTypeMap.get("FAKE_VALUE")); - } + assertNull("Should not include provided key", tocTypeMap.get("FAKE_VALUE")); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/.repo-metadata.json b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/.repo-metadata.json new file mode 100644 index 00000000..3d812a7e --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_shortname": "apikeys", + "name_pretty": "API Keys API", + "product_documentation": "https://cloud.google.com/api-keys/", + "api_description": "API Keys lets you create and manage your API keys for your projects.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/overview", + "rest_documentation": "https://cloud.google.com/api-keys/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/api-keys/docs/reference/rpc", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-apikeys", + "distribution_name": "com.google.cloud:google-cloud-apikeys", + "api_id": "apikeys.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponent.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponent.java index 93d352f9..9dd4580d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponent.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponent.java @@ -7,48 +7,40 @@ package com.microsoft.samples; /** - * Holds common partner component properties and behavior. All components should inherit from this class. The context - * object type. + * Holds common partner component properties and behavior. All components should inherit from this + * class. The context object type. */ public abstract class BasePartnerComponent { - /** - * Initializes a new instance of the BasePartnerComponent class. - * - * @param rootPartnerOperations The root partner operations that created this component. - * @param componentContext A component context object to work with. - */ - protected BasePartnerComponent(IPartner rootPartnerOperations, TContext componentContext) { - if (rootPartnerOperations == null) { - throw new NullPointerException("rootPartnerOperations null"); - } - - this.setPartner(rootPartnerOperations); - this.setContext(componentContext); + /** + * Initializes a new instance of the BasePartnerComponent class. + * + * @param rootPartnerOperations The root partner operations that created this component. + * @param componentContext A component context object to work with. + */ + protected BasePartnerComponent(IPartner rootPartnerOperations, TContext componentContext) { + if (rootPartnerOperations == null) { + throw new NullPointerException("rootPartnerOperations null"); } - /** - * Gets a reference to the partner operations instance that generated this component. - */ - private IPartner partner; + this.setPartner(rootPartnerOperations); + this.setContext(componentContext); + } + /** Gets a reference to the partner operations instance that generated this component. */ + private IPartner partner; - private void setPartner(IPartner value) { - partner = value; - } + private void setPartner(IPartner value) { + partner = value; + } - /** - * Gets the component context object. - */ - private TContext context; + /** Gets the component context object. */ + private TContext context; + private void setContext(TContext value) { + context = value; + } - private void setContext(TContext value) { - context = value; - } + protected void testBase() {} - protected void testBase() { - } - - protected void testInherited() { - } -} \ No newline at end of file + protected void testInherited() {} +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponentString.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponentString.java index 6324e1e1..546d0d82 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponentString.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/BasePartnerComponentString.java @@ -9,28 +9,26 @@ /** * Holds common partner component properties and behavior. The context is string type by default. */ -public abstract class BasePartnerComponentString - extends BasePartnerComponent { - /** - * Initializes a new instance of the BasePartnerComponent class. - * - * @param rootPartnerOperations The root partner operations that created this component. - */ - protected BasePartnerComponentString(IPartner rootPartnerOperations) { - super(rootPartnerOperations, null); - } +public abstract class BasePartnerComponentString extends BasePartnerComponent { + /** + * Initializes a new instance of the BasePartnerComponent class. + * + * @param rootPartnerOperations The root partner operations that created this component. + */ + protected BasePartnerComponentString(IPartner rootPartnerOperations) { + super(rootPartnerOperations, null); + } - /** - * Initializes a new instance of the BasePartnerComponent class. - * - * @param rootPartnerOperations The root partner operations that created this component. - * @param componentContext A component context object to work with. - */ - protected BasePartnerComponentString(IPartner rootPartnerOperations, String componentContext) { - super(rootPartnerOperations, componentContext); - } + /** + * Initializes a new instance of the BasePartnerComponent class. + * + * @param rootPartnerOperations The root partner operations that created this component. + * @param componentContext A component context object to work with. + */ + protected BasePartnerComponentString(IPartner rootPartnerOperations, String componentContext) { + super(rootPartnerOperations, componentContext); + } - @Override - protected void testInherited() { - } -} \ No newline at end of file + @Override + protected void testInherited() {} +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java new file mode 100644 index 00000000..982f797e --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/ExceptionHandler.java @@ -0,0 +1,296 @@ +/* + * Copyright 2015 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.microsoft.samples; + +import static com.google.common.base.Preconditions.checkNotNull; + +import com.google.api.core.BetaApi; +import com.google.api.gax.retrying.ResultRetryAlgorithm; +import com.google.api.gax.retrying.TimedAttemptSettings; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.Callable; + +/** Exception retry algorithm implementation used by {@link RetryHelper}. */ +@BetaApi +public final class ExceptionHandler implements ResultRetryAlgorithm, Serializable { + + private static final long serialVersionUID = -2460707015779532919L; + + private static final ExceptionHandler DEFAULT_INSTANCE = + newBuilder().retryOn(Exception.class).abortOn(RuntimeException.class).build(); + + private final ImmutableList interceptors; + private final ImmutableSet> retriableExceptions; + private final ImmutableSet> nonRetriableExceptions; + private final Set retryInfo = Sets.newHashSet(); + + public interface Interceptor extends Serializable { + + enum RetryResult { + NO_RETRY, + RETRY, + CONTINUE_EVALUATION; + } + + /** + * This method is called before exception evaluation and could short-circuit the process. + * + * @param exception the exception that is being evaluated + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult beforeEval(Exception exception); + + /** + * This method is called after the evaluation and could alter its result. + * + * @param exception the exception that is being evaluated + * @param retryResult the result of the evaluation so far + * @return {@link RetryResult} to indicate if the exception should be ignored ( {@link + * RetryResult#RETRY}), propagated ({@link RetryResult#NO_RETRY}), or evaluation should + * proceed ({@link RetryResult#CONTINUE_EVALUATION}). + */ + RetryResult afterEval(Exception exception, RetryResult retryResult); + } + + /** ExceptionHandler builder. */ + public static class Builder { + + private final ImmutableList.Builder interceptors = ImmutableList.builder(); + private final ImmutableSet.Builder> retriableExceptions = + ImmutableSet.builder(); + private final ImmutableSet.Builder> nonRetriableExceptions = + ImmutableSet.builder(); + + private Builder() {} + + /** + * Adds the exception handler interceptors. Call order will be maintained. + * + * @param interceptors the interceptors for this exception handler + * @return the Builder for chaining + */ + public Builder addInterceptors(Interceptor... interceptors) { + for (Interceptor interceptor : interceptors) { + this.interceptors.add(interceptor); + } + return this; + } + + /** + * Add the exceptions to ignore/retry-on. + * + * @param exceptions retry should continue when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder retryOn(Class... exceptions) { + for (Class exception : exceptions) { + retriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** + * Adds the exceptions to abort on. + * + * @param exceptions retry should abort when such exceptions are thrown + * @return the Builder for chaining + */ + @SafeVarargs + public final Builder abortOn(Class... exceptions) { + for (Class exception : exceptions) { + nonRetriableExceptions.add(checkNotNull(exception)); + } + return this; + } + + /** Returns a new ExceptionHandler instance. */ + public ExceptionHandler build() { + return new ExceptionHandler(this); + } + } + + @VisibleForTesting + static final class RetryInfo implements Serializable { + + private static final long serialVersionUID = -4264634837841455974L; + private final Class exception; + private final Interceptor.RetryResult retry; + private final Set children = Sets.newHashSet(); + + RetryInfo(Class exception, Interceptor.RetryResult retry) { + this.exception = checkNotNull(exception); + this.retry = checkNotNull(retry); + } + + @Override + public int hashCode() { + return exception.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof RetryInfo)) { + return false; + } + // We only care about exception in equality as we allow only one instance per exception + return ((RetryInfo) obj).exception.equals(exception); + } + } + + private ExceptionHandler(Builder builder) { + interceptors = builder.interceptors.build(); + retriableExceptions = builder.retriableExceptions.build(); + nonRetriableExceptions = builder.nonRetriableExceptions.build(); + Preconditions.checkArgument( + Sets.intersection(retriableExceptions, nonRetriableExceptions).isEmpty(), + "Same exception was found in both retryable and non-retryable sets"); + for (Class exception : retriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.RETRY), retryInfo); + } + for (Class exception : nonRetriableExceptions) { + addRetryInfo(new RetryInfo(exception, Interceptor.RetryResult.NO_RETRY), retryInfo); + } + } + + private static void addRetryInfo(RetryInfo retryInfo, Set dest) { + for (RetryInfo current : dest) { + if (current.exception.isAssignableFrom(retryInfo.exception)) { + addRetryInfo(retryInfo, current.children); + return; + } + if (retryInfo.exception.isAssignableFrom(current.exception)) { + retryInfo.children.add(current); + } + } + dest.removeAll(retryInfo.children); + dest.add(retryInfo); + } + + private static RetryInfo findMostSpecificRetryInfo( + Set retryInfo, Class exception) { + for (RetryInfo current : retryInfo) { + if (current.exception.isAssignableFrom(exception)) { + RetryInfo match = findMostSpecificRetryInfo(current.children, exception); + return match == null ? current : match; + } + } + return null; + } + + // called for Class, therefore a "call" method must be found. + private static Method getCallableMethod(Class clazz) { + try { + return clazz.getDeclaredMethod("call"); + } catch (NoSuchMethodException e) { + // check parent + return getCallableMethod(clazz.getSuperclass()); + } catch (SecurityException e) { + // This should never happen + throw new IllegalStateException("Unexpected exception", e); + } + } + + void verifyCaller(Callable callable) { + Method callMethod = getCallableMethod(callable.getClass()); + for (Class exceptionOrError : callMethod.getExceptionTypes()) { + Preconditions.checkArgument( + Exception.class.isAssignableFrom(exceptionOrError), + "Callable method exceptions must be derived from Exception"); + @SuppressWarnings("unchecked") + Class exception = (Class) exceptionOrError; + Preconditions.checkArgument( + findMostSpecificRetryInfo(retryInfo, exception) != null, + "Declared exception '" + exception + "' is not covered by exception handler"); + } + } + + @Override + public boolean shouldRetry(Throwable prevThrowable, Object prevResponse) { + if (!(prevThrowable instanceof Exception)) { + return false; + } + Exception ex = (Exception) prevThrowable; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult retryResult = checkNotNull(interceptor.beforeEval(ex)); + if (retryResult != Interceptor.RetryResult.CONTINUE_EVALUATION) { + return retryResult == Interceptor.RetryResult.RETRY; + } + } + RetryInfo retryInfo = findMostSpecificRetryInfo(this.retryInfo, ex.getClass()); + Interceptor.RetryResult retryResult = + retryInfo == null ? Interceptor.RetryResult.NO_RETRY : retryInfo.retry; + for (Interceptor interceptor : interceptors) { + Interceptor.RetryResult interceptorRetry = + checkNotNull(interceptor.afterEval(ex, retryResult)); + if (interceptorRetry != Interceptor.RetryResult.CONTINUE_EVALUATION) { + retryResult = interceptorRetry; + } + } + return retryResult == Interceptor.RetryResult.RETRY; + } + + @Override + public TimedAttemptSettings createNextAttempt( + Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings) { + // Return null to indicate that this implementation does not provide any specific attempt + // settings, so by default the TimedRetryAlgorithm options can be used instead. + return null; + } + + @Override + public int hashCode() { + return Objects.hash(interceptors, retriableExceptions, nonRetriableExceptions, retryInfo); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof ExceptionHandler)) { + return false; + } + ExceptionHandler other = (ExceptionHandler) obj; + return Objects.equals(interceptors, other.interceptors) + && Objects.equals(retriableExceptions, other.retriableExceptions) + && Objects.equals(nonRetriableExceptions, other.nonRetriableExceptions) + && Objects.equals(retryInfo, other.retryInfo); + } + + /** Returns an instance which retry any checked exception and abort on any runtime exception. */ + public static ExceptionHandler getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + public static Builder newBuilder() { + return new Builder(); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/IPartner.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/IPartner.java index 73aa4db0..cf13e154 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/IPartner.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/IPartner.java @@ -6,24 +6,22 @@ package com.microsoft.samples; - /** - * The main entry point into using the partner SDK functionality. Represents a partner and encapsulates all the behavior - * attached to partners. Use this interface to get to the partner's customers, profiles, and customer orders, profiles - * and subscriptions and more. + * The main entry point into using the partner SDK functionality. Represents a partner and + * encapsulates all the behavior attached to partners. Use this interface to get to the partner's + * customers, profiles, and customer orders, profiles and subscriptions and more. */ public interface IPartner { - /** - * Gets the partner credentials. - * - * @return The partner credentials. - */ - String getCredentials(); - - /** - * Gets the request context. - * - * @return The request context. - */ + /** + * Gets the partner credentials. + * + * @return The partner credentials. + */ + String getCredentials(); -} \ No newline at end of file + /** + * Gets the request context. + * + * @return The request context. + */ +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/KeyValuePair.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/KeyValuePair.java index bb052bf2..672df61d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/KeyValuePair.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/KeyValuePair.java @@ -2,22 +2,21 @@ public class KeyValuePair { - private K key; - private V value; + private K key; + private V value; - public KeyValuePair() { - } + public KeyValuePair() {} - public KeyValuePair(K key, V value) { - this.key = key; - this.value = value; - } + public KeyValuePair(K key, V value) { + this.key = key; + this.value = value; + } - public K getKey() { - return key; - } + public K getKey() { + return key; + } - public V getValue() { - return value; - } + public V getValue() { + return value; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Link.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Link.java index d96c8ef9..be15ef95 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Link.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Link.java @@ -4,41 +4,37 @@ public class Link { - public Link() { - } - - /** - * Initializes a new instance of the Link class. - * - * @param uri The URI. - */ - - /** - * Gets the URI. - *

- * /** - * Gets the method. - */ - private String method; - - public String getMethod() { - return method; - } - - public void setMethod(String value) { - method = value; - } - - /** - * Gets the link headers. - */ - private Collection> headers; - - public Collection> getHeaders() { - return headers; - } - - public void setHeaders(Collection> value) { - headers = value; - } + public Link() {} + + /** + * Initializes a new instance of the Link class. + * + * @param uri The URI. + */ + + /** + * Gets the URI. + * + *

/** Gets the method. + */ + private String method; + + public String getMethod() { + return method; + } + + public void setMethod(String value) { + method = value; + } + + /** Gets the link headers. */ + private Collection> headers; + + public Collection> getHeaders() { + return headers; + } + + public void setHeaders(Collection> value) { + headers = value; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Subpackage.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Subpackage.java index 8e2b679b..b16d190c 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Subpackage.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/Subpackage.java @@ -1,5 +1,3 @@ package com.microsoft.samples; -public class Subpackage { - -} +public class Subpackage {} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/SuperHero.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/SuperHero.java index 54276e67..04055a3a 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/SuperHero.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/SuperHero.java @@ -1,9 +1,8 @@ package com.microsoft.samples; import com.microsoft.samples.subpackage.Person; -import org.apache.commons.lang3.StringUtils; - import java.io.Serializable; +import org.apache.commons.lang3.StringUtils; /** * Hero is the main entity we will be using to something @@ -12,99 +11,98 @@ */ public class SuperHero extends Person implements Serializable, Cloneable { - /** - * The public name of a hero that is common knowledge - */ - private String heroName; - private String uniquePower; - private int health; - private int defense; - String hobby; - - public final String SOME_PUBLIC_STRING = "So important string value"; - - public SuperHero() { - } - - public SuperHero(String heroName, String uniquePower, int health, int defense) { - this.heroName = heroName; - this.uniquePower = uniquePower; - this.health = health; - this.defense = defense; - } - - /** - *

This is a simple description of the method. . . - * Superman! - *

- * - * @param incomingDamage the amount of incoming damage for {@link SuperHero} - * @param damageType type of damage with similar word damageTypeLong, sure - * @return the amount of health hero has after attack - * @throws IllegalArgumentException when incomingDamage is negative and thanks for {@link Exception} - * @version 1.2 - * @see HERO-402 - * @since 1.0 - * @deprecated As of version 1.1, use . . . instead - */ - @Deprecated - public int successfullyAttacked(int incomingDamage, String damageType) throws IllegalArgumentException { - // do things - if (incomingDamage < 0) { - throw new IllegalArgumentException("Cannot cause negative damage"); - } - return 0; - } - - public String getHeroName() { - return heroName; - } - - public void setHeroName(String heroName) { - this.heroName = heroName; - } - - /** - * Get capitalized last name. But it's not the end, - * because of multiline comment - * - * @return lastName in uppercase. But it's not the end, - * because of multiline comment - */ - @Override - public String getLastName() { - return StringUtils.upperCase(super.getLastName()); - } - - public String getUniquePower() { - return uniquePower; - } - - public void setUniquePower(String uniquePower) { - this.uniquePower = uniquePower; - } - - protected int getHealth() { - return health; - } - - protected void setHealth(int health) { - this.health = health; - } - - public int getDefense() { - return defense; - } - - public void setDefense(int defense) { - this.defense = defense; - } - - private void setHobby(String hobby) { - this.hobby = hobby; - } - - String getHobby() { - return hobby; + /** The public name of a hero that is common knowledge */ + private String heroName; + + private String uniquePower; + private int health; + private int defense; + String hobby; + + public final String SOME_PUBLIC_STRING = "So important string value"; + + public SuperHero() {} + + public SuperHero(String heroName, String uniquePower, int health, int defense) { + this.heroName = heroName; + this.uniquePower = uniquePower; + this.health = health; + this.defense = defense; + } + + /** + * This is a simple description of the method. . . Superman! + * + * @param incomingDamage the amount of incoming damage for {@link SuperHero} + * @param damageType type of damage with similar word damageTypeLong, sure + * @return the amount of health hero has after attack + * @throws IllegalArgumentException when incomingDamage is negative and thanks for {@link + * Exception} + * @version 1.2 + * @see HERO-402 + * @since 1.0 + * @deprecated As of version 1.1, use . . . instead + */ + @Deprecated + public int successfullyAttacked(int incomingDamage, String damageType) + throws IllegalArgumentException { + // do things + if (incomingDamage < 0) { + throw new IllegalArgumentException("Cannot cause negative damage"); } + return 0; + } + + public String getHeroName() { + return heroName; + } + + public void setHeroName(String heroName) { + this.heroName = heroName; + } + + /** + * Get capitalized last name. But it's not the end, because we add a lot of text to make this a + * multiline comment + * + * @return lastName in uppercase. But it's not the end, because we add a lot of text to make this + * a multiline comment + */ + @Override + public String getLastName() { + return StringUtils.upperCase(super.getLastName()); + } + + public String getUniquePower() { + return uniquePower; + } + + public void setUniquePower(String uniquePower) { + this.uniquePower = uniquePower; + } + + protected int getHealth() { + return health; + } + + protected void setHealth(int health) { + this.health = health; + } + + public int getDefense() { + return defense; + } + + public void setDefense(int defense) { + this.defense = defense; + } + + private void setHobby(String hobby) { + this.hobby = hobby; + } + + String getHobby() { + return hobby; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementDetailsCollectionOperations.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementDetailsCollectionOperations.java index 55a9b2b1..4f59819f 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementDetailsCollectionOperations.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementDetailsCollectionOperations.java @@ -3,30 +3,31 @@ import com.microsoft.samples.BasePartnerComponentString; import com.microsoft.samples.IPartner; - /** * Agreement details collection operations implementation class. + * * @deprecated Use {@link AgreementMetaData} instead. */ -public class AgreementDetailsCollectionOperations - extends BasePartnerComponentString - implements IAgreementDetailsCollection { - /** - * Initializes a new instance of the AgreementDetailsCollectionOperations class. - * - * @param rootPartnerOperations The root partner operations instance. - */ - public AgreementDetailsCollectionOperations(IPartner rootPartnerOperations) { - super(rootPartnerOperations); - } +@Deprecated +public class AgreementDetailsCollectionOperations extends BasePartnerComponentString + implements IAgreementDetailsCollection { + /** + * Initializes a new instance of the AgreementDetailsCollectionOperations class. + * + * @param rootPartnerOperations The root partner operations instance. + */ + public AgreementDetailsCollectionOperations(IPartner rootPartnerOperations) { + super(rootPartnerOperations); + } - /** - * Retrieves the agreement details. - * - * @return A list of agreement details. - * @deprecated Some text - */ - public ResourceCollection get() { - return null; - } -} \ No newline at end of file + /** + * Retrieves the agreement details. + * + * @return A list of agreement details. + * @deprecated Some text + */ + @Deprecated + public ResourceCollection get() { + return null; + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementMetaData.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementMetaData.java index 277c5b7d..dbed026e 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementMetaData.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/AgreementMetaData.java @@ -3,55 +3,50 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The AgreementMetaData provides metadata about the agreement type - * that partner can provide confirmation of customer acceptance. + * The AgreementMetaData provides metadata about the agreement type that partner can provide + * confirmation of customer acceptance. */ public class AgreementMetaData { - /** - * Gets or sets the unique identifier of an agreement template. - */ - @JsonProperty("templateId") - private String templateId; - - public String getTemplateId() { - return templateId; - } - - public void setTemplateId(String value) { - templateId = value; - } - - /** - * Gets or sets agreement type. - */ - - - /** - * Gets or sets URL to the agreement template. - * @deprecated - */ - @JsonProperty("agreementLink") - private String agreementLink; - - public String getAgreementLink() { - return agreementLink; - } - - public void setAgreementLink(String value) { - agreementLink = value; - } - - /** - * Gets or sets the version rank of an agreement template. - */ - @JsonProperty("versionRank") - private int versionRank; - - public int getVersionRank() { - return versionRank; - } - - public void setVersionRank(int value) { - versionRank = value; - } -} \ No newline at end of file + /** Gets or sets the unique identifier of an agreement template. */ + @JsonProperty("templateId") + private String templateId; + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String value) { + templateId = value; + } + + /** Gets or sets agreement type. */ + + /** + * Gets or sets URL to the agreement template. + * + * @deprecated + */ + @Deprecated + @JsonProperty("agreementLink") + private String agreementLink; + + public String getAgreementLink() { + return agreementLink; + } + + public void setAgreementLink(String value) { + agreementLink = value; + } + + /** Gets or sets the version rank of an agreement template. */ + @JsonProperty("versionRank") + private int versionRank; + + public int getVersionRank() { + return versionRank; + } + + public void setVersionRank(int value) { + versionRank = value; + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/IAgreementDetailsCollection.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/IAgreementDetailsCollection.java index 5d8a5944..b7d1c54a 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/IAgreementDetailsCollection.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/IAgreementDetailsCollection.java @@ -1,15 +1,16 @@ package com.microsoft.samples.agreements; - /** * Encapsulates the operations on the agreement metadata collection. + * * @deprecated This one is deprecated :( */ +@Deprecated public interface IAgreementDetailsCollection { - /** - * Retrieves all current agreement metadata. - * - * @return The current agreement metadata. - */ - ResourceCollection get(); -} \ No newline at end of file + /** + * Retrieves all current agreement metadata. + * + * @return The current agreement metadata. + */ + ResourceCollection get(); +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/ResourceCollection.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/ResourceCollection.java index 9b829aed..7b8d8ca2 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/ResourceCollection.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/agreements/ResourceCollection.java @@ -1,8 +1,7 @@ package com.microsoft.samples.agreements; /** - * Contains a collection of resources with JSON properties to represent the output Type of objects in collection + * Contains a collection of resources with JSON properties to represent the output Type of objects + * in collection */ -public class ResourceCollection { - -} \ No newline at end of file +public class ResourceCollection {} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Animal.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Animal.java index 6ac38bc8..2d1d7a94 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Animal.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Animal.java @@ -1,28 +1,16 @@ package com.microsoft.samples.commentinheritance; -/** - * Animal. - */ +/** Animal. */ public abstract class Animal implements Organism { - /** - * Breathe. - */ - public void breathe() { - } + /** Breathe. */ + public void breathe() {} - /** - * Communicate verbally. - */ - public abstract void verballyCommunicate(); + /** Communicate verbally. */ + public abstract void verballyCommunicate(); - /** - * Feed offspring. - */ - public abstract void feed(); + /** Feed offspring. */ + public abstract void feed(); - /** - * {@inheritDoc} - * Get kind from Animal. - */ - public abstract String getKind(); + /** {@inheritDoc} Get kind from Animal. */ + public abstract String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java index 96811e00..3bc8be6d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Carnivorous.java @@ -1,18 +1,14 @@ package com.microsoft.samples.commentinheritance; -/** - * Marks an Animal that eats other animals. - */ +/** Marks an Animal that eats other animals. */ public interface Carnivorous { - /** - * Eat the provided animal. - * - * @param animalBeingEaten Animal that will be eaten. - */ - void eat(Animal animalBeingEaten); + /** + * Eat the provided animal. + * + * @param animalBeingEaten Animal that will be eaten. + */ + void eat(Animal animalBeingEaten); - /** - * Get kind from Carnivorous. - */ - String getKind(); + /** Get kind from Carnivorous. */ + String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Dog.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Dog.java index 09e7d2d5..a950f1cd 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Dog.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Dog.java @@ -1,71 +1,58 @@ package com.microsoft.samples.commentinheritance; -import java.awt.*; - import static java.lang.System.out; -/** - * Canine and man's best friend. - */ -public class Dog extends Mammal implements Omnivorous, Viviparous { - private final Color hairColor = null; - - /** - * {@inheritDoc} - * - * @param otherAnimal Tasty treat. - */ - @Override - public void eat(final Animal otherAnimal) { - } - - /** - * {@inheritDoc} - * - * @param plantToBeEaten Plant that this dog will eat. - */ - @Override - public void eat(final Plant plantToBeEaten) { - } - - /** - * {@inheritDoc} Bark. - */ - public void verballyCommunicate() { - out.println("Woof!"); - } - - /** - * {@inheritDoc} - * - * @param numberPuppies Number of puppies being born. - */ - @Override - public void giveBirth(final int numberPuppies) { - } - - /** - * Provide the color of the dog's hair. - * - * @return Color of the dog's fur. - */ - public Color getHairColor() { - return hairColor; - } - - /** - * {@inheritDoc} - */ - @Override - public void feed() { - } +import java.awt.*; - /** - * {@inheritDoc} - * Get kind from Dog. - */ - @Override - public String getKind() { - return "Dog"; - } +/** Canine and man's best friend. */ +public class Dog extends Mammal implements Omnivorous, Viviparous { + private final Color hairColor = null; + + /** + * {@inheritDoc} + * + * @param otherAnimal Tasty treat. + */ + @Override + public void eat(final Animal otherAnimal) {} + + /** + * {@inheritDoc} + * + * @param plantToBeEaten Plant that this dog will eat. + */ + @Override + public void eat(final Plant plantToBeEaten) {} + + /** {@inheritDoc} Bark. */ + public void verballyCommunicate() { + out.println("Woof!"); + } + + /** + * {@inheritDoc} + * + * @param numberPuppies Number of puppies being born. + */ + @Override + public void giveBirth(final int numberPuppies) {} + + /** + * Provide the color of the dog's hair. + * + * @return Color of the dog's fur. + */ + public Color getHairColor() { + return hairColor; + } + + /** {@inheritDoc} */ + @Override + public void feed() {} + + /** {@inheritDoc} Get kind from Dog. */ + @Override + public String getKind() { + return "Dog"; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java index 32abea1f..5102185d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Herbivorous.java @@ -1,22 +1,16 @@ package com.microsoft.samples.commentinheritance; -/** - * Marks animals that eat plants. - */ +/** Marks animals that eat plants. */ public interface Herbivorous { - /** - * Eat the provided plant. - * - * @param plantToBeEaten Plant that will be eaten. - */ - void eat(Plant plantToBeEaten); + /** + * Eat the provided plant. + * + * @param plantToBeEaten Plant that will be eaten. + */ + void eat(Plant plantToBeEaten); - /** - * Get kind from Herbivorous. - */ - String getKind(); - - public class Plant { - } + /** Get kind from Herbivorous. */ + String getKind(); + public class Plant {} } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java index a72edc13..2b5b2306 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Mammal.java @@ -1,13 +1,8 @@ package com.microsoft.samples.commentinheritance; -/** - * Mammal. - */ +/** Mammal. */ public abstract class Mammal extends Animal { - /** - * {@inheritDoc} - * Get kind from Mammal. - */ - public abstract String getKind(); + /** {@inheritDoc} Get kind from Mammal. */ + public abstract String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java index b5686eb5..a7a3244c 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Omnivorous.java @@ -1,19 +1,14 @@ package com.microsoft.samples.commentinheritance; -/** - * Eats plants and animals. - */ +/** Eats plants and animals. */ public interface Omnivorous extends Carnivorous, Herbivorous { - @Override - void eat(Animal animalToBeEaten); + @Override + void eat(Animal animalToBeEaten); - @Override - void eat(Plant plantToBeEaten); + @Override + void eat(Plant plantToBeEaten); - /** - * {@inheritDoc} - * Get kind from Omnivorous. - */ - @Override - String getKind(); + /** {@inheritDoc} Get kind from Omnivorous. */ + @Override + String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Organism.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Organism.java index 8edf9a62..751dad3d 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Organism.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Organism.java @@ -2,8 +2,6 @@ public interface Organism { - /** - * Get kind from Organism. - */ - String getKind(); + /** Get kind from Organism. */ + String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java index 685eba41..1fd59bf0 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/commentinheritance/Viviparous.java @@ -1,14 +1,10 @@ package com.microsoft.samples.commentinheritance; -/** - * Mammals that give birth to young that develop within the mother's body. - */ +/** Mammals that give birth to young that develop within the mother's body. */ public interface Viviparous { - void giveBirth(int numberOfOffspring); + void giveBirth(int numberOfOffspring); - /** - * Get kind from Viviparous. - */ - String getKind(); + /** Get kind from Viviparous. */ + String getKind(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/BetaApi.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/BetaApi.java index ca32def1..4cb3b930 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/BetaApi.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/BetaApi.java @@ -40,15 +40,15 @@ * Indicates a public API that can change at any time, and has no guarantee of API stability and * backward-compatibility. * - *

- * Usage guidelines: + *

Usage guidelines: + * *

    - *
  1. This annotation is used only on APIs with public visibility. Internal interfaces should not - * use it.
  2. - *
  3. This annotation should only be added to new APIs. Adding it to an existing API is considered - * API-breaking.
  4. - *
  5. Removing this annotation from an API gives it stable status, assuming the API doesn't have - * other annotations denoting instability. + *
  6. This annotation is used only on APIs with public visibility. Internal interfaces should not + * use it. + *
  7. This annotation should only be added to new APIs. Adding it to an existing API is + * considered API-breaking. + *
  8. Removing this annotation from an API gives it stable status, assuming the API doesn't have + * other annotations denoting instability. *
*/ @BetaApi @@ -63,8 +63,6 @@ }) @Documented public @interface BetaApi { - /** - * Context information such as links to a discussion thread, tracking issue, etc. - */ + /** Context information such as links to a discussion thread, tracking issue, etc. */ String value() default ""; } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ProductSearchSettings.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ProductSearchSettings.java index fdb97d6e..56b50d60 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ProductSearchSettings.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ProductSearchSettings.java @@ -16,6 +16,8 @@ package com.microsoft.samples.google; +import static com.google.cloud.vision.v1.ProductSearchClient.*; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -26,12 +28,9 @@ import com.google.cloud.vision.v1.stub.ProductSearchStubSettings; import com.google.longrunning.Operation; import com.google.protobuf.Empty; - -import javax.annotation.Generated; import java.io.IOException; import java.util.List; - -import static com.google.cloud.vision.v1.ProductSearchClient.*; +import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -66,6 +65,7 @@ * } */ @Generated("by gapic-generator-java") +@SuppressWarnings("unchecked") public class ProductSearchSettings extends ClientSettings { /** Returns the object with the settings used for calls to createProductSet. */ diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/RecognitionAudio.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/RecognitionAudio.java index 6a8ecd80..79583de0 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/RecognitionAudio.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/RecognitionAudio.java @@ -52,9 +52,9 @@ * Protobuf type {@code google.cloud.speech.v1.RecognitionAudio} */ public final class RecognitionAudio extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionAudio) - RecognitionAudioOrBuilder { + implements + // @@protoc_insertion_point(message_implements:google.cloud.speech.v1.RecognitionAudio) + RecognitionAudioOrBuilder { private static final long serialVersionUID = 0L; // Use RecognitionAudio.newBuilder() to construct. @@ -67,8 +67,7 @@ protected FieldAccessorTable internalGetFieldAccessorTable() { return null; } - private RecognitionAudio() { - } + private RecognitionAudio() {} @java.lang.Override @SuppressWarnings({"unused"}) @@ -92,15 +91,15 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { } private RecognitionAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); + com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { @@ -109,23 +108,26 @@ private RecognitionAudio( case 0: done = true; break; - case 10: { - audioSourceCase_ = 1; - audioSource_ = input.readBytes(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - audioSourceCase_ = 2; - audioSource_ = s; - break; - } - default: { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; + case 10: + { + audioSourceCase_ = 1; + audioSource_ = input.readBytes(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + audioSourceCase_ = 2; + audioSource_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; } - break; - } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -152,7 +154,7 @@ public Message.Builder toBuilder() { } public enum AudioSourceCase - implements + implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { CONTENT(1), @@ -190,9 +192,7 @@ public static AudioSourceCase forNumber(int value) { public int getNumber() { return this.value; } - } - - ; + }; public com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase getAudioSourceCase() { return com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase.forNumber(audioSourceCase_); @@ -201,6 +201,8 @@ public com.google.cloud.speech.v1.RecognitionAudio.AudioSourceCase getAudioSourc public static final int CONTENT_FIELD_NUMBER = 1; /** + * + * *
    * The audio data bytes encoded as specified in
    * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
@@ -217,6 +219,8 @@ public boolean hasContent() {
   }
 
   /**
+   *
+   *
    * 
    * The audio data bytes encoded as specified in
    * `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a
@@ -238,6 +242,8 @@ public com.google.protobuf.ByteString getContent() {
   public static final int URI_FIELD_NUMBER = 2;
 
   /**
+   *
+   *
    * 
    * URI that points to a file that contains audio data bytes as specified in
    * `RecognitionConfig`. The file must not be compressed (for example, gzip).
@@ -257,6 +263,8 @@ public boolean hasUri() {
   }
 
   /**
+   *
+   *
    * 
    * URI that points to a file that contains audio data bytes as specified in
    * `RecognitionConfig`. The file must not be compressed (for example, gzip).
@@ -289,6 +297,8 @@ public java.lang.String getUri() {
   }
 
   /**
+   *
+   *
    * 
    * URI that points to a file that contains audio data bytes as specified in
    * `RecognitionConfig`. The file must not be compressed (for example, gzip).
@@ -310,7 +320,7 @@ public com.google.protobuf.ByteString getUriBytes() {
     }
     if (ref instanceof java.lang.String) {
       com.google.protobuf.ByteString b =
-              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
+          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
       if (audioSourceCase_ == 2) {
         audioSource_ = b;
       }
@@ -351,8 +361,8 @@ public int getSerializedSize() {
     size = 0;
     if (audioSourceCase_ == 1) {
       size +=
-              com.google.protobuf.CodedOutputStream.computeBytesSize(
-                      1, (com.google.protobuf.ByteString) audioSource_);
+          com.google.protobuf.CodedOutputStream.computeBytesSize(
+              1, (com.google.protobuf.ByteString) audioSource_);
     }
     if (audioSourceCase_ == 2) {
       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, audioSource_);
@@ -362,4 +372,3 @@ public int getSerializedSize() {
     return size;
   }
 }
-
diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechClient.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechClient.java
index 386caaee..263eede4 100644
--- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechClient.java
+++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechClient.java
@@ -22,16 +22,15 @@
 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.RecognitionAudio;
 import com.google.cloud.speech.v1p1beta1.*;
+import com.google.cloud.speech.v1p1beta1.RecognitionAudio;
 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 javax.annotation.Generated;
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS.
 
@@ -177,7 +176,8 @@ public final OperationsClient getOperationsClient() {
    * @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, com.google.cloud.speech.v1p1beta1.RecognitionAudio audio) {
+  public final RecognizeResponse recognize(
+      RecognitionConfig config, com.google.cloud.speech.v1p1beta1.RecognitionAudio audio) {
     RecognizeRequest request =
         RecognizeRequest.newBuilder().setConfig(config).setAudio(audio).build();
     return recognize(request);
diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechSettings.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechSettings.java
index fc51244e..0c975518 100644
--- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechSettings.java
+++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/SpeechSettings.java
@@ -18,18 +18,18 @@
 
 import com.google.api.core.ApiFunction;
 import com.google.api.core.BetaApi;
+import com.google.api.core.InternalExtensionOnly;
 import com.google.api.gax.core.GoogleCredentialsProvider;
 import com.google.api.gax.core.InstantiatingExecutorProvider;
 import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
 import com.google.api.gax.rpc.*;
-import com.google.cloud.speech.v1p1beta1.SpeechClient;
 import com.google.cloud.speech.v1p1beta1.*;
+import com.google.cloud.speech.v1p1beta1.SpeechClient;
 import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings;
 import com.google.longrunning.Operation;
-
-import javax.annotation.Generated;
 import java.io.IOException;
 import java.util.List;
+import javax.annotation.Generated;
 
 // AUTO-GENERATED DOCUMENTATION AND CLASS.
 
@@ -64,7 +64,9 @@
  * }
*/ @BetaApi +@InternalExtensionOnly @Generated("by gapic-generator-java") +@SuppressWarnings("unchecked") public class SpeechSettings extends ClientSettings { /** Returns the object with the settings used for calls to recognize. */ diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ValidationException.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ValidationException.java index 5e7805e2..602af46a 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ValidationException.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/ValidationException.java @@ -37,6 +37,9 @@ * Exception thrown if there is a validation problem with a path template, http config, or related * framework methods. Comes as an illegal argument exception subclass. Allows to globally set a * thread-local validation context description which each exception inherits. + * + * @see Google Cloud + * Storage error codes */ public class ValidationException extends IllegalArgumentException { @@ -69,9 +72,7 @@ public String get() { }); } - /** - * Clears the validation context. - */ + /** Clears the validation context. */ public static void popCurrentThreadValidationContext() { Stack stack = contextLocal.get(); if (stack != null) { @@ -79,9 +80,7 @@ public static void popCurrentThreadValidationContext() { } } - /** - * Construct validation exception with implicit context. - */ + /** Construct validation exception with implicit context. */ public ValidationException(String format, Object... args) { super(message(contextLocal.get(), format, args)); } 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/samples/google/v1/stub/GrpcSpeechStub.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/GrpcSpeechStub.java new file mode 100644 index 00000000..36a00671 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/GrpcSpeechStub.java @@ -0,0 +1,230 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.stub.GrpcSpeechCallableFactory; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcSpeechStub extends SpeechStub { + private static final MethodDescriptor + recognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") + .setRequestMarshaller(ProtoUtils.marshaller(RecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RecognizeResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + longRunningRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(LongRunningRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + streamingRecognizeMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/StreamingRecognize") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingRecognizeRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingRecognizeResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + private final BidiStreamingCallable + streamingRecognizeCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcSpeechStub create(SpeechStubSettings settings) throws IOException { + return new GrpcSpeechStub(settings, ClientContext.create(settings)); + } + + public static final GrpcSpeechStub create(ClientContext clientContext) throws IOException { + return new GrpcSpeechStub(SpeechStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcSpeechStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcSpeechStub( + SpeechStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcSpeechStub, 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 GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcSpeechCallableFactory()); + } + + /** + * Constructs an instance of GrpcSpeechStub, 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 GrpcSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings recognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .build(); + GrpcCallSettings longRunningRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .build(); + GrpcCallSettings + streamingRecognizeTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamingRecognizeMethodDescriptor) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + operationsStub); + this.streamingRecognizeCallable = + callableFactory.createBidiStreamingCallable( + streamingRecognizeTransportSettings, + settings.streamingRecognizeSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public BidiStreamingCallable + streamingRecognizeCallable() { + return streamingRecognizeCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/HttpJsonSpeechStub.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/HttpJsonSpeechStub.java new file mode 100644 index 00000000..15482db8 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/HttpJsonSpeechStub.java @@ -0,0 +1,307 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.stub; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.stub.HttpJsonSpeechCallableFactory; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("unchecked") +public class HttpJsonSpeechStub extends SpeechStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(LongRunningRecognizeResponse.getDescriptor()) + .add(LongRunningRecognizeMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + recognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/Recognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/speech:recognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RecognizeResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + longRunningRecognizeMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1p1beta1/speech:longrunningrecognize", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (LongRunningRecognizeRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private final UnaryCallable recognizeCallable; + private final UnaryCallable longRunningRecognizeCallable; + private final OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final HttpJsonSpeechStub create(SpeechStubSettings settings) throws IOException { + return new HttpJsonSpeechStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonSpeechStub create(ClientContext clientContext) throws IOException { + return new HttpJsonSpeechStub(SpeechStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonSpeechStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonSpeechStub( + SpeechStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, 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 HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonSpeechCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonSpeechStub, 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 HttpJsonSpeechStub( + SpeechStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1p1beta1/operations/{name=**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1p1beta1/operations").build()) + .build()); + + HttpJsonCallSettings recognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(recognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + longRunningRecognizeTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(longRunningRecognizeMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + + this.recognizeCallable = + callableFactory.createUnaryCallable( + recognizeTransportSettings, settings.recognizeSettings(), clientContext); + this.longRunningRecognizeCallable = + callableFactory.createUnaryCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeSettings(), + clientContext); + this.longRunningRecognizeOperationCallable = + callableFactory.createOperationCallable( + longRunningRecognizeTransportSettings, + settings.longRunningRecognizeOperationSettings(), + clientContext, + httpJsonOperationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(recognizeMethodDescriptor); + methodDescriptors.add(longRunningRecognizeMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable recognizeCallable() { + return recognizeCallable; + } + + @Override + public UnaryCallable longRunningRecognizeCallable() { + return longRunningRecognizeCallable; + } + + @Override + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + return longRunningRecognizeOperationCallable; + } + + @Override + public BidiStreamingCallable + streamingRecognizeCallable() { + throw new UnsupportedOperationException( + "Not implemented: streamingRecognizeCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStub.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStub.java new file mode 100644 index 00000000..28453ea8 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStub.java @@ -0,0 +1,75 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +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.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Speech service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class SpeechStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + return null; + } + + public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() { + return null; + } + + public UnaryCallable recognizeCallable() { + throw new UnsupportedOperationException("Not implemented: recognizeCallable()"); + } + + public OperationCallable< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationCallable() { + throw new UnsupportedOperationException( + "Not implemented: longRunningRecognizeOperationCallable()"); + } + + public UnaryCallable longRunningRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: longRunningRecognizeCallable()"); + } + + public BidiStreamingCallable + streamingRecognizeCallable() { + throw new UnsupportedOperationException("Not implemented: streamingRecognizeCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStubSettings.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStubSettings.java new file mode 100644 index 00000000..62f5db7e --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1/stub/SpeechStubSettings.java @@ -0,0 +1,446 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR 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.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse; +import com.google.cloud.speech.v1p1beta1.RecognizeRequest; +import com.google.cloud.speech.v1p1beta1.RecognizeResponse; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest; +import com.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link + * com.google.cloud.speech.v1p1beta1.stub.SpeechStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (speech.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of recognize to 30 seconds: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();
+ * speechSettingsBuilder
+ *     .recognizeSettings()
+ *     .setRetrySettings(
+ *         speechSettingsBuilder
+ *             .recognizeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * SpeechStubSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +@SuppressWarnings("unchecked") +public class SpeechStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings recognizeSettings; + private final UnaryCallSettings + longRunningRecognizeSettings; + private final OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings + streamingRecognizeSettings; + + /** Returns the object with the settings used for calls to recognize. */ + public UnaryCallSettings recognizeSettings() { + return recognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the object with the settings used for calls to longRunningRecognize. */ + public OperationCallSettings< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the object with the settings used for calls to streamingRecognize. */ + public StreamingCallSettings + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + public SpeechStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcSpeechStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonSpeechStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "speech.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "speech.mtls.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder() + .setScopesToApply(DEFAULT_SERVICE_SCOPES) + .setUseJwtAccessWithScope(true); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(SpeechStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder(); + } + + /** Returns a new gRPC builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new REST builder for this class. */ + public static Builder newHttpJsonBuilder() { + return Builder.createHttpJsonDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected SpeechStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + recognizeSettings = settingsBuilder.recognizeSettings().build(); + longRunningRecognizeSettings = settingsBuilder.longRunningRecognizeSettings().build(); + longRunningRecognizeOperationSettings = + settingsBuilder.longRunningRecognizeOperationSettings().build(); + streamingRecognizeSettings = settingsBuilder.streamingRecognizeSettings().build(); + } + + /** Builder for SpeechStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder recognizeSettings; + private final UnaryCallSettings.Builder + longRunningRecognizeSettings; + private final OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings; + private final StreamingCallSettings.Builder< + StreamingRecognizeRequest, StreamingRecognizeResponse> + streamingRecognizeSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000000L)) + .setTotalTimeout(Duration.ofMillis(5000000L)) + .build(); + definitions.put("no_retry_1_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + recognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + longRunningRecognizeOperationSettings = OperationCallSettings.newBuilder(); + streamingRecognizeSettings = StreamingCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + initDefaults(this); + } + + protected Builder(SpeechStubSettings settings) { + super(settings); + + recognizeSettings = settings.recognizeSettings.toBuilder(); + longRunningRecognizeSettings = settings.longRunningRecognizeSettings.toBuilder(); + longRunningRecognizeOperationSettings = + settings.longRunningRecognizeOperationSettings.toBuilder(); + streamingRecognizeSettings = settings.streamingRecognizeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + recognizeSettings, longRunningRecognizeSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .recognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .longRunningRecognizeSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .longRunningRecognizeOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create( + LongRunningRecognizeResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create( + LongRunningRecognizeMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to recognize. */ + public UnaryCallSettings.Builder recognizeSettings() { + return recognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + public UnaryCallSettings.Builder + longRunningRecognizeSettings() { + return longRunningRecognizeSettings; + } + + /** Returns the builder for the settings used for calls to longRunningRecognize. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + LongRunningRecognizeRequest, LongRunningRecognizeResponse, LongRunningRecognizeMetadata> + longRunningRecognizeOperationSettings() { + return longRunningRecognizeOperationSettings; + } + + /** Returns the builder for the settings used for calls to streamingRecognize. */ + public StreamingCallSettings.Builder + streamingRecognizeSettings() { + return streamingRecognizeSettings; + } + + @Override + public SpeechStubSettings build() throws IOException { + return new SpeechStubSettings(this); + } + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/SpeechClient.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/SpeechClient.java index e145e0c3..a25ee18e 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/SpeechClient.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/SpeechClient.java @@ -17,6 +17,7 @@ package com.microsoft.samples.google.v1beta; import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.rpc.BidiStreamingCallable; @@ -27,10 +28,9 @@ import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; - -import javax.annotation.Generated; import java.io.IOException; import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -94,6 +94,7 @@ *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi +@ObsoleteApi("Example obsolete annotation. Use a different version because...") @Generated("by gapic-generator-java") public class SpeechClient implements BackgroundResource { private final com.microsoft.samples.google.SpeechSettings settings; @@ -109,7 +110,8 @@ public static final SpeechClient create() throws IOException { * 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 { + public static final SpeechClient create(com.microsoft.samples.google.SpeechSettings settings) + throws IOException { return new SpeechClient(settings); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java index f98b9ce4..ec2c7dae 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java @@ -27,10 +27,9 @@ import com.google.cloud.speech.v1p1beta1.stub.SpeechStubSettings; import com.google.longrunning.Operation; import com.google.longrunning.OperationsClient; - -import javax.annotation.Generated; import java.io.IOException; import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. @@ -107,9 +106,12 @@ public static final SpeechClient create() throws IOException { /** * 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. + * based on the settings passed in, or defaults for any settings that are not set. Example broken + * links: {@link "http://tools.ietf.org/html/rfc2616#section-3.7"} {@link + * ApiFutures#immediateFuture(null)}. */ - public static final SpeechClient create(com.microsoft.samples.google.SpeechSettings settings) throws IOException { + public static final SpeechClient create(com.microsoft.samples.google.SpeechSettings settings) + throws IOException { return new SpeechClient(settings); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/offers/Offer.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/offers/Offer.java index 0cb9025d..51ed3a23 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/offers/Offer.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/offers/Offer.java @@ -1,38 +1,35 @@ package com.microsoft.samples.offers; -/** - * Represents a form of product availability to customer - */ +/** Represents a form of product availability to customer */ public class Offer { - /** - * Initializes a new instance of the Offer class. - */ - public Offer() { - } + /** Initializes a new instance of the Offer class. */ + public Offer() {} - /** - * Gets or sets qualifications required by the Partner in order to purchase the offer for a customer. - */ - private String[] __ResellerQualifications; + /** + * Gets or sets qualifications required by the Partner in order to purchase the offer for a + * customer. + */ + private String[] __ResellerQualifications; - public String[] getResellerQualifications() { - return __ResellerQualifications; - } + public String[] getResellerQualifications() { + return __ResellerQualifications; + } - public void setResellerQualifications(String[] value) { - __ResellerQualifications = value; - } + public void setResellerQualifications(String[] value) { + __ResellerQualifications = value; + } - /** - * Gets or sets qualifications required by the customer for the partner to purchase it for the customer. - */ - private String[] __ReselleeQualifications; + /** + * Gets or sets qualifications required by the customer for the partner to purchase it for the + * customer. + */ + private String[] __ReselleeQualifications; - public String[] getReselleeQualifications() { - return __ReselleeQualifications; - } + public String[] getReselleeQualifications() { + return __ReselleeQualifications; + } - public void setReselleeQualifications(String[] value) { - __ReselleeQualifications = value; - } -} \ No newline at end of file + public void setReselleeQualifications(String[] value) { + __ReselleeQualifications = value; + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/someexcludedpackage/SomeClassInExcludedPackage.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/someexcludedpackage/SomeClassInExcludedPackage.java index 8d9d4133..8b01667b 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/someexcludedpackage/SomeClassInExcludedPackage.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/someexcludedpackage/SomeClassInExcludedPackage.java @@ -2,13 +2,13 @@ public class SomeClassInExcludedPackage { - private String field; + private String field; - public String getField() { - return field; - } + public String getField() { + return field; + } - public void setField(String field) { - this.field = field; - } + public void setField(String field) { + this.field = field; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/CustomException.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/CustomException.java index 8717af6b..dc982f91 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/CustomException.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/CustomException.java @@ -2,20 +2,20 @@ public class CustomException extends Exception { - public CustomException(String message) { - super(message); - } + public CustomException(String message) { + super(message); + } - /** - * We need to have such method that throw exception declared in the same class - * - * @throws CustomException with reason message - */ - public void makeSomething() throws CustomException { - throw new CustomException("It happened!"); - } + /** + * We need to have such method that throw exception declared in the same class + * + * @throws CustomException with reason message + */ + public void makeSomething() throws CustomException { + throw new CustomException("It happened!"); + } - private class PrivateException { - private String message; - } + private class PrivateException { + private String message; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Display.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Display.java index c1b0eed1..6fa6ae8f 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Display.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Display.java @@ -5,12 +5,12 @@ /** * Do you see some First code block? - *

- * Or this {@code Second} code block? + * + *

Or this {@code Second} code block? */ public interface Display extends Serializable, List> { - void show(); + void show(); - void hide(); + void hide(); } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/InternalException.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/InternalException.java index c868a4cc..788d88ac 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/InternalException.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/InternalException.java @@ -2,7 +2,7 @@ class InternalException extends Exception { - public InternalException(String message) { - super(message); - } + public InternalException(String message) { + super(message); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Person.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Person.java index fb09f8af..32a64e16 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Person.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Person.java @@ -7,71 +7,70 @@ /** * Class that describes some person * - * This comment has links to: + *

This comment has links to: + * *

    - *
  • Owner class {@link Person}
  • - *
  • Its inner class {@link Person.IdentificationInfo}
  • - *
  • Its method {@link Person#setLastName(String lastName)}
  • - *
  • Its method without params {@link Person#setLastName()}
  • - *
  • Its public field {@link Person#age}
  • - *
  • Another class which used here {@link Set}
  • - *
  • Another class which not used here {@link List}
  • - *
  • Broken link {@link sdfdsagdsfghfgh}
  • - *
  • Plain link {@linkplain someContent}
  • - *
  • Link that starts from '#' {@link #setLastName()}
  • - *
  • Link with label {@link Set WordOne}
  • + *
  • Owner class {@link Person} + *
  • Its inner class {@link Person.IdentificationInfo} + *
  • Its method {@link Person#setLastName(String lastName)} + *
  • Its method without params {@link Person#setLastName()} + *
  • Its public field {@link Person#age} + *
  • Another class which used here {@link Set} + *
  • Another class which not used here {@link List} + *
  • Broken link {@link sdfdsagdsfghfgh} + *
  • Plain link {@linkplain someContent} + *
  • Link that starts from '#' {@link #setLastName()} + *
  • Link with label {@link Set WordOne} *
* * This is an "at" symbol: {@literal @} + * * @see Display */ public class Person { - private String firstName; - private String lastName; - public int age; + private String firstName; + private String lastName; + public int age; - public String getFirstName() { - return firstName; - } + public String getFirstName() { + return firstName; + } - public void setFirstName(String firstName) { - this.firstName = firstName; - } + public void setFirstName(String firstName) { + this.firstName = firstName; + } - public String getLastName() { - return lastName; - } + public String getLastName() { + return lastName; + } - public void setLastName(String lastName) { - this.lastName = lastName; - } + public void setLastName(String lastName) { + this.lastName = lastName; + } - public void setLastName() { - this.lastName = null; - } + public void setLastName() { + this.lastName = null; + } - public Set getSomeSet() { - return Collections.emptySet(); - } + public Set getSomeSet() { + return Collections.emptySet(); + } - /** - * We need to have this method that takes parameter and return types declared in the current class - */ - public static Person buildPerson(Person seed) { - return seed; - } + /** + * We need to have this method that takes parameter and return types declared in the current class + */ + public static Person buildPerson(Person seed) { + return seed; + } - /** - * Class that describes person's identification - */ - public static class IdentificationInfo { + /** Class that describes person's identification */ + public static class IdentificationInfo { - /** - * Enum describes person's gender - */ - public enum Gender { - MALE, FEMALE - } + /** Enum describes person's gender */ + public enum Gender { + MALE, + FEMALE } + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/SomeExcludedClass.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/SomeExcludedClass.java index 66a87af6..6cf5d103 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/SomeExcludedClass.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/SomeExcludedClass.java @@ -2,13 +2,13 @@ public class SomeExcludedClass { - private String field; + private String field; - public String getField() { - return field; - } + public String getField() { + return field; + } - public void setField(String field) { - this.field = field; - } + public void setField(String field) { + this.field = field; + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Tuple.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Tuple.java index 2ab5e686..f028a231 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Tuple.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/Tuple.java @@ -1,29 +1,28 @@ package com.microsoft.samples.subpackage; public class Tuple { - private T1 item1; + private T1 item1; - private T2 item2; + private T2 item2; - public Tuple(T1 item1, T2 item2) { - this.item1 = item1; - this.item2 = item2; - } + public Tuple(T1 item1, T2 item2) { + this.item1 = item1; + this.item2 = item2; + } - public T1 getItem1() { - return item1; - } + public T1 getItem1() { + return item1; + } - public void setItem1(T1 item1) { - this.item1 = item1; - } + public void setItem1(T1 item1) { + this.item1 = item1; + } - public T2 getItem2() { - return item2; - } + public T2 getItem2() { + return item2; + } - public void setItem2(T2 item2) { - this.item2 = item2; - } - -} \ No newline at end of file + public void setItem2(T2 item2) { + this.item2 = item2; + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/package-info.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/package-info.java index 8d5be309..e076a379 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/package-info.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/subpackage/package-info.java @@ -1,4 +1,2 @@ -/** - * This subpackage contains the sample set of classes for testing DocFx doclet. - */ +/** This subpackage contains the sample set of classes for testing DocFx doclet. */ package com.microsoft.samples.subpackage; diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/.repo-metadata.json b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/.repo-metadata.json new file mode 100644 index 00000000..bf2ae0bd --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_shortname": "translate", + "name_pretty": "Cloud Translation", + "product_documentation": "https://cloud.google.com/translate/docs/", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-translate/latest/overview", + "rest_documentation": "https://cloud.google.com/translate/docs/reference/rest", + "rpc_documentation": "https://cloud.google.com/translate/docs/reference/rpc", + "issue_tracker": "https://issuetracker.google.com/savedsearches/559749", + "release_level": "stable", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-translate", + "distribution_name": "com.google.cloud:google-cloud-translate", + "api_id": "translation.googleapis.com", + "transport": "both", + "requires_billing": true, + "library_type": "GAPIC_COMBO", + "api_description": "can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service." +} 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 new file mode 100644 index 00000000..f70fe3dd --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ApiVersionTest.java @@ -0,0 +1,115 @@ +package com.microsoft.util; + +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 { + + @Test + public void badFormat() { + assertFalse(ApiVersion.parse("badFormat").isPresent()); + assertFalse(ApiVersion.parse("1p1").isPresent()); + assertFalse(ApiVersion.parse("v1p2p3").isPresent()); + assertFalse(ApiVersion.parse("v1a").isPresent()); + assertFalse(ApiVersion.parse("v1beta2p3").isPresent()); + } + + @Test + public void goodFormat() { + assertTrue(ApiVersion.parse("v99").isPresent()); + assertTrue(ApiVersion.parse("v1p2").isPresent()); + assertTrue(ApiVersion.parse("v2alpha").isPresent()); + assertTrue(ApiVersion.parse("v3beta").isPresent()); + assertTrue(ApiVersion.parse("v3beta1").isPresent()); + assertTrue(ApiVersion.parse("v3beta1").isPresent()); + assertTrue(ApiVersion.parse("v3p1beta2").isPresent()); + } + + @Test + public void testAisGreaterThanB() { + String[][] comparisons = { + {"v3", "v2"}, + {"v1p1", "v1"}, + {"v1", "v1alpha"}, + {"v1", "v1beta"}, + {"v1beta", "v1alpha"}, + {"v1beta", "v1alpha2"}, + {"v1beta1", "v1alpha"}, + {"v1beta1", "v1beta"}, + {"v1beta2", "v1beta1"}, + {"v2p1alpha0", "v1p1alpha0"}, + }; + + for (String[] testcase : comparisons) { + ApiVersion a = parse(testcase[0]); + ApiVersion b = parse(testcase[1]); + assertThat(a).isGreaterThan(b); + } + } + + @Test + public void stability() { + assertTrue(parse("v12").isStable()); + assertTrue(parse("v1p3").isStable()); + + assertFalse(parse("v1alpha").isStable()); + assertFalse(parse("v1p1beta1").isStable()); + } + + @Test + public void equals() { + assertThat(parse("v1")).isEqualTo(parse("v1p0")); + assertThat(parse("v1p0")).isEqualTo(parse("v1")); + assertThat(parse("v2p1beta")).isEqualTo(parse("v2p1beta0")); + } + + 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())); + } + + @Test + public void testToString() { + assertThat(parse("v1").toString()).isEqualTo("v1"); + assertThat(parse("v1p0").toString()).isEqualTo("v1p0"); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ElementUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ElementUtilTest.java index 312aae07..178be191 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ElementUtilTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/ElementUtilTest.java @@ -1,85 +1,104 @@ package com.microsoft.util; -import com.google.testing.compile.CompilationRule; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; +import static org.junit.Assert.*; -import javax.lang.model.element.Element; -import javax.lang.model.util.Elements; +import com.google.testing.compile.CompilationRule; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.regex.Pattern; import java.util.stream.Collectors; - -import static org.junit.Assert.*; +import javax.lang.model.element.Element; +import javax.lang.model.util.Elements; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class ElementUtilTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private ElementUtil elementUtil; - - @Before - public void setup() { - elements = rule.getElements(); - elementUtil = new ElementUtil( - new String[]{"samples\\.someexcludedpackage"}, - new String[]{"com\\.microsoft\\..*SomeExcludedClass"}); - } - - @Test - public void extractPackageElements() { - Set elementsSet = new HashSet<>() {{ + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private ElementUtil elementUtil; + + @Before + public void setup() { + elements = rule.getElements(); + elementUtil = + new ElementUtil( + new String[] {"samples\\.someexcludedpackage"}, + new String[] {"com\\.microsoft\\..*SomeExcludedClass"}); + } + + @Test + public void extractPackageElements() { + Set elementsSet = + new HashSet<>() { + { add(elements.getPackageElement("com.microsoft.samples")); add(elements.getTypeElement("com.microsoft.samples.SuperHero")); add(elements.getPackageElement("com.microsoft.samples.subpackage")); - }}; - - List result = elementUtil.extractPackageElements(elementsSet) - .stream().map(String::valueOf).collect(Collectors.toList()); - - assertEquals("Wrong result list size", result.size(), 2); - assertEquals("Unexpected first item", result.get(0), "com.microsoft.samples"); - assertEquals("Unexpected second item", result.get(1), "com.microsoft.samples.subpackage"); - } - - @Test - public void extractSortedElements() { - Element element = elements.getPackageElement("com.microsoft.samples.subpackage"); - - List allElements = element.getEnclosedElements() - .stream().map(String::valueOf).collect(Collectors.toList()); - - // Ensure items to exclude exist. - assertEquals("Wrong enclosed elements number", allElements.size(), 6); - assertTrue("Unexpected package private class", allElements.contains("com.microsoft.samples.subpackage.InternalException")); - assertTrue("Unexpected to-exclude class", allElements.contains("com.microsoft.samples.subpackage.SomeExcludedClass")); - - - List extractedElements = elementUtil.extractSortedElements(element) - .stream().map(String::valueOf).collect(Collectors.toList()); - - // Verify filtered and sorted result - assertEquals("Wrong result list size", extractedElements.size(), 4); - assertEquals("Unexpected first item in the result list after invoke method extractSortedElements()", extractedElements.get(0), "com.microsoft.samples.subpackage.CustomException"); - assertEquals("Unexpected second item in the result list after invoke method extractSortedElements()", extractedElements.get(1), "com.microsoft.samples.subpackage.Display"); - assertEquals("Unexpected third item in the result list after invoke method extractSortedElements()", extractedElements.get(2), "com.microsoft.samples.subpackage.Person"); - } - - @Test - public void matchAnyPattern() { - HashSet patterns = new HashSet<>( - Arrays.asList(Pattern.compile("com\\.ms\\.Some.*"), Pattern.compile(".*UsualClass"))); - assertTrue(elementUtil.matchAnyPattern(patterns, "com.ms.SomeStrangeClass")); - assertTrue(elementUtil.matchAnyPattern(patterns, "UsualClass")); - assertFalse(elementUtil.matchAnyPattern(patterns, "EngineFive")); - assertFalse(elementUtil.matchAnyPattern(patterns, "com.ms.Awesome")); - } + } + }; + + List result = + elementUtil.extractPackageElements(elementsSet).stream() + .map(String::valueOf) + .collect(Collectors.toList()); + + assertEquals("Wrong result list size", result.size(), 2); + assertEquals("Unexpected first item", result.get(0), "com.microsoft.samples"); + assertEquals("Unexpected second item", result.get(1), "com.microsoft.samples.subpackage"); + } + + @Test + public void extractSortedElements() { + Element element = elements.getPackageElement("com.microsoft.samples.subpackage"); + + List allElements = + element.getEnclosedElements().stream().map(String::valueOf).collect(Collectors.toList()); + + // Ensure items to exclude exist. + assertEquals("Wrong enclosed elements number", allElements.size(), 6); + assertTrue( + "Unexpected package private class", + allElements.contains("com.microsoft.samples.subpackage.InternalException")); + assertTrue( + "Unexpected to-exclude class", + allElements.contains("com.microsoft.samples.subpackage.SomeExcludedClass")); + + List extractedElements = + elementUtil.extractSortedElements(element).stream() + .map(String::valueOf) + .collect(Collectors.toList()); + + // Verify filtered and sorted result + assertEquals("Wrong result list size", extractedElements.size(), 4); + assertEquals( + "Unexpected first item in the result list after invoke method extractSortedElements()", + extractedElements.get(0), + "com.microsoft.samples.subpackage.CustomException"); + assertEquals( + "Unexpected second item in the result list after invoke method extractSortedElements()", + extractedElements.get(1), + "com.microsoft.samples.subpackage.Display"); + assertEquals( + "Unexpected third item in the result list after invoke method extractSortedElements()", + extractedElements.get(2), + "com.microsoft.samples.subpackage.Person"); + } + + @Test + public void matchAnyPattern() { + HashSet patterns = + new HashSet<>( + Arrays.asList(Pattern.compile("com\\.ms\\.Some.*"), Pattern.compile(".*UsualClass"))); + assertTrue(elementUtil.matchAnyPattern(patterns, "com.ms.SomeStrangeClass")); + assertTrue(elementUtil.matchAnyPattern(patterns, "UsualClass")); + assertFalse(elementUtil.matchAnyPattern(patterns, "EngineFive")); + assertFalse(elementUtil.matchAnyPattern(patterns, "com.ms.Awesome")); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/FileUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/FileUtilTest.java index dfb675bd..16c379ad 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/FileUtilTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/FileUtilTest.java @@ -1,8 +1,7 @@ package com.microsoft.util; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; @@ -10,60 +9,58 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Comparator; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; public class FileUtilTest { - private final String ROOT_DIR = "target/dir1"; - private final String FILE_NAME = ROOT_DIR + "/dir2/out.txt"; + private final String ROOT_DIR = "target/dir1"; + private final String FILE_NAME = ROOT_DIR + "/dir2/out.txt"; - @Before - public void setup() throws IOException { - deleteDirectory(ROOT_DIR); - } + @Before + public void setup() throws IOException { + deleteDirectory(ROOT_DIR); + } - @After - public void tearDown() throws IOException { - deleteDirectory(ROOT_DIR); - } + @After + public void tearDown() throws IOException { + deleteDirectory(ROOT_DIR); + } - @Test - public void dumpToFileWithDirectoryCreation() throws IOException { - String content = "Bla-bla content"; + @Test + public void dumpToFileWithDirectoryCreation() throws IOException { + String content = "Bla-bla content"; - FileUtil.dumpToFile(content, FILE_NAME); + FileUtil.dumpToFile(content, FILE_NAME); - assertTrue("New file should appear", Files.exists(Paths.get(FILE_NAME))); - assertEquals("Invalid file content", Files.readString(Paths.get(FILE_NAME)), content); - } + assertTrue("New file should appear", Files.exists(Paths.get(FILE_NAME))); + assertEquals("Invalid file content", Files.readString(Paths.get(FILE_NAME)), content); + } - @Test - public void dumpToFileForExistingNonEmptyDirectory() throws IOException { - createDirectoryWithFile(ROOT_DIR + "/dir2/tmp1.txt"); - String content = "Bla-bla content"; + @Test + public void dumpToFileForExistingNonEmptyDirectory() throws IOException { + createDirectoryWithFile(ROOT_DIR + "/dir2/tmp1.txt"); + String content = "Bla-bla content"; - FileUtil.dumpToFile(content, FILE_NAME); + FileUtil.dumpToFile(content, FILE_NAME); - assertTrue("Existing file should not be deleted", Files.exists(Path.of(ROOT_DIR + "/dir2/tmp1.txt"))); - assertTrue("New file should appear", Files.exists(Paths.get(FILE_NAME))); - assertEquals("Invalid file content", Files.readString(Paths.get(FILE_NAME)), content); - } + assertTrue( + "Existing file should not be deleted", Files.exists(Path.of(ROOT_DIR + "/dir2/tmp1.txt"))); + assertTrue("New file should appear", Files.exists(Paths.get(FILE_NAME))); + assertEquals("Invalid file content", Files.readString(Paths.get(FILE_NAME)), content); + } - public static void deleteDirectory(String pathString) throws IOException { - Path path = Paths.get(pathString); - if (Files.exists(path)) { - Files.walk(path) - .sorted(Comparator.reverseOrder()) - .map(Path::toFile) - .forEach(File::delete); - } + public static void deleteDirectory(String pathString) throws IOException { + Path path = Paths.get(pathString); + if (Files.exists(path)) { + Files.walk(path).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); } + } - public static void createDirectoryWithFile(String pathString) throws IOException { - Path path = Paths.get(pathString); - Files.createDirectories(path.getParent()); - Files.createFile(path); - } + public static void createDirectoryWithFile(String pathString) throws IOException { + Path path = Paths.get(pathString); + Files.createDirectories(path.getParent()); + Files.createFile(path); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/OptionsFileUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/OptionsFileUtilTest.java index 2a6460f1..3491b94e 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/OptionsFileUtilTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/OptionsFileUtilTest.java @@ -1,42 +1,46 @@ package com.microsoft.util; -import org.junit.Test; +import static org.junit.Assert.assertTrue; -import java.util.Arrays; import java.util.List; - -import static org.junit.Assert.assertTrue; +import org.junit.Test; public class OptionsFileUtilTest { - private final String PARAMS_DIR = "src/test/resources/test-doclet-params.txt"; + private final String PARAMS_DIR = "src/test/resources/test-doclet-params.txt"; - @Test - public void processOptionsFile() { - List strings = Arrays.asList(OptionsFileUtil.processOptionsFile(PARAMS_DIR)); + @Test + public void processOptionsFile() { + List strings = OptionsFileUtil.processOptionsFile(PARAMS_DIR); - assertTrue("Wrong result", strings.contains("-doclet")); - assertTrue("Wrong result", strings.contains("com.microsoft.doclet.DocFxDoclet")); + assertTrue("Wrong result", strings.contains("-doclet")); + assertTrue("Wrong result", strings.contains("com.microsoft.doclet.DocFxDoclet")); - assertTrue("Wrong result", strings.contains("-sourcepath")); - assertTrue("Wrong result", strings.contains("./src/test/java")); + assertTrue("Wrong result", strings.contains("-sourcepath")); + assertTrue("Wrong result", strings.contains("./src/test/java")); - assertTrue("Wrong result", strings.contains("-outputpath")); - assertTrue("Wrong result", strings.contains("./target/test-out")); + assertTrue("Wrong result", strings.contains("-outputpath")); + assertTrue("Wrong result", strings.contains("./target/test-out")); - assertTrue("Wrong result", strings.contains("-encoding")); - assertTrue("Wrong result", strings.contains("UTF-8")); + assertTrue("Wrong result", strings.contains("-encoding")); + assertTrue("Wrong result", strings.contains("UTF-8")); - assertTrue("Wrong result", strings.contains("-projectname")); - assertTrue("Wrong result", strings.contains("google-cloud-project-parent")); + assertTrue("Wrong result", strings.contains("-projectname")); + assertTrue("Wrong result", strings.contains("google-cloud-project-parent")); - assertTrue("Wrong result", strings.contains("-excludepackages")); - assertTrue("Wrong result", strings.contains("com\\.microsoft\\.samples\\.someexcludedpack.*:com\\.microsoft\\.samples\\.someunexistingpackage")); + assertTrue("Wrong result", strings.contains("-excludepackages")); + assertTrue( + "Wrong result", + strings.contains( + "com\\.microsoft\\.samples\\.someexcludedpack.*:com\\.microsoft\\.samples\\.someunexistingpackage")); - assertTrue("Wrong result", strings.contains("-excludeclasses")); - assertTrue("Wrong result", strings.contains("com\\.microsoft\\.samples\\.subpackage\\.SomeExcluded.*:com\\.microsoft\\.samples\\.subpackage\\.SomeUnexistingClass")); + assertTrue("Wrong result", strings.contains("-excludeclasses")); + assertTrue( + "Wrong result", + strings.contains( + "com\\.microsoft\\.samples\\.subpackage\\.SomeExcluded.*:com\\.microsoft\\.samples\\.subpackage\\.SomeUnexistingClass")); - assertTrue("Wrong result", strings.contains("-subpackages")); - assertTrue("Wrong result", strings.contains("com.microsoft.samples")); - } + assertTrue("Wrong result", strings.contains("-subpackages")); + assertTrue("Wrong result", strings.contains("com.microsoft.samples")); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/RepoMetadataTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/RepoMetadataTest.java new file mode 100644 index 00000000..f193a6a0 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/RepoMetadataTest.java @@ -0,0 +1,42 @@ +package com.microsoft.util; + +import static junit.framework.TestCase.assertEquals; + +import com.google.docfx.doclet.RepoMetadata; +import org.junit.Test; + +public class RepoMetadataTest { + @Test + public void testParseRepoMetadata() { + RepoMetadata testRepoMetadata = new RepoMetadata(); + String testRepoMetadataFilePath = "./src/test/java/com/microsoft/util/.repo-metadata.json"; + testRepoMetadata = testRepoMetadata.parseRepoMetadata(testRepoMetadataFilePath); + assertEquals("translate", testRepoMetadata.getApiShortName()); + assertEquals("Cloud Translation", testRepoMetadata.getNamePretty()); + assertEquals( + "https://cloud.google.com/translate/docs/", testRepoMetadata.getProductDocumentationUri()); + assertEquals( + "https://cloud.google.com/translate/docs/reference/rest", + testRepoMetadata.getRestDocumentationUri().get()); + assertEquals( + "https://cloud.google.com/translate/docs/reference/rpc", + testRepoMetadata.getRpcDocumentationUri().get()); + assertEquals( + "can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service.", + testRepoMetadata.getApiDescription()); + assertEquals( + "https://cloud.google.com/java/docs/reference/google-cloud-translate/latest/overview", + testRepoMetadata.getClientDocumentationUri()); + assertEquals("googleapis/google-cloud-java", testRepoMetadata.getRepo()); + assertEquals("java-translate", testRepoMetadata.getRepoShort()); + assertEquals("com.google.cloud:google-cloud-translate", testRepoMetadata.getDistributionName()); + assertEquals("translation.googleapis.com", testRepoMetadata.getApiId()); + assertEquals("google-cloud-translate", testRepoMetadata.getArtifactId()); + assertEquals( + "https://github.com/googleapis/google-cloud-java/tree/main/java-translate", + testRepoMetadata.getGithubLink()); + assertEquals( + "https://central.sonatype.com/artifact/com.google.cloud/google-cloud-translate", + testRepoMetadata.getMavenLink()); + } +} diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/UtilsTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/UtilsTest.java index 2acf975f..ff9ad5b8 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/UtilsTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/UtilsTest.java @@ -1,97 +1,98 @@ package com.microsoft.util; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import com.google.testing.compile.CompilationRule; +import java.util.List; +import java.util.stream.Collectors; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.util.Elements; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.junit.MockitoJUnitRunner; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.util.Elements; -import java.util.List; -import java.util.stream.Collectors; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - @RunWith(MockitoJUnitRunner.class) public class UtilsTest { - @Rule - public CompilationRule rule = new CompilationRule(); - private Elements elements; - private List allElements; - - @Before - public void setup() { - elements = rule.getElements(); - Element element = elements.getTypeElement("com.microsoft.samples.SuperHero"); - allElements = element.getEnclosedElements().stream().collect(Collectors.toList()); - } - - // Test isPackagePrivate() method - @Test - public void isPackagePrivate_True_PackagePrivateMethod() { - Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); - assertTrue(Utils.isPackagePrivate(method)); - } - - @Test - public void isPackagePrivate_True_PackagePrivateField() { - Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "hobby"); - assertTrue(Utils.isPackagePrivate(field)); - } - - // Test isPrivate() method - @Test - public void isPrivate_True_PrivateMethod() { - Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "setHobby(java.lang.String)"); - assertTrue(Utils.isPrivate(method)); - } - - @Test - public void isPrivate_True_PrivateField() { - Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); - assertTrue(Utils.isPrivate(field)); - } - - // Test isPrivateOrPackagePrivate() method - @Test - public void isPrivateOrPackagePrivate_True_PackagePrivateMethod() { - Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); - assertTrue(Utils.isPrivateOrPackagePrivate(method)); - } - - @Test - public void isPrivateOrPackagePrivate_True_PrivateFiled() { - Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); - assertTrue(Utils.isPrivateOrPackagePrivate(field)); - } - - @Test - public void isPrivateOrPackagePrivate_False_PublicMethod() { - Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getUniquePower()"); - assertFalse(Utils.isPrivateOrPackagePrivate(method)); - } - - @Test - public void isPrivateOrPackagePrivate_False_PublicField() { - Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "SOME_PUBLIC_STRING"); - assertFalse(Utils.isPrivateOrPackagePrivate(field)); - } - - @Test - public void isPrivateOrPackagePrivate_False_ProtectedMethod() { - Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHealth()"); - assertFalse(Utils.isPrivateOrPackagePrivate(method)); - } - - private Element getElementByKindAndName(List elements, ElementKind elementKind, String name) { - return elements.stream() - .filter(e -> e.toString().equals(name)) - .filter(e -> e.getKind() == elementKind) - .findFirst().orElse(null); - } + @Rule public CompilationRule rule = new CompilationRule(); + private Elements elements; + private List allElements; + + @Before + public void setup() { + elements = rule.getElements(); + Element element = elements.getTypeElement("com.microsoft.samples.SuperHero"); + allElements = element.getEnclosedElements().stream().collect(Collectors.toList()); + } + + // Test isPackagePrivate() method + @Test + public void isPackagePrivate_True_PackagePrivateMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); + assertTrue(Utils.isPackagePrivate(method)); + } + + @Test + public void isPackagePrivate_True_PackagePrivateField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "hobby"); + assertTrue(Utils.isPackagePrivate(field)); + } + + // Test isPrivate() method + @Test + public void isPrivate_True_PrivateMethod() { + Element method = + getElementByKindAndName(allElements, ElementKind.METHOD, "setHobby(java.lang.String)"); + assertTrue(Utils.isPrivate(method)); + } + + @Test + public void isPrivate_True_PrivateField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); + assertTrue(Utils.isPrivate(field)); + } + + // Test isPrivateOrPackagePrivate() method + @Test + public void isPrivateOrPackagePrivate_True_PackagePrivateMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHobby()"); + assertTrue(Utils.isPrivateOrPackagePrivate(method)); + } + + @Test + public void isPrivateOrPackagePrivate_True_PrivateFiled() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "uniquePower"); + assertTrue(Utils.isPrivateOrPackagePrivate(field)); + } + + @Test + public void isPrivateOrPackagePrivate_False_PublicMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getUniquePower()"); + assertFalse(Utils.isPrivateOrPackagePrivate(method)); + } + + @Test + public void isPrivateOrPackagePrivate_False_PublicField() { + Element field = getElementByKindAndName(allElements, ElementKind.FIELD, "SOME_PUBLIC_STRING"); + assertFalse(Utils.isPrivateOrPackagePrivate(field)); + } + + @Test + public void isPrivateOrPackagePrivate_False_ProtectedMethod() { + Element method = getElementByKindAndName(allElements, ElementKind.METHOD, "getHealth()"); + assertFalse(Utils.isPrivateOrPackagePrivate(method)); + } + + private Element getElementByKindAndName( + List elements, ElementKind elementKind, String name) { + return elements.stream() + .filter(e -> e.toString().equals(name)) + .filter(e -> e.getKind() == elementKind) + .findFirst() + .orElse(null); + } } diff --git a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java index 7b290f56..44c26e60 100644 --- a/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/util/YamlUtilTest.java @@ -1,136 +1,211 @@ package com.microsoft.util; +import static org.junit.Assert.*; + import com.microsoft.model.MetadataFile; import com.microsoft.model.MetadataFileItem; import com.microsoft.model.MethodParameter; -import org.apache.commons.io.FileUtils; -import org.junit.Test; - -import java.io.File; -import java.io.IOException; import java.util.Collections; import java.util.UUID; - -import static java.nio.charset.StandardCharsets.UTF_8; -import static org.junit.Assert.*; +import org.junit.Test; public class YamlUtilTest { - @Test - public void objectToYamlString() { - MetadataFile metadataFile = new MetadataFile("", "SomeFileName"); - metadataFile.getItems().add(buildMetadataFileItem(3)); - metadataFile.getReferences().add(buildMetadataFileItem(5)); - - String result = YamlUtil.objectToYamlString(metadataFile); - - assertEquals("Wrong result", result, "" - + "items:\n" - + "- uid: \"Some uid 3\"\n" - + " id: \"Some id3\"\n" - + " href: \"Some href3\"\n" - + " syntax:\n" - + " parameters:\n" - + " - id: \"Some id 3\"\n" - + " type: \"Some type 3\"\n" - + " description: \"Some desc 3\"\n" - + "references:\n" - + "- uid: \"Some uid 5\"\n" - + " id: \"Some id5\"\n" - + " href: \"Some href5\"\n" - + " syntax:\n" - + " parameters:\n" - + " - id: \"Some id 5\"\n" - + " type: \"Some type 5\"\n" - + " description: \"Some desc 5\"\n"); - } - - private MetadataFileItem buildMetadataFileItem(int seed) { - MetadataFileItem metadataFileItem = new MetadataFileItem("Some uid " + seed); - metadataFileItem.setId("Some id" + seed); - metadataFileItem.setHref("Some href" + seed); - metadataFileItem.setParameters(Collections.singletonList( - new MethodParameter("Some id " + seed, "Some type " + seed, "Some desc " + seed))); - - return metadataFileItem; - } - - - @Test - public void cleanupHtmlRemoveLonePreTagsTest() { - String expectedActual = "
text
"; - String expectedResult = "text"; - String expectedWithCode = "
text
"; - String random = UUID.randomUUID().toString(); - - assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); - assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); - assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); - assertEquals(expectedWithCode, YamlUtil.cleanupHtml(expectedWithCode)); - } - - @Test - public void cleanupHtmlIncludePrettyPrintTest() { - String expectedActual = "
";
-        String expectedResult = "
";
-        String random = UUID.randomUUID().toString();
-
-        assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual));
-        assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random));
-        assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual));
-        assertNotEquals(expectedResult, YamlUtil.cleanupHtml("
" + random + ""));
-        assertFalse(YamlUtil.cleanupHtml("
" + random + "").contains("class=\"pretty-print\""));
-    }
-
-    @Test
-    public void cleanupHtmlAddCodeTagsTest() {
-        String expectedActual = "`text`";
-        String expectedResult = "text";
-        String random = UUID.randomUUID().toString();
-
-        assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual));
-        assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random));
-        assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual));
-        assertEquals("`" + expectedResult, YamlUtil.cleanupHtml("`" + expectedActual));
-        assertFalse(YamlUtil.cleanupHtml("`" + random).contains(""));
-    }
-
-    @Test
-    public void cleanupHtmlAddHrefTagsTest() {
-        String expectedActual = "[text](link)";
-        String expectedResult = "text";
-        String random = UUID.randomUUID().toString();
-
-        assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual));
-        assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random));
-        assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual));
-        assertEquals("[text]](link)", YamlUtil.cleanupHtml("[text]](link)"));
-        assertFalse(YamlUtil.cleanupHtml("[text(link)]").contains("href"));
-    }
-
-    @Test
-    public void cleanupHtmlEqualTitlesTest() {
-        String expectedActual = "======================= SpeechClient =======================";
-        String expectedResult = "

SpeechClient

"; - String random = UUID.randomUUID().toString(); - - assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); - assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); - assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); - assertEquals("= text =", YamlUtil.cleanupHtml("= text =")); - } - - @Test - public void cleanupHtmlReferenceTest() { - String expectedActual = "[KeyRing][google.cloud.kms.v1.KeyRing]"; - String expectedResult = "KeyRing"; - String random = UUID.randomUUID().toString(); - - assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); - assertEquals(random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); - assertEquals(expectedResult + random + expectedResult, YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); - - assertEquals("[uid]][text]", YamlUtil.cleanupHtml("[uid]][text]")); - assertFalse(YamlUtil.cleanupHtml("[text[uid]]").contains("xref")); - } + @Test + public void objectToYamlString() { + MetadataFile metadataFile = new MetadataFile("", "SomeFileName"); + metadataFile.getItems().add(buildMetadataFileItem(3)); + metadataFile.getReferences().add(buildMetadataFileItem(5)); + + String result = YamlUtil.objectToYamlString(metadataFile); + + assertEquals( + "Wrong result", + result, + "" + + "items:\n" + + "- uid: \"Some uid 3\"\n" + + " id: \"Some id3\"\n" + + " href: \"Some href3\"\n" + + " syntax:\n" + + " parameters:\n" + + " - id: \"Some id 3\"\n" + + " type: \"Some type 3\"\n" + + " description: \"Some desc 3\"\n" + + "references:\n" + + "- uid: \"Some uid 5\"\n" + + " id: \"Some id5\"\n" + + " href: \"Some href5\"\n" + + " syntax:\n" + + " parameters:\n" + + " - id: \"Some id 5\"\n" + + " type: \"Some type 5\"\n" + + " description: \"Some desc 5\"\n"); + } + + private MetadataFileItem buildMetadataFileItem(int seed) { + MetadataFileItem metadataFileItem = new MetadataFileItem("Some uid " + seed); + metadataFileItem.setId("Some id" + seed); + metadataFileItem.setHref("Some href" + seed); + metadataFileItem.setParameters( + Collections.singletonList( + new MethodParameter("Some id " + seed, "Some type " + seed, "Some desc " + seed))); + + return metadataFileItem; + } + + @Test + public void cleanupHtmlRemoveLonePreTagsTest() { + String expectedActual = "
text
"; + String expectedResult = "text"; + String expectedWithCode = "
text
"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + assertEquals(expectedWithCode, YamlUtil.cleanupHtml(expectedWithCode)); + } + + @Test + public void cleanupHtmlIncludePrettyPrintTest() { + String expectedActual = "
";
+    String expectedResult = "
";
+    String random = UUID.randomUUID().toString();
+
+    assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual));
+    assertEquals(
+        random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random));
+    assertEquals(
+        expectedResult + random + expectedResult,
+        YamlUtil.cleanupHtml(expectedActual + random + expectedActual));
+    assertNotEquals(expectedResult, YamlUtil.cleanupHtml("
" + random + ""));
+    assertFalse(
+        YamlUtil.cleanupHtml("
" + random + "")
+            .contains("class=\"prettyprint lang-java\""));
+  }
+
+  @Test
+  public void cleanupHtmlEncodeBracketsTest() {
+    String expectedActual =
+        " List things = new ArrayList<>(); \n  

text

"; + String expectedResult = + " List<String> things = new ArrayList<>(); \n

text

<Object>"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + } + + @Test + public void cleanupHtmlAddCodeTagsTest() { + String expectedActual = "`text`"; + String expectedResult = "text"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + assertEquals("`" + expectedResult, YamlUtil.cleanupHtml("`" + expectedActual)); + assertFalse(YamlUtil.cleanupHtml("`" + random).contains("")); + } + + @Test + public void cleanupHtmlAddHrefTagsTest() { + String expectedActual = "[text](link)"; + String expectedResult = "text"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + assertEquals("[text]](link)", YamlUtil.cleanupHtml("[text]](link)")); + assertFalse(YamlUtil.cleanupHtml("[text(link)]").contains("href")); + } + + @Test + public void cleanupHtmlEqualTitlesTest() { + String expectedActual = "======================= SpeechClient ======================="; + String expectedResult = "

SpeechClient

"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + + assertEquals("= text =", YamlUtil.cleanupHtml("= text =")); + assertEquals("==testing==", YamlUtil.cleanupHtml("==testing==")); + assertEquals( + "=======================SpeechClient=======================", + "=======================SpeechClient======================="); + assertEquals( + "\"scikit-learn\":\"==0.19.0\"TextTextText\"botocore\":\"==1.7.14\"", + "\"scikit-learn\":\"==0.19.0\"TextTextText\"botocore\":\"==1.7.14\""); + assertEquals( + "======= test1234 ===== 1234test === 1234test1234 == test =", + YamlUtil.cleanupHtml("======= test1234 ===== 1234test === 1234test1234 == test =")); + assertEquals( + "====== Markdown H1 Test ======", YamlUtil.cleanupHtml("====== Markdown H1 Test ======")); + } + + @Test + public void cleanupHtmlReferenceTest() { + String expectedActual = "[KeyRing][google.cloud.kms.v1.KeyRing]"; + String expectedResult = + "KeyRing"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + + assertEquals("[uid]][text]", YamlUtil.cleanupHtml("[uid]][text]")); + assertFalse(YamlUtil.cleanupHtml("[text[uid]]").contains("xref")); + } + + @Test + public void cleanupHtmlLinkTagWithLinkTest() { + String expectedActual = "{@link \"http://www.bad-way-to-include-link.com#section\"}"; + String expectedResult = + "http://www.bad-way-to-include-link.com#section"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + } + + @Test + public void cleanupHtmlLinkTagNotRecognizedTest() { + String expectedActual = "{@link WeirdLink#didntResolve(null)}"; + String expectedResult = + "WeirdLink#didntResolve(null)"; + String random = UUID.randomUUID().toString(); + + assertEquals(expectedResult, YamlUtil.cleanupHtml(expectedActual)); + assertEquals( + random + expectedResult + random, YamlUtil.cleanupHtml(random + expectedActual + random)); + assertEquals( + expectedResult + random + expectedResult, + YamlUtil.cleanupHtml(expectedActual + random + expectedActual)); + } } diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponent.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponent.yml index 5aa4cfcf..5d4b9f0d 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponent.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.BasePartnerComponent.yml @@ -14,7 +14,7 @@ items: fullName: "com.microsoft.samples.BasePartnerComponent" type: "Class" package: "com.microsoft.samples" - summary: "Holds common partner component properties and behavior. All components should inherit from this class. The context\n object type." + summary: "Holds common partner component properties and behavior. All components should inherit from this\n class. The context object type." syntax: content: "public abstract class BasePartnerComponent" typeParameters: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml new file mode 100644 index 00000000..9cebcb52 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Builder.yml @@ -0,0 +1,250 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Builder" + id: "Builder" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Builder.abortOn(java.lang.Class...)" + - "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + - "com.microsoft.samples.ExceptionHandler.Builder.build()" + - "com.microsoft.samples.ExceptionHandler.Builder.retryOn(java.lang.Class...)" + langs: + - "java" + name: "ExceptionHandler.Builder" + nameWithType: "ExceptionHandler.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder" + type: "Class" + package: "com.microsoft.samples" + summary: "ExceptionHandler builder." + syntax: + content: "public static class ExceptionHandler.Builder" + inheritance: + - "java.lang.Object" + 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.ExceptionHandler.Builder.Builder()" + id: "Builder()" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "Builder()" + nameWithType: "ExceptionHandler.Builder.Builder()" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.Builder()" + overload: "com.microsoft.samples.ExceptionHandler.Builder.Builder*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private Builder()" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.abortOn(java.lang.Class...)" + id: "abortOn(java.lang.Class...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "abortOn(Class[] exceptions)" + nameWithType: "ExceptionHandler.Builder.abortOn(Class[] exceptions)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.abortOn(Class[] exceptions)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.abortOn*" + type: "Method" + package: "com.microsoft.samples" + summary: "Adds the exceptions to abort on." + syntax: + content: "public final ExceptionHandler.Builder abortOn(Class[] exceptions)" + parameters: + - id: "exceptions" + type: "java.lang.Class[]" + description: "retry should abort when such exceptions are thrown" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + id: "addInterceptors(com.microsoft.samples.ExceptionHandler.Interceptor...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + nameWithType: "ExceptionHandler.Builder.addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors*" + type: "Method" + package: "com.microsoft.samples" + summary: "Adds the exception handler interceptors. Call order will be maintained." + syntax: + content: "public ExceptionHandler.Builder addInterceptors(ExceptionHandler.Interceptor[] interceptors)" + parameters: + - id: "interceptors" + type: "com.microsoft.samples.ExceptionHandler.Interceptor[]" + description: "the interceptors for this exception handler" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.build()" + id: "build()" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "build()" + nameWithType: "ExceptionHandler.Builder.build()" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.build()" + overload: "com.microsoft.samples.ExceptionHandler.Builder.build*" + type: "Method" + package: "com.microsoft.samples" + summary: "Returns a new ExceptionHandler instance." + syntax: + content: "public ExceptionHandler build()" + return: + type: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.retryOn(java.lang.Class...)" + id: "retryOn(java.lang.Class...)" + parent: "com.microsoft.samples.ExceptionHandler.Builder" + langs: + - "java" + name: "retryOn(Class[] exceptions)" + nameWithType: "ExceptionHandler.Builder.retryOn(Class[] exceptions)" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.retryOn(Class[] exceptions)" + overload: "com.microsoft.samples.ExceptionHandler.Builder.retryOn*" + type: "Method" + package: "com.microsoft.samples" + summary: "Add the exceptions to ignore/retry-on." + syntax: + content: "public final ExceptionHandler.Builder retryOn(Class[] exceptions)" + parameters: + - id: "exceptions" + type: "java.lang.Class[]" + description: "retry should continue when such exceptions are thrown" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + description: "the Builder for chaining" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Builder.Builder*" + name: "Builder" + nameWithType: "ExceptionHandler.Builder.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.Builder" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor[]" + spec.java: + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors*" + name: "addInterceptors" + nameWithType: "ExceptionHandler.Builder.addInterceptors" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.addInterceptors" + package: "com.microsoft.samples" +- uid: "java.lang.Class[]" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class[].html" + spec.java: + - uid: "java.lang.Class" + name: "Class" + fullName: "java.lang.Class" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" + - name: "<" + fullName: "<" + isExternal: false + - uid: "? extends java.lang.Exception" + name: "Exception" + fullName: "? extends java.lang.Exception" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Builder.retryOn*" + name: "retryOn" + nameWithType: "ExceptionHandler.Builder.retryOn" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.retryOn" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.abortOn*" + name: "abortOn" + nameWithType: "ExceptionHandler.Builder.abortOn" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.abortOn" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler" +- uid: "com.microsoft.samples.ExceptionHandler.Builder.build*" + name: "build" + nameWithType: "ExceptionHandler.Builder.build" + fullName: "com.microsoft.samples.ExceptionHandler.Builder.build" + package: "com.microsoft.samples" +- 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: "java.lang.Class" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html" + name: "Class" + nameWithType: "Class" + fullName: "java.lang.Class" +- uid: "? extends java.lang.Exception>[]" + name: "? extends Exception>[]" + nameWithType: "? extends Exception>[]" + fullName: "? extends java.lang.Exception>[]" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml new file mode 100644 index 00000000..1bf26120 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.yml @@ -0,0 +1,276 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + id: "RetryResult" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(java.lang.String)" + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + langs: + - "java" + name: "ExceptionHandler.Interceptor.RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + type: "Enum" + package: "com.microsoft.samples" + syntax: + content: "public enum ExceptionHandler.Interceptor.RetryResult extends Enum" + inheritance: + - "java.lang.Object" + - "java.lang.Enum" + inheritedMembers: + - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" + - "java.lang.Enum.clone()" + - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" + - "java.lang.Enum.equals(java.lang.Object)" + - "java.lang.Enum.finalize()" + - "java.lang.Enum.getDeclaringClass()" + - "java.lang.Enum.hashCode()" + - "java.lang.Enum.name()" + - "java.lang.Enum.ordinal()" + - "java.lang.Enum.toString()" + - "java.lang.Object.getClass()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" + javaType: "exception" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + id: "CONTINUE_EVALUATION" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "CONTINUE_EVALUATION" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.CONTINUE_EVALUATION" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult CONTINUE_EVALUATION" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + javaType: "static field" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + id: "NO_RETRY" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "NO_RETRY" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.NO_RETRY" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult NO_RETRY" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + javaType: "static field" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + id: "RETRY" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "RETRY" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RETRY" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RETRY" + type: "Field" + package: "com.microsoft.samples" + syntax: + content: "public static final ExceptionHandler.Interceptor.RetryResult RETRY" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + javaType: "static field" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult()" + id: "RetryResult()" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "RetryResult()" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RetryResult()" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult()" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private RetryResult()" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(java.lang.String)" + id: "valueOf(java.lang.String)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "valueOf(String name)" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.valueOf(String name)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf(String name)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Interceptor.RetryResult valueOf(String name)" + parameters: + - id: "name" + type: "java.lang.String" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + javaType: "static method" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + id: "values()" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + langs: + - "java" + name: "values()" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.values()" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values()" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Interceptor.RetryResult[] values()" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult[]" + javaType: "static method" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult*" + name: "RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.RetryResult" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult[]" + spec.java: + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + isExternal: false + - name: "[]" + fullName: "[]" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values*" + name: "values" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.values" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.values" + package: "com.microsoft.samples" +- uid: "java.lang.String" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf*" + name: "valueOf" + nameWithType: "ExceptionHandler.Interceptor.RetryResult.valueOf" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult.valueOf" + package: "com.microsoft.samples" +- uid: "java.lang.Enum" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html" + name: "Enum" + nameWithType: "Enum" + fullName: "java.lang.Enum" +- 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.Enum.toString()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#toString--" + name: "Enum.toString()" + nameWithType: "Enum.toString()" + fullName: "java.lang.Enum.toString()" +- 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.Enum.clone()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#clone--" + name: "Enum.clone()" + nameWithType: "Enum.clone()" + fullName: "java.lang.Enum.clone()" +- uid: "java.lang.Enum.finalize()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#finalize--" + name: "Enum.finalize()" + nameWithType: "Enum.finalize()" + fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" +- 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.Enum.compareTo(E)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#compareTo-E-" + name: "Enum.compareTo(E)" + nameWithType: "Enum.compareTo(E)" + fullName: "java.lang.Enum.compareTo(E)" +- uid: "java.lang.Enum.name()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#name--" + name: "Enum.name()" + nameWithType: "Enum.name()" + fullName: "java.lang.Enum.name()" +- uid: "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#valueOf-java.lang.Class-java.lang.String-" + name: "Enum.valueOf(Class,String)" + nameWithType: "Enum.valueOf(Class,String)" + fullName: "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" +- 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.Enum.getDeclaringClass()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#getDeclaringClass--" + name: "Enum.getDeclaringClass()" + nameWithType: "Enum.getDeclaringClass()" + fullName: "java.lang.Enum.getDeclaringClass()" +- 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.Enum.ordinal()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#ordinal--" + name: "Enum.ordinal()" + nameWithType: "Enum.ordinal()" + fullName: "java.lang.Enum.ordinal()" +- uid: "java.lang.Enum.hashCode()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#hashCode--" + name: "Enum.hashCode()" + nameWithType: "Enum.hashCode()" + fullName: "java.lang.Enum.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.Enum.equals(java.lang.Object)" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#equals-java.lang.Object-" + name: "Enum.equals(Object)" + nameWithType: "Enum.equals(Object)" + fullName: "java.lang.Enum.equals(java.lang.Object)" +- uid: "java.lang.Enum" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html" + name: "Enum" + nameWithType: "Enum" + fullName: "java.lang.Enum" +- uid: "java.lang.Enum." + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum/.html" + name: "Enum." + nameWithType: "Enum." + fullName: "java.lang.Enum." +- uid: "T>,java.lang.String)" + name: "T>,String)" + nameWithType: "T>,String)" + fullName: "T>,java.lang.String)" +- uid: "T>valueOf(java.lang.Class" + name: "T>valueOf(Class" + nameWithType: "T>valueOf(Class" + fullName: "T>valueOf(java.lang.Class" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml new file mode 100644 index 00000000..3fdd3ed2 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.Interceptor.yml @@ -0,0 +1,93 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + id: "Interceptor" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + - "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + - "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(java.lang.Exception)" + langs: + - "java" + name: "ExceptionHandler.Interceptor" + nameWithType: "ExceptionHandler.Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" + type: "Interface" + package: "com.microsoft.samples" + syntax: + content: "public static interface ExceptionHandler.Interceptor extends Serializable" + implements: + - "java.io.Serializable" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + id: "afterEval(java.lang.Exception,com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor" + langs: + - "java" + name: "afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + nameWithType: "ExceptionHandler.Interceptor.afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval*" + type: "Method" + package: "com.microsoft.samples" + summary: "This method is called after the evaluation and could alter its result." + syntax: + content: "public abstract ExceptionHandler.Interceptor.RetryResult afterEval(Exception exception, ExceptionHandler.Interceptor.RetryResult retryResult)" + parameters: + - id: "exception" + type: "java.lang.Exception" + description: "the exception that is being evaluated" + - id: "retryResult" + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "the result of the evaluation so far" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "RetryResult to indicate if the exception should be ignored ( RetryResult#RETRY), propagated (RetryResult#NO_RETRY), or evaluation should\n proceed (RetryResult#CONTINUE_EVALUATION)." +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(java.lang.Exception)" + id: "beforeEval(java.lang.Exception)" + parent: "com.microsoft.samples.ExceptionHandler.Interceptor" + langs: + - "java" + name: "beforeEval(Exception exception)" + nameWithType: "ExceptionHandler.Interceptor.beforeEval(Exception exception)" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval(Exception exception)" + overload: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval*" + type: "Method" + package: "com.microsoft.samples" + summary: "This method is called before exception evaluation and could short-circuit the process." + syntax: + content: "public abstract ExceptionHandler.Interceptor.RetryResult beforeEval(Exception exception)" + parameters: + - id: "exception" + type: "java.lang.Exception" + description: "the exception that is being evaluated" + return: + type: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + description: "RetryResult to indicate if the exception should be ignored ( RetryResult#RETRY), propagated (RetryResult#NO_RETRY), or evaluation should\n proceed (RetryResult#CONTINUE_EVALUATION)." +references: +- uid: "java.lang.Exception" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html" + spec.java: + - uid: "java.lang.Exception" + name: "Exception" + fullName: "java.lang.Exception" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "ExceptionHandler.Interceptor.RetryResult" + nameWithType: "ExceptionHandler.Interceptor.RetryResult" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval*" + name: "beforeEval" + nameWithType: "ExceptionHandler.Interceptor.beforeEval" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.beforeEval" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval*" + name: "afterEval" + nameWithType: "ExceptionHandler.Interceptor.afterEval" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor.afterEval" + package: "com.microsoft.samples" +- uid: "java.io.Serializable" + href: "https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" + name: "Serializable" + nameWithType: "Serializable" + fullName: "java.io.Serializable" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml new file mode 100644 index 00000000..3216fbfd --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.ExceptionHandler.yml @@ -0,0 +1,319 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.ExceptionHandler" + id: "ExceptionHandler" + parent: "com.microsoft.samples" + children: + - "com.microsoft.samples.ExceptionHandler.Builder" + - "com.microsoft.samples.ExceptionHandler.Interceptor" + - "com.microsoft.samples.ExceptionHandler.createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + - "com.microsoft.samples.ExceptionHandler.equals(java.lang.Object)" + - "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + - "com.microsoft.samples.ExceptionHandler.hashCode()" + - "com.microsoft.samples.ExceptionHandler.newBuilder()" + - "com.microsoft.samples.ExceptionHandler.shouldRetry(java.lang.Throwable,java.lang.Object)" + langs: + - "java" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler" + type: "Class" + package: "com.microsoft.samples" + summary: "Exception retry algorithm implementation used by RetryHelper." + syntax: + content: "public final class ExceptionHandler implements ResultRetryAlgorithm, Serializable" + inheritance: + - "java.lang.Object" + implements: + - "com.google.api.gax.retrying.ResultRetryAlgorithm" + - "java.io.Serializable" + 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)" + status: "beta" +- uid: "com.microsoft.samples.ExceptionHandler.ExceptionHandler(com.microsoft.samples.ExceptionHandler.Builder)" + id: "ExceptionHandler(com.microsoft.samples.ExceptionHandler.Builder)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "ExceptionHandler(ExceptionHandler.Builder builder)" + nameWithType: "ExceptionHandler.ExceptionHandler(ExceptionHandler.Builder builder)" + fullName: "com.microsoft.samples.ExceptionHandler.ExceptionHandler(ExceptionHandler.Builder builder)" + overload: "com.microsoft.samples.ExceptionHandler.ExceptionHandler*" + type: "Constructor" + package: "com.microsoft.samples" + syntax: + content: "private ExceptionHandler(ExceptionHandler.Builder builder)" + parameters: + - id: "builder" + type: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + id: "createNextAttempt(java.lang.Throwable,java.lang.Object,com.google.api.gax.retrying.TimedAttemptSettings)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + nameWithType: "ExceptionHandler.createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + fullName: "com.microsoft.samples.ExceptionHandler.createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + overload: "com.microsoft.samples.ExceptionHandler.createNextAttempt*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, Object prevResponse, TimedAttemptSettings prevSettings)" + parameters: + - id: "prevThrowable" + type: "java.lang.Throwable" + - id: "prevResponse" + type: "java.lang.Object" + - id: "prevSettings" + type: "com.google.api.gax.retrying.TimedAttemptSettings" + return: + type: "com.google.api.gax.retrying.TimedAttemptSettings" +- uid: "com.microsoft.samples.ExceptionHandler.equals(java.lang.Object)" + id: "equals(java.lang.Object)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "equals(Object obj)" + nameWithType: "ExceptionHandler.equals(Object obj)" + fullName: "com.microsoft.samples.ExceptionHandler.equals(Object obj)" + overload: "com.microsoft.samples.ExceptionHandler.equals*" + overridden: "java.lang.Object.equals(java.lang.Object)" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public boolean equals(Object obj)" + parameters: + - id: "obj" + type: "java.lang.Object" + return: + type: "boolean" +- uid: "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + id: "getDefaultInstance()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "getDefaultInstance()" + nameWithType: "ExceptionHandler.getDefaultInstance()" + fullName: "com.microsoft.samples.ExceptionHandler.getDefaultInstance()" + overload: "com.microsoft.samples.ExceptionHandler.getDefaultInstance*" + type: "Method" + package: "com.microsoft.samples" + summary: "Returns an instance which retry any checked exception and abort on any runtime exception." + syntax: + content: "public static ExceptionHandler getDefaultInstance()" + return: + type: "com.microsoft.samples.ExceptionHandler" + javaType: "static method" +- uid: "com.microsoft.samples.ExceptionHandler.hashCode()" + id: "hashCode()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "hashCode()" + nameWithType: "ExceptionHandler.hashCode()" + fullName: "com.microsoft.samples.ExceptionHandler.hashCode()" + overload: "com.microsoft.samples.ExceptionHandler.hashCode*" + overridden: "java.lang.Object.hashCode()" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public int hashCode()" + return: + type: "int" +- uid: "com.microsoft.samples.ExceptionHandler.newBuilder()" + id: "newBuilder()" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "newBuilder()" + nameWithType: "ExceptionHandler.newBuilder()" + fullName: "com.microsoft.samples.ExceptionHandler.newBuilder()" + overload: "com.microsoft.samples.ExceptionHandler.newBuilder*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public static ExceptionHandler.Builder newBuilder()" + return: + type: "com.microsoft.samples.ExceptionHandler.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.ExceptionHandler.shouldRetry(java.lang.Throwable,java.lang.Object)" + id: "shouldRetry(java.lang.Throwable,java.lang.Object)" + parent: "com.microsoft.samples.ExceptionHandler" + langs: + - "java" + name: "shouldRetry(Throwable prevThrowable, Object prevResponse)" + nameWithType: "ExceptionHandler.shouldRetry(Throwable prevThrowable, Object prevResponse)" + fullName: "com.microsoft.samples.ExceptionHandler.shouldRetry(Throwable prevThrowable, Object prevResponse)" + overload: "com.microsoft.samples.ExceptionHandler.shouldRetry*" + type: "Method" + package: "com.microsoft.samples" + syntax: + content: "public boolean shouldRetry(Throwable prevThrowable, Object prevResponse)" + parameters: + - id: "prevThrowable" + type: "java.lang.Throwable" + - id: "prevResponse" + type: "java.lang.Object" + return: + type: "boolean" +references: +- uid: "com.microsoft.samples.ExceptionHandler.Builder" + name: "ExceptionHandler.Builder" + nameWithType: "ExceptionHandler.Builder" + fullName: "com.microsoft.samples.ExceptionHandler.Builder" +- uid: "com.microsoft.samples.ExceptionHandler.ExceptionHandler*" + name: "ExceptionHandler" + nameWithType: "ExceptionHandler.ExceptionHandler" + fullName: "com.microsoft.samples.ExceptionHandler.ExceptionHandler" + package: "com.microsoft.samples" +- uid: "java.lang.Throwable" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" + spec.java: + - uid: "java.lang.Throwable" + name: "Throwable" + fullName: "java.lang.Throwable" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html" +- uid: "java.lang.Object" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" + spec.java: + - uid: "java.lang.Object" + name: "Object" + fullName: "java.lang.Object" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" +- 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.ExceptionHandler.shouldRetry*" + name: "shouldRetry" + nameWithType: "ExceptionHandler.shouldRetry" + fullName: "com.microsoft.samples.ExceptionHandler.shouldRetry" + package: "com.microsoft.samples" +- uid: "com.google.api.gax.retrying.TimedAttemptSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.retrying.TimedAttemptSettings" + name: "TimedAttemptSettings" + fullName: "com.google.api.gax.retrying.TimedAttemptSettings" + isExternal: true +- uid: "com.microsoft.samples.ExceptionHandler.createNextAttempt*" + name: "createNextAttempt" + nameWithType: "ExceptionHandler.createNextAttempt" + fullName: "com.microsoft.samples.ExceptionHandler.createNextAttempt" + package: "com.microsoft.samples" +- uid: "int" + href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" + spec.java: + - uid: "int" + name: "int" + fullName: "int" + isExternal: false +- uid: "com.microsoft.samples.ExceptionHandler.hashCode*" + name: "hashCode" + nameWithType: "ExceptionHandler.hashCode" + fullName: "com.microsoft.samples.ExceptionHandler.hashCode" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.equals*" + name: "equals" + nameWithType: "ExceptionHandler.equals" + fullName: "com.microsoft.samples.ExceptionHandler.equals" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.getDefaultInstance*" + name: "getDefaultInstance" + nameWithType: "ExceptionHandler.getDefaultInstance" + fullName: "com.microsoft.samples.ExceptionHandler.getDefaultInstance" + package: "com.microsoft.samples" +- uid: "com.microsoft.samples.ExceptionHandler.newBuilder*" + name: "newBuilder" + nameWithType: "ExceptionHandler.newBuilder" + fullName: "com.microsoft.samples.ExceptionHandler.newBuilder" + package: "com.microsoft.samples" +- uid: "com.google.api.gax.retrying.ResultRetryAlgorithm" + isExternal: true + name: "ResultRetryAlgorithm" + nameWithType: "ResultRetryAlgorithm" + fullName: "com.google.api.gax.retrying.ResultRetryAlgorithm" +- uid: "java.io.Serializable" + href: "https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html" + name: "Serializable" + nameWithType: "Serializable" + fullName: "java.io.Serializable" +- 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.microsoft.samples.ExceptionHandler.Interceptor" + name: "ExceptionHandler.Interceptor" + nameWithType: "ExceptionHandler.Interceptor" + fullName: "com.microsoft.samples.ExceptionHandler.Interceptor" +- uid: "com.google.api.gax.retrying.ResultRetryAlgorithm" + isExternal: true + name: "ResultRetryAlgorithm" + nameWithType: "ResultRetryAlgorithm" + fullName: "com.google.api.gax.retrying.ResultRetryAlgorithm" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.IPartner.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.IPartner.yml index 9bae6eeb..f225f621 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.IPartner.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.IPartner.yml @@ -12,7 +12,7 @@ items: fullName: "com.microsoft.samples.IPartner" type: "Interface" package: "com.microsoft.samples" - summary: "The main entry point into using the partner SDK functionality. Represents a partner and encapsulates all the behavior\n attached to partners. Use this interface to get to the partner's customers, profiles, and customer orders, profiles\n and subscriptions and more." + summary: "The main entry point into using the partner SDK functionality. Represents a partner and\n encapsulates all the behavior attached to partners. Use this interface to get to the partner's\n customers, profiles, and customer orders, profiles and subscriptions and more." syntax: content: "public interface IPartner" - uid: "com.microsoft.samples.IPartner.getCredentials()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.Subpackage(class).yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.Subpackage.yml similarity index 100% rename from third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.Subpackage(class).yml rename to third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.Subpackage.yml diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml index 543bfec2..c86e4904 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.SuperHero.yml @@ -158,12 +158,12 @@ items: overridden: "com.microsoft.samples.subpackage.Person.getLastName()" type: "Method" package: "com.microsoft.samples" - summary: "Get capitalized last name. But it's not the end,\n because of multiline comment" + summary: "Get capitalized last name. But it's not the end, because we add a lot of text to make this a\n multiline comment" syntax: content: "public String getLastName()" return: type: "java.lang.String" - description: "lastName in uppercase. But it's not the end,\n because of multiline comment" + description: "lastName in uppercase. But it's not the end, because we add a lot of text to make this\n a multiline comment" - uid: "com.microsoft.samples.SuperHero.getUniquePower()" id: "getUniquePower()" parent: "com.microsoft.samples.SuperHero" @@ -254,7 +254,7 @@ items: overload: "com.microsoft.samples.SuperHero.successfullyAttacked*" type: "Method" package: "com.microsoft.samples" - summary: "

(deprecated) As of version 1.1, use . . . instead

\n

This is a simple description of the method. . .\n Superman!\n

" + summary: "\nDeprecated. As of version 1.1, use . . . instead\n\nThis is a simple description of the method. . . Superman!\nSee Also: HERO-402\n" syntax: content: "public int successfullyAttacked(int incomingDamage, String damageType)" parameters: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.yml index 22c01beb..2ce93c0d 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.yml @@ -13,7 +13,7 @@ items: fullName: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" type: "Class" package: "com.microsoft.samples.agreements" - summary: "

(deprecated) Use AgreementMetaData instead.

\nAgreement details collection operations implementation class." + summary: "\nDeprecated. Use AgreementMetaData instead.\n\nAgreement details collection operations implementation class." syntax: content: "public class AgreementDetailsCollectionOperations extends BasePartnerComponentString implements IAgreementDetailsCollection" inheritance: @@ -66,7 +66,7 @@ items: overload: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.get*" type: "Method" package: "com.microsoft.samples.agreements" - summary: "

(deprecated) Some text

\nRetrieves the agreement details." + summary: "\nDeprecated. Some text\n\nRetrieves the agreement details." syntax: content: "public ResourceCollection get()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementMetaData.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementMetaData.yml index 50cdfb1e..6dc7f8cd 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementMetaData.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.AgreementMetaData.yml @@ -18,7 +18,7 @@ items: fullName: "com.microsoft.samples.agreements.AgreementMetaData" type: "Class" package: "com.microsoft.samples.agreements" - summary: "The AgreementMetaData provides metadata about the agreement type\n that partner can provide confirmation of customer acceptance." + summary: "The AgreementMetaData provides metadata about the agreement type that partner can provide\n confirmation of customer acceptance." syntax: content: "public class AgreementMetaData" inheritance: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.IAgreementDetailsCollection.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.IAgreementDetailsCollection.yml index 8afb653a..088a3262 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.IAgreementDetailsCollection.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.IAgreementDetailsCollection.yml @@ -12,7 +12,7 @@ items: fullName: "com.microsoft.samples.agreements.IAgreementDetailsCollection" type: "Interface" package: "com.microsoft.samples.agreements" - summary: "

(deprecated) This one is deprecated :(

\nEncapsulates the operations on the agreement metadata collection." + summary: "\nDeprecated. This one is deprecated :(\n\nEncapsulates the operations on the agreement metadata collection." syntax: content: "public interface IAgreementDetailsCollection" status: "deprecated" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.ResourceCollection.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.ResourceCollection.yml index 59cea190..80f3dd10 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.ResourceCollection.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.ResourceCollection.yml @@ -12,7 +12,7 @@ items: fullName: "com.microsoft.samples.agreements.ResourceCollection" type: "Class" package: "com.microsoft.samples.agreements" - summary: "Contains a collection of resources with JSON properties to represent the output Type of objects in collection" + summary: "Contains a collection of resources with JSON properties to represent the output Type of objects\n in collection" syntax: content: "public class ResourceCollection" typeParameters: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.md new file mode 100644 index 00000000..fd7cbe5c --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.md @@ -0,0 +1,59 @@ +# Package com.microsoft.samples.agreements (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Classes + + + + + + + + + + + + + + + + +
+Class +Description
com.microsoft.samples.agreements.AgreementDetailsCollectionOperations + +Deprecated. Use AgreementMetaData instead. + +Agreement details collection operations implementation class.
com.microsoft.samples.agreements.AgreementMetaData +The AgreementMetaData provides metadata about the agreement type that partner can provide + confirmation of customer acceptance.
com.microsoft.samples.agreements.ResourceCollection +Contains a collection of resources with JSON properties to represent the output Type of objects + in collection
+ +## Interfaces + + + + + + + + +
+Interface +Description
com.microsoft.samples.agreements.IAgreementDetailsCollection + +Deprecated. This one is deprecated :( + +Encapsulates the operations on the agreement metadata collection.
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.yml deleted file mode 100644 index ba14b3a2..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.agreements.yml +++ /dev/null @@ -1,34 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.agreements" - id: "agreements" - children: - - "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" - - "com.microsoft.samples.agreements.AgreementMetaData" - - "com.microsoft.samples.agreements.IAgreementDetailsCollection" - - "com.microsoft.samples.agreements.ResourceCollection" - langs: - - "java" - name: "com.microsoft.samples.agreements" - nameWithType: "com.microsoft.samples.agreements" - fullName: "com.microsoft.samples.agreements" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.agreements" -references: -- uid: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" - name: "AgreementDetailsCollectionOperations" - nameWithType: "AgreementDetailsCollectionOperations" - fullName: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" -- uid: "com.microsoft.samples.agreements.AgreementMetaData" - name: "AgreementMetaData" - nameWithType: "AgreementMetaData" - fullName: "com.microsoft.samples.agreements.AgreementMetaData" -- uid: "com.microsoft.samples.agreements.IAgreementDetailsCollection" - name: "IAgreementDetailsCollection" - nameWithType: "IAgreementDetailsCollection" - fullName: "com.microsoft.samples.agreements.IAgreementDetailsCollection" -- uid: "com.microsoft.samples.agreements.ResourceCollection" - name: "ResourceCollection" - nameWithType: "ResourceCollection" - fullName: "com.microsoft.samples.agreements.ResourceCollection" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml index b3a2d5c4..4ded03b4 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Animal.yml @@ -87,7 +87,7 @@ items: overload: "com.microsoft.samples.commentinheritance.Animal.getKind*" type: "Method" package: "com.microsoft.samples.commentinheritance" - summary: "Get kind from Organism.\n Get kind from Animal." + summary: "Get kind from Organism. Get kind from Animal." syntax: content: "public abstract String getKind()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml index 169cf75c..91c05db5 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Dog.yml @@ -138,7 +138,7 @@ items: overridden: "com.microsoft.samples.commentinheritance.Mammal.getKind()" type: "Method" package: "com.microsoft.samples.commentinheritance" - summary: "Get kind from Organism.\n Get kind from Animal.\n Get kind from Mammal.\n Get kind from Dog." + summary: "Get kind from Organism. Get kind from Animal. Get kind from Mammal. Get kind from Dog." syntax: content: "public String getKind()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml index 82c30c40..16d78013 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Mammal.yml @@ -60,7 +60,7 @@ items: overridden: "com.microsoft.samples.commentinheritance.Animal.getKind()" type: "Method" package: "com.microsoft.samples.commentinheritance" - summary: "Get kind from Organism.\n Get kind from Animal.\n Get kind from Mammal." + summary: "Get kind from Organism. Get kind from Animal. Get kind from Mammal." syntax: content: "public abstract String getKind()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml index 7dc54473..87bc961b 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.Omnivorous.yml @@ -65,7 +65,7 @@ items: overload: "com.microsoft.samples.commentinheritance.Omnivorous.getKind*" type: "Method" package: "com.microsoft.samples.commentinheritance" - summary: "Get kind from Carnivorous.\n Get kind from Omnivorous." + summary: "Get kind from Carnivorous. Get kind from Omnivorous." syntax: content: "public abstract String getKind()" return: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md new file mode 100644 index 00000000..91cfe392 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.md @@ -0,0 +1,76 @@ +# Package com.microsoft.samples.commentinheritance (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Classes + + + + + + + + + + + + + + + + + + + + +
+Class +Description
com.microsoft.samples.commentinheritance.Animal +Animal.
com.microsoft.samples.commentinheritance.Dog +Canine and man's best friend.
com.microsoft.samples.commentinheritance.Herbivorous.Plant +
com.microsoft.samples.commentinheritance.Mammal +Mammal.
+ +## Interfaces + + + + + + + + + + + + + + + + + + + + + + + + +
+Interface +Description
com.microsoft.samples.commentinheritance.Carnivorous +Marks an Animal that eats other animals.
com.microsoft.samples.commentinheritance.Herbivorous +Marks animals that eat plants.
com.microsoft.samples.commentinheritance.Omnivorous +Eats plants and animals.
com.microsoft.samples.commentinheritance.Organism +
com.microsoft.samples.commentinheritance.Viviparous +Mammals that give birth to young that develop within the mother's body.
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml deleted file mode 100644 index 5842c9d6..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.commentinheritance.yml +++ /dev/null @@ -1,59 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.commentinheritance" - id: "commentinheritance" - children: - - "com.microsoft.samples.commentinheritance.Animal" - - "com.microsoft.samples.commentinheritance.Carnivorous" - - "com.microsoft.samples.commentinheritance.Dog" - - "com.microsoft.samples.commentinheritance.Herbivorous" - - "com.microsoft.samples.commentinheritance.Herbivorous.Plant" - - "com.microsoft.samples.commentinheritance.Mammal" - - "com.microsoft.samples.commentinheritance.Omnivorous" - - "com.microsoft.samples.commentinheritance.Organism" - - "com.microsoft.samples.commentinheritance.Viviparous" - langs: - - "java" - name: "com.microsoft.samples.commentinheritance" - nameWithType: "com.microsoft.samples.commentinheritance" - fullName: "com.microsoft.samples.commentinheritance" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.commentinheritance" -references: -- uid: "com.microsoft.samples.commentinheritance.Animal" - name: "Animal" - nameWithType: "Animal" - fullName: "com.microsoft.samples.commentinheritance.Animal" -- uid: "com.microsoft.samples.commentinheritance.Carnivorous" - name: "Carnivorous" - nameWithType: "Carnivorous" - fullName: "com.microsoft.samples.commentinheritance.Carnivorous" -- uid: "com.microsoft.samples.commentinheritance.Dog" - name: "Dog" - nameWithType: "Dog" - fullName: "com.microsoft.samples.commentinheritance.Dog" -- uid: "com.microsoft.samples.commentinheritance.Herbivorous" - name: "Herbivorous" - nameWithType: "Herbivorous" - fullName: "com.microsoft.samples.commentinheritance.Herbivorous" -- uid: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" - name: "Herbivorous.Plant" - nameWithType: "Herbivorous.Plant" - fullName: "com.microsoft.samples.commentinheritance.Herbivorous.Plant" -- uid: "com.microsoft.samples.commentinheritance.Mammal" - name: "Mammal" - nameWithType: "Mammal" - fullName: "com.microsoft.samples.commentinheritance.Mammal" -- uid: "com.microsoft.samples.commentinheritance.Omnivorous" - name: "Omnivorous" - nameWithType: "Omnivorous" - fullName: "com.microsoft.samples.commentinheritance.Omnivorous" -- uid: "com.microsoft.samples.commentinheritance.Organism" - name: "Organism" - nameWithType: "Organism" - fullName: "com.microsoft.samples.commentinheritance.Organism" -- uid: "com.microsoft.samples.commentinheritance.Viviparous" - name: "Viviparous" - nameWithType: "Viviparous" - fullName: "com.microsoft.samples.commentinheritance.Viviparous" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.BetaApi.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.BetaApi.yml index b4c65868..b282baea 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.BetaApi.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.BetaApi.yml @@ -12,11 +12,13 @@ items: fullName: "com.microsoft.samples.google.BetaApi" type: "Interface" package: "com.microsoft.samples.google" - summary: "Indicates a public API that can change at any time, and has no guarantee of API stability and\n backward-compatibility.\n\n

\n Usage guidelines:\n

    \n
  1. This annotation is used only on APIs with public visibility. Internal interfaces should not\n use it.
  2. \n
  3. This annotation should only be added to new APIs. Adding it to an existing API is considered\n API-breaking.
  4. \n
  5. Removing this annotation from an API gives it stable status, assuming the API doesn't have\n other annotations denoting instability.\n
" + summary: "Indicates a public API that can change at any time, and has no guarantee of API stability and\n backward-compatibility.\n\n

Usage guidelines:\n\n

    \n
  1. This annotation is used only on APIs with public visibility. Internal interfaces should not\n use it.\n
  2. This annotation should only be added to new APIs. Adding it to an existing API is\n considered API-breaking.\n
  3. Removing this annotation from an API gives it stable status, assuming the API doesn't have\n other annotations denoting instability.\n
" syntax: content: "public interface BetaApi implements Annotation" implements: - "java.lang.annotation.Annotation" + status: "beta" + javaType: "annotationtype" - uid: "com.microsoft.samples.google.BetaApi.value()" id: "value()" parent: "com.microsoft.samples.google.BetaApi" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.Builder.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.Builder.yml index 1f691bf3..f72252ed 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.Builder.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.Builder.yml @@ -53,6 +53,7 @@ items: - "com.google.api.gax.rpc.ClientSettings.Builder.getCredentialsProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getEndpoint()" - "com.google.api.gax.rpc.ClientSettings.Builder.getExecutorProvider()" + - "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" - "com.google.api.gax.rpc.ClientSettings.Builder.getHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getInternalHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getQuotaProjectId()" @@ -66,10 +67,12 @@ items: - "com.google.api.gax.rpc.ClientSettings.Builder.setCredentialsProvider(com.google.api.gax.core.CredentialsProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setEndpoint(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + - "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setInternalHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setQuotaProjectId(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setTransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider)" + - "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setWatchdogCheckInterval(org.threeten.bp.Duration)" - "com.google.api.gax.rpc.ClientSettings.Builder.setWatchdogProvider(com.google.api.gax.rpc.WatchdogProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.toString()" @@ -1331,6 +1334,11 @@ references: name: "Object.wait(long,int)" nameWithType: "Object.wait(long,int)" fullName: "java.lang.Object.wait(long,int)" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" + isExternal: true + name: "ClientSettings.Builder.setGdchApiAudience(String)" + nameWithType: "ClientSettings.Builder.setGdchApiAudience(String)" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.toString()" isExternal: true name: "ClientSettings.Builder.toString()" @@ -1401,6 +1409,11 @@ references: name: "ClientSettings.Builder.setQuotaProjectId(String)" nameWithType: "ClientSettings.Builder.setQuotaProjectId(String)" fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setQuotaProjectId(java.lang.String)" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" + isExternal: true + name: "ClientSettings.Builder.setUniverseDomain(String)" + nameWithType: "ClientSettings.Builder.setUniverseDomain(String)" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.getCredentialsProvider()" isExternal: true name: "ClientSettings.Builder.getCredentialsProvider()" @@ -1431,6 +1444,11 @@ references: name: "ClientSettings.Builder.getTransportChannelProvider()" nameWithType: "ClientSettings.Builder.getTransportChannelProvider()" fullName: "com.google.api.gax.rpc.ClientSettings.Builder.getTransportChannelProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" + isExternal: true + name: "ClientSettings.Builder.getGdchApiAudience()" + nameWithType: "ClientSettings.Builder.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.getEndpoint()" isExternal: true name: "ClientSettings.Builder.getEndpoint()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.yml index 06c92b5d..8087c567 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ProductSearchSettings.yml @@ -45,7 +45,7 @@ items: fullName: "com.microsoft.samples.google.ProductSearchSettings" type: "Class" package: "com.microsoft.samples.google" - summary: "Settings class to configure an instance of ProductSearchClient.\n\n

The default instance has everything set to sensible defaults:\n\n

    \n
  • The default service address (vision.googleapis.com) and default port (443) are used.\n
  • Credentials are acquired automatically through Application Default Credentials.\n
  • Retries are configured for idempotent methods but not for non-idempotent methods.\n
\n\n

The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n

For example, to set the total timeout of createProductSet to 30 seconds:\n\n

\n ProductSearchSettings.Builder productSearchSettingsBuilder = ProductSearchSettings.newBuilder();\n productSearchSettingsBuilder\n     .createProductSetSettings()\n     .setRetrySettings(\n         productSearchSettingsBuilder\n             .createProductSetSettings()\n             .getRetrySettings()\n             .toBuilder()\n             .setTotalTimeout(Duration.ofSeconds(30))\n             .build());\n ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();\n 
" + summary: "Settings class to configure an instance of ProductSearchClient.\n\n

The default instance has everything set to sensible defaults:\n\n

    \n
  • The default service address (vision.googleapis.com) and default port (443) are used.\n
  • Credentials are acquired automatically through Application Default Credentials.\n
  • Retries are configured for idempotent methods but not for non-idempotent methods.\n
\n\n

The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n

For example, to set the total timeout of createProductSet to 30 seconds:\n\n

\n ProductSearchSettings.Builder productSearchSettingsBuilder = ProductSearchSettings.newBuilder();\n productSearchSettingsBuilder\n     .createProductSetSettings()\n     .setRetrySettings(\n         productSearchSettingsBuilder\n             .createProductSetSettings()\n             .getRetrySettings()\n             .toBuilder()\n             .setTotalTimeout(Duration.ofSeconds(30))\n             .build());\n ProductSearchSettings productSearchSettings = productSearchSettingsBuilder.build();\n 
" syntax: content: "public class ProductSearchSettings extends ClientSettings" inheritance: @@ -58,11 +58,13 @@ items: - "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - "com.google.api.gax.rpc.ClientSettings.getEndpoint()" - "com.google.api.gax.rpc.ClientSettings.getExecutorProvider()" + - "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" - "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" - "com.google.api.gax.rpc.ClientSettings.getStubSettings()" - "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" + - "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" - "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" - "com.google.api.gax.rpc.ClientSettings.getWatchdogProvider()" - "com.google.api.gax.rpc.ClientSettings.toString()" @@ -128,6 +130,7 @@ items: type: "com.microsoft.samples.google.ProductSearchSettings" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.createProductSetSettings()" id: "createProductSetSettings()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -187,10 +190,13 @@ items: overload: "com.microsoft.samples.google.ProductSearchSettings.defaultApiClientHeaderProviderBuilder*" type: "Method" package: "com.microsoft.samples.google" + summary: "\n" syntax: content: "public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()" return: type: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + status: "beta" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.defaultCredentialsProviderBuilder()" id: "defaultCredentialsProviderBuilder()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -207,6 +213,7 @@ items: content: "public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()" return: type: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.defaultExecutorProviderBuilder()" id: "defaultExecutorProviderBuilder()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -223,6 +230,7 @@ items: content: "public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()" return: type: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.defaultGrpcTransportProviderBuilder()" id: "defaultGrpcTransportProviderBuilder()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -239,6 +247,7 @@ items: content: "public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()" return: type: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.defaultTransportChannelProvider()" id: "defaultTransportChannelProvider()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -254,6 +263,7 @@ items: content: "public static TransportChannelProvider defaultTransportChannelProvider()" return: type: "com.google.api.gax.rpc.TransportChannelProvider" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.deleteProductSetSettings()" id: "deleteProductSetSettings()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -318,6 +328,7 @@ items: content: "public static String getDefaultEndpoint()" return: type: "java.lang.String" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.getDefaultServiceScopes()" id: "getDefaultServiceScopes()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -334,6 +345,7 @@ items: content: "public static List getDefaultServiceScopes()" return: type: "java.util.List" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.getProductSetSettings()" id: "getProductSetSettings()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -494,6 +506,7 @@ items: content: "public static ProductSearchSettings.Builder newBuilder()" return: type: "com.microsoft.samples.google.ProductSearchSettings.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.newBuilder(com.google.api.gax.rpc.ClientContext)" id: "newBuilder(com.google.api.gax.rpc.ClientContext)" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -513,6 +526,7 @@ items: type: "com.google.api.gax.rpc.ClientContext" return: type: "com.microsoft.samples.google.ProductSearchSettings.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.ProductSearchSettings.purgeProductsOperationSettings()" id: "purgeProductsOperationSettings()" parent: "com.microsoft.samples.google.ProductSearchSettings" @@ -1409,21 +1423,6 @@ references: name: "ClientSettings" nameWithType: "ClientSettings" fullName: "com.google.api.gax.rpc.ClientSettings" -- uid: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" - isExternal: true - name: "ClientSettings.getHeaderProvider()" - nameWithType: "ClientSettings.getHeaderProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" -- uid: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" - isExternal: true - name: "ClientSettings.getQuotaProjectId()" - nameWithType: "ClientSettings.getQuotaProjectId()" - fullName: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" -- 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()" @@ -1439,56 +1438,26 @@ references: name: "ClientSettings.getWatchdogProvider()" nameWithType: "ClientSettings.getWatchdogProvider()" fullName: "com.google.api.gax.rpc.ClientSettings.getWatchdogProvider()" -- 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.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: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - isExternal: true - name: "ClientSettings.getCredentialsProvider()" - nameWithType: "ClientSettings.getCredentialsProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getStubSettings()" isExternal: true name: "ClientSettings.getStubSettings()" nameWithType: "ClientSettings.getStubSettings()" fullName: "com.google.api.gax.rpc.ClientSettings.getStubSettings()" -- uid: "com.google.api.gax.rpc.ClientSettings.toBuilder()" - isExternal: true - name: "ClientSettings.toBuilder()" - nameWithType: "ClientSettings.toBuilder()" - fullName: "com.google.api.gax.rpc.ClientSettings.toBuilder()" -- 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: "com.google.api.gax.rpc.ClientSettings.toString()" isExternal: true name: "ClientSettings.toString()" nameWithType: "ClientSettings.toString()" fullName: "com.google.api.gax.rpc.ClientSettings.toString()" -- uid: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - isExternal: true - name: "ClientSettings.getInternalHeaderProvider()" - nameWithType: "ClientSettings.getInternalHeaderProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" isExternal: true name: "ClientSettings.getWatchdogCheckInterval()" nameWithType: "ClientSettings.getWatchdogCheckInterval()" fullName: "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" -- uid: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" - isExternal: true - name: "ClientSettings.getTransportChannelProvider()" - nameWithType: "ClientSettings.getTransportChannelProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getBackgroundExecutorProvider()" isExternal: true name: "ClientSettings.getBackgroundExecutorProvider()" @@ -1499,21 +1468,16 @@ references: name: "ClientSettings.getEndpoint()" nameWithType: "ClientSettings.getEndpoint()" fullName: "com.google.api.gax.rpc.ClientSettings.getEndpoint()" -- 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: "com.google.api.gax.rpc.ClientSettings.getClock()" - isExternal: true - name: "ClientSettings.getClock()" - nameWithType: "ClientSettings.getClock()" - fullName: "com.google.api.gax.rpc.ClientSettings.getClock()" - 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.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.hashCode()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" name: "Object.hashCode()" @@ -1529,6 +1493,66 @@ references: name: "Object.wait(long,int)" nameWithType: "Object.wait(long,int)" fullName: "java.lang.Object.wait(long,int)" +- uid: "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" + isExternal: true + name: "ClientSettings.getUniverseDomain()" + nameWithType: "ClientSettings.getUniverseDomain()" + fullName: "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" +- uid: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" + isExternal: true + name: "ClientSettings.getHeaderProvider()" + nameWithType: "ClientSettings.getHeaderProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" + isExternal: true + name: "ClientSettings.getQuotaProjectId()" + nameWithType: "ClientSettings.getQuotaProjectId()" + fullName: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" +- 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: "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" + isExternal: true + name: "ClientSettings.getGdchApiAudience()" + nameWithType: "ClientSettings.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" +- 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: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" + isExternal: true + name: "ClientSettings.getCredentialsProvider()" + nameWithType: "ClientSettings.getCredentialsProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.toBuilder()" + isExternal: true + name: "ClientSettings.toBuilder()" + nameWithType: "ClientSettings.toBuilder()" + fullName: "com.google.api.gax.rpc.ClientSettings.toBuilder()" +- 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: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" + isExternal: true + name: "ClientSettings.getInternalHeaderProvider()" + nameWithType: "ClientSettings.getInternalHeaderProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" + isExternal: true + name: "ClientSettings.getTransportChannelProvider()" + nameWithType: "ClientSettings.getTransportChannelProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getClock()" + isExternal: true + name: "ClientSettings.getClock()" + nameWithType: "ClientSettings.getClock()" + fullName: "com.google.api.gax.rpc.ClientSettings.getClock()" - uid: "com.google.cloud.vision.v1.CreateProductSetRequest,com.google.cloud.vision.v1.ProductSet" name: "CreateProductSetRequest,ProductSet" nameWithType: "CreateProductSetRequest,ProductSet" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml index 8b389ba6..391dbdfd 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.yml @@ -31,6 +31,7 @@ items: - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" - "java.lang.Enum.clone()" - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" - "java.lang.Enum.equals(java.lang.Object)" - "java.lang.Enum.finalize()" - "java.lang.Enum.getDeclaringClass()" @@ -58,6 +59,7 @@ items: content: "public static final RecognitionAudio.AudioSourceCase AUDIOSOURCE_NOT_SET" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" + javaType: "static field" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.AudioSourceCase(int)" id: "AudioSourceCase(int)" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -88,6 +90,7 @@ items: content: "public static final RecognitionAudio.AudioSourceCase CONTENT" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" + javaType: "static field" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.URI" id: "URI" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -102,6 +105,7 @@ items: content: "public static final RecognitionAudio.AudioSourceCase URI" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" + javaType: "static field" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.forNumber(int)" id: "forNumber(int)" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -120,6 +124,7 @@ items: type: "int" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" + javaType: "static method" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.getNumber()" id: "getNumber()" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -146,7 +151,7 @@ items: overload: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.valueOf*" type: "Method" package: "com.microsoft.samples.google" - summary: "

(deprecated) Use #forNumber(int) instead.

" + summary: "\nDeprecated. Use #forNumber(int) instead.\n\n" syntax: content: "public static RecognitionAudio.AudioSourceCase valueOf(int value)" parameters: @@ -157,6 +162,7 @@ items: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" description: "The enum associated with the given number." status: "deprecated" + javaType: "static method" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.valueOf(java.lang.String)" id: "valueOf(java.lang.String)" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -175,6 +181,7 @@ items: type: "java.lang.String" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" + javaType: "static method" - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.values()" id: "values()" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" @@ -190,6 +197,7 @@ items: content: "public static RecognitionAudio.AudioSourceCase[] values()" return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase[]" + javaType: "static method" references: - uid: "int" href: "https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html" @@ -280,6 +288,11 @@ references: name: "Enum.finalize()" nameWithType: "Enum.finalize()" fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" - uid: "java.lang.Object.notifyAll()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" name: "Object.notifyAll()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.yml index 429de39c..ce59af02 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.RecognitionAudio.yml @@ -58,12 +58,15 @@ items: - "com.google.protobuf.AbstractMessageLite.toByteString()" - "com.google.protobuf.AbstractMessageLite.writeDelimitedTo(java.io.OutputStream)" - "com.google.protobuf.AbstractMessageLite.writeTo(java.io.OutputStream)" + - "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT)" + - "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT,int)" - "com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(com.google.protobuf.Parser,java.io.InputStream)" - "com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(com.google.protobuf.Parser,java.io.InputStream,com.google.protobuf.ExtensionRegistryLite)" - "com.google.protobuf.GeneratedMessageV3.parseWithIOException(com.google.protobuf.Parser,com.google.protobuf.CodedInputStream)" - "com.google.protobuf.GeneratedMessageV3.parseWithIOException(com.google.protobuf.Parser,com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite)" - "com.google.protobuf.GeneratedMessageV3.parseWithIOException(com.google.protobuf.Parser,java.io.InputStream)" - "com.google.protobuf.GeneratedMessageV3.parseWithIOException(com.google.protobuf.Parser,java.io.InputStream,com.google.protobuf.ExtensionRegistryLite)" + - "com.google.protobuf.GeneratedMessageV3.emptyList(java.lang.Class)" - "com.google.protobuf.GeneratedMessageV3.serializeBooleanMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField,com.google.protobuf.MapEntry,int)" - "com.google.protobuf.GeneratedMessageV3.serializeIntegerMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField,com.google.protobuf.MapEntry,int)" - "com.google.protobuf.GeneratedMessageV3.serializeLongMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField,com.google.protobuf.MapEntry,int)" @@ -89,7 +92,9 @@ items: - "com.google.protobuf.GeneratedMessageV3.hasOneof(com.google.protobuf.Descriptors.OneofDescriptor)" - "com.google.protobuf.GeneratedMessageV3.internalGetFieldAccessorTable()" - "com.google.protobuf.GeneratedMessageV3.internalGetMapField(int)" + - "com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)" - "com.google.protobuf.GeneratedMessageV3.isInitialized()" + - "com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)" - "com.google.protobuf.GeneratedMessageV3.makeExtensionsImmutable()" - "com.google.protobuf.GeneratedMessageV3.mergeFromAndMakeImmutableInternal(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite)" - "com.google.protobuf.GeneratedMessageV3.mutableCopy(com.google.protobuf.Internal.BooleanList)" @@ -133,6 +138,7 @@ items: content: "public static final int CONTENT_FIELD_NUMBER" return: type: "int" + javaType: "static field" - uid: "com.microsoft.samples.google.RecognitionAudio.RecognitionAudio()" id: "RecognitionAudio()" parent: "com.microsoft.samples.google.RecognitionAudio" @@ -194,6 +200,7 @@ items: content: "public static final int URI_FIELD_NUMBER" return: type: "int" + javaType: "static field" - uid: "com.microsoft.samples.google.RecognitionAudio.getAudioSourceCase()" id: "getAudioSourceCase()" parent: "com.microsoft.samples.google.RecognitionAudio" @@ -846,6 +853,16 @@ references: name: "GeneratedMessageV3.canUseUnsafe()" nameWithType: "GeneratedMessageV3.canUseUnsafe()" fullName: "com.google.protobuf.GeneratedMessageV3.canUseUnsafe()" +- uid: "com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)" + isExternal: true + name: "GeneratedMessageV3.isStringEmpty(Object)" + nameWithType: "GeneratedMessageV3.isStringEmpty(Object)" + fullName: "com.google.protobuf.GeneratedMessageV3.isStringEmpty(java.lang.Object)" +- uid: "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT)" + isExternal: true + name: "GeneratedMessageV3.makeMutableCopy(ListT)" + nameWithType: "GeneratedMessageV3.makeMutableCopy(ListT)" + fullName: "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT)" - uid: "com.google.protobuf.GeneratedMessageV3.newFloatList()" isExternal: true name: "GeneratedMessageV3.newFloatList()" @@ -921,6 +938,11 @@ references: name: "AbstractMessage.hashEnumList(List)" nameWithType: "AbstractMessage.hashEnumList(List)" fullName: "com.google.protobuf.AbstractMessage.hashEnumList(java.util.List)" +- uid: "com.google.protobuf.GeneratedMessageV3.emptyList(java.lang.Class)" + isExternal: true + name: "GeneratedMessageV3.emptyList(Class)" + nameWithType: "GeneratedMessageV3.emptyList(Class)" + fullName: "com.google.protobuf.GeneratedMessageV3.emptyList(java.lang.Class)" - uid: "com.google.protobuf.AbstractMessageLite.addAll(java.lang.Iterable,java.util.List)" isExternal: true name: "AbstractMessageLite.addAll(Iterable,List)" @@ -956,6 +978,11 @@ references: name: "GeneratedMessageV3.getParserForType()" nameWithType: "GeneratedMessageV3.getParserForType()" fullName: "com.google.protobuf.GeneratedMessageV3.getParserForType()" +- uid: "com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)" + isExternal: true + name: "GeneratedMessageV3.internalGetMapFieldReflection(int)" + nameWithType: "GeneratedMessageV3.internalGetMapFieldReflection(int)" + fullName: "com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)" - uid: "com.google.protobuf.GeneratedMessageV3.getRepeatedFieldCount(com.google.protobuf.Descriptors.FieldDescriptor)" isExternal: true name: "GeneratedMessageV3.getRepeatedFieldCount(Descriptors.FieldDescriptor)" @@ -1036,6 +1063,11 @@ references: name: "GeneratedMessageV3.computeStringSizeNoTag(Object)" nameWithType: "GeneratedMessageV3.computeStringSizeNoTag(Object)" fullName: "com.google.protobuf.GeneratedMessageV3.computeStringSizeNoTag(java.lang.Object)" +- uid: "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT,int)" + isExternal: true + name: "GeneratedMessageV3.makeMutableCopy(ListT,int)" + nameWithType: "GeneratedMessageV3.makeMutableCopy(ListT,int)" + fullName: "com.google.protobuf.GeneratedMessageV3.makeMutableCopy(ListT,int)" - uid: "com.google.protobuf.GeneratedMessageV3.isInitialized()" isExternal: true name: "GeneratedMessageV3.isInitialized()" @@ -1129,6 +1161,10 @@ references: name: "M>,InputStream)" nameWithType: "M>,InputStream)" fullName: "M>,java.io.InputStream)" +- uid: "ListT>makeMutableCopy(ListT)" + name: "ListT>makeMutableCopy(ListT)" + nameWithType: "ListT>makeMutableCopy(ListT)" + fullName: "ListT>makeMutableCopy(ListT)" - uid: "V>serializeStringMapTo(com.google.protobuf.CodedOutputStream,com.google.protobuf.MapField" name: "V>serializeStringMapTo(CodedOutputStream,MapField" nameWithType: "V>serializeStringMapTo(CodedOutputStream,MapField" @@ -1174,6 +1210,14 @@ references: name: "AbstractMessage.hashEnumList(List" nameWithType: "AbstractMessage.hashEnumList(List" fullName: "com.google.protobuf.AbstractMessage.hashEnumList(java.util.List" +- uid: "T>emptyList(java.lang.Class" + name: "T>emptyList(Class" + nameWithType: "T>emptyList(Class" + fullName: "T>emptyList(java.lang.Class" +- uid: "T>)" + name: "T>)" + nameWithType: "T>)" + fullName: "T>)" - uid: "T>,java.util.List" name: "T>,List" nameWithType: "T>,List" @@ -1209,3 +1253,7 @@ references: name: "Descriptors.FieldDescriptor,Object>)" nameWithType: "Descriptors.FieldDescriptor,Object>)" fullName: "com.google.protobuf.Descriptors.FieldDescriptor,java.lang.Object>)" +- uid: "ListT>makeMutableCopy(ListT,int)" + name: "ListT>makeMutableCopy(ListT,int)" + nameWithType: "ListT>makeMutableCopy(ListT,int)" + fullName: "ListT>makeMutableCopy(ListT,int)" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml index 8b438158..492435b2 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechClient.yml @@ -33,7 +33,7 @@ items: fullName: "com.microsoft.samples.google.SpeechClient" type: "Class" package: "com.microsoft.samples.google" - 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." + 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: @@ -52,6 +52,7 @@ items: - "java.lang.Object.wait()" - "java.lang.Object.wait(long)" - "java.lang.Object.wait(long,int)" + status: "beta" - uid: "com.microsoft.samples.google.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.SpeechClient" @@ -63,11 +64,13 @@ items: overload: "com.microsoft.samples.google.SpeechClient.SpeechClient*" type: "Constructor" package: "com.microsoft.samples.google" + summary: "

\n" syntax: content: "protected SpeechClient(SpeechStub stub)" parameters: - id: "stub" type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" id: "SpeechClient(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.SpeechClient" @@ -138,6 +141,7 @@ items: type: "com.microsoft.samples.google.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.SpeechClient" @@ -149,7 +153,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.create*" type: "Method" package: "com.microsoft.samples.google" - summary: "Constructs an instance of SpeechClient, using the given stub for making calls. This is for\n advanced usage - prefer using create(SpeechSettings)." + summary: "\n\n\nConstructs 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: @@ -157,6 +161,8 @@ items: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" return: type: "com.microsoft.samples.google.SpeechClient" + status: "beta" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" id: "create(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.SpeechClient" @@ -178,6 +184,7 @@ items: type: "com.microsoft.samples.google.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechClient.getOperationsClient()" id: "getOperationsClient()" parent: "com.microsoft.samples.google.SpeechClient" @@ -220,10 +227,12 @@ items: overload: "com.microsoft.samples.google.SpeechClient.getStub*" type: "Method" package: "com.microsoft.samples.google" + summary: "\n" syntax: content: "public SpeechStub getStub()" return: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.SpeechClient.isShutdown()" id: "isShutdown()" parent: "com.microsoft.samples.google.SpeechClient" @@ -265,7 +274,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google" - 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 
" + 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: @@ -285,7 +294,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google" - 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 
" + 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: @@ -308,7 +317,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google" - 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 future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + 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: @@ -324,7 +333,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.longRunningRecognizeOperationCallable*" type: "Method" package: "com.microsoft.samples.google" - 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 future =\n       speechClient.longRunningRecognizeOperationCallable().futureCall(request);\n   // Do something.\n   LongRunningRecognizeResponse response = future.get();\n }\n 
" + 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: @@ -340,7 +349,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google" - 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 
" + 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: @@ -363,7 +372,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google" - 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 
" + 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: @@ -383,7 +392,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.recognizeCallable*" type: "Method" package: "com.microsoft.samples.google" - 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 future = speechClient.recognizeCallable().futureCall(request);\n   // Do something.\n   RecognizeResponse response = future.get();\n }\n 
" + 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: @@ -425,7 +434,7 @@ items: overload: "com.microsoft.samples.google.SpeechClient.streamingRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google" - 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 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 
" + 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: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.Builder.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.Builder.yml index d059fabf..9fb5f2ad 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.Builder.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.Builder.yml @@ -36,6 +36,7 @@ items: - "com.google.api.gax.rpc.ClientSettings.Builder.getCredentialsProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getEndpoint()" - "com.google.api.gax.rpc.ClientSettings.Builder.getExecutorProvider()" + - "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" - "com.google.api.gax.rpc.ClientSettings.Builder.getHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getInternalHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.Builder.getQuotaProjectId()" @@ -49,10 +50,12 @@ items: - "com.google.api.gax.rpc.ClientSettings.Builder.setCredentialsProvider(com.google.api.gax.core.CredentialsProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setEndpoint(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + - "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setInternalHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.setQuotaProjectId(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setTransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider)" + - "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" - "com.google.api.gax.rpc.ClientSettings.Builder.setWatchdogCheckInterval(org.threeten.bp.Duration)" - "com.google.api.gax.rpc.ClientSettings.Builder.setWatchdogProvider(com.google.api.gax.rpc.WatchdogProvider)" - "com.google.api.gax.rpc.ClientSettings.Builder.toString()" @@ -524,6 +527,11 @@ references: name: "Object.wait(long,int)" nameWithType: "Object.wait(long,int)" fullName: "java.lang.Object.wait(long,int)" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" + isExternal: true + name: "ClientSettings.Builder.setGdchApiAudience(String)" + nameWithType: "ClientSettings.Builder.setGdchApiAudience(String)" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setGdchApiAudience(java.lang.String)" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.toString()" isExternal: true name: "ClientSettings.Builder.toString()" @@ -594,6 +602,11 @@ references: name: "ClientSettings.Builder.setQuotaProjectId(String)" nameWithType: "ClientSettings.Builder.setQuotaProjectId(String)" fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setQuotaProjectId(java.lang.String)" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" + isExternal: true + name: "ClientSettings.Builder.setUniverseDomain(String)" + nameWithType: "ClientSettings.Builder.setUniverseDomain(String)" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.setUniverseDomain(java.lang.String)" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.getCredentialsProvider()" isExternal: true name: "ClientSettings.Builder.getCredentialsProvider()" @@ -624,6 +637,11 @@ references: name: "ClientSettings.Builder.getTransportChannelProvider()" nameWithType: "ClientSettings.Builder.getTransportChannelProvider()" fullName: "com.google.api.gax.rpc.ClientSettings.Builder.getTransportChannelProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" + isExternal: true + name: "ClientSettings.Builder.getGdchApiAudience()" + nameWithType: "ClientSettings.Builder.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.ClientSettings.Builder.getGdchApiAudience()" - uid: "com.google.api.gax.rpc.ClientSettings.Builder.getEndpoint()" isExternal: true name: "ClientSettings.Builder.getEndpoint()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.yml index d2e8047b..800a05eb 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.SpeechSettings.yml @@ -28,7 +28,7 @@ items: fullName: "com.microsoft.samples.google.SpeechSettings" type: "Class" package: "com.microsoft.samples.google" - summary: "Settings class to configure an instance of SpeechClient.\n\n

The default instance has everything set to sensible defaults:\n\n

    \n
  • The default service address (speech.googleapis.com) and default port (443) are used.\n
  • Credentials are acquired automatically through Application Default Credentials.\n
  • Retries are configured for idempotent methods but not for non-idempotent methods.\n
\n\n

The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n

For example, to set the total timeout of recognize to 30 seconds:\n\n

\n SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();\n speechSettingsBuilder\n     .recognizeSettings()\n     .setRetrySettings(\n         speechSettingsBuilder\n             .recognizeSettings()\n             .getRetrySettings()\n             .toBuilder()\n             .setTotalTimeout(Duration.ofSeconds(30))\n             .build());\n SpeechSettings speechSettings = speechSettingsBuilder.build();\n 
" + summary: "Settings class to configure an instance of SpeechClient.\n\n

The default instance has everything set to sensible defaults:\n\n

    \n
  • The default service address (speech.googleapis.com) and default port (443) are used.\n
  • Credentials are acquired automatically through Application Default Credentials.\n
  • Retries are configured for idempotent methods but not for non-idempotent methods.\n
\n\n

The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n

For example, to set the total timeout of recognize to 30 seconds:\n\n

\n SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();\n speechSettingsBuilder\n     .recognizeSettings()\n     .setRetrySettings(\n         speechSettingsBuilder\n             .recognizeSettings()\n             .getRetrySettings()\n             .toBuilder()\n             .setTotalTimeout(Duration.ofSeconds(30))\n             .build());\n SpeechSettings speechSettings = speechSettingsBuilder.build();\n 
" syntax: content: "public class SpeechSettings extends ClientSettings" inheritance: @@ -41,11 +41,13 @@ items: - "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - "com.google.api.gax.rpc.ClientSettings.getEndpoint()" - "com.google.api.gax.rpc.ClientSettings.getExecutorProvider()" + - "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" - "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" - "com.google.api.gax.rpc.ClientSettings.getStubSettings()" - "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" + - "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" - "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" - "com.google.api.gax.rpc.ClientSettings.getWatchdogProvider()" - "com.google.api.gax.rpc.ClientSettings.toString()" @@ -59,6 +61,7 @@ items: - "java.lang.Object.wait()" - "java.lang.Object.wait(long)" - "java.lang.Object.wait(long,int)" + status: "beta" - uid: "com.microsoft.samples.google.SpeechSettings.SpeechSettings(com.microsoft.samples.google.SpeechSettings.Builder)" id: "SpeechSettings(com.microsoft.samples.google.SpeechSettings.Builder)" parent: "com.microsoft.samples.google.SpeechSettings" @@ -95,6 +98,7 @@ items: type: "com.microsoft.samples.google.SpeechSettings" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.defaultApiClientHeaderProviderBuilder()" id: "defaultApiClientHeaderProviderBuilder()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -106,10 +110,13 @@ items: overload: "com.microsoft.samples.google.SpeechSettings.defaultApiClientHeaderProviderBuilder*" type: "Method" package: "com.microsoft.samples.google" + summary: "\n" syntax: content: "public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()" return: type: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + status: "beta" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.defaultCredentialsProviderBuilder()" id: "defaultCredentialsProviderBuilder()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -126,6 +133,7 @@ items: content: "public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()" return: type: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.defaultExecutorProviderBuilder()" id: "defaultExecutorProviderBuilder()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -142,6 +150,7 @@ items: content: "public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()" return: type: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.defaultGrpcTransportProviderBuilder()" id: "defaultGrpcTransportProviderBuilder()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -158,6 +167,7 @@ items: content: "public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()" return: type: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.defaultTransportChannelProvider()" id: "defaultTransportChannelProvider()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -173,6 +183,7 @@ items: content: "public static TransportChannelProvider defaultTransportChannelProvider()" return: type: "com.google.api.gax.rpc.TransportChannelProvider" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.getDefaultEndpoint()" id: "getDefaultEndpoint()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -189,6 +200,7 @@ items: content: "public static String getDefaultEndpoint()" return: type: "java.lang.String" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.getDefaultServiceScopes()" id: "getDefaultServiceScopes()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -205,6 +217,7 @@ items: content: "public static List getDefaultServiceScopes()" return: type: "java.util.List" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.longRunningRecognizeOperationSettings()" id: "longRunningRecognizeOperationSettings()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -253,6 +266,7 @@ items: content: "public static SpeechSettings.Builder newBuilder()" return: type: "com.microsoft.samples.google.SpeechSettings.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.newBuilder(com.google.api.gax.rpc.ClientContext)" id: "newBuilder(com.google.api.gax.rpc.ClientContext)" parent: "com.microsoft.samples.google.SpeechSettings" @@ -272,6 +286,7 @@ items: type: "com.google.api.gax.rpc.ClientContext" return: type: "com.microsoft.samples.google.SpeechSettings.Builder" + javaType: "static method" - uid: "com.microsoft.samples.google.SpeechSettings.recognizeSettings()" id: "recognizeSettings()" parent: "com.microsoft.samples.google.SpeechSettings" @@ -592,21 +607,6 @@ references: name: "ClientSettings" nameWithType: "ClientSettings" fullName: "com.google.api.gax.rpc.ClientSettings" -- uid: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" - isExternal: true - name: "ClientSettings.getHeaderProvider()" - nameWithType: "ClientSettings.getHeaderProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" -- uid: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" - isExternal: true - name: "ClientSettings.getQuotaProjectId()" - nameWithType: "ClientSettings.getQuotaProjectId()" - fullName: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" -- 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()" @@ -622,56 +622,26 @@ references: name: "ClientSettings.getWatchdogProvider()" nameWithType: "ClientSettings.getWatchdogProvider()" fullName: "com.google.api.gax.rpc.ClientSettings.getWatchdogProvider()" -- 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.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: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - isExternal: true - name: "ClientSettings.getCredentialsProvider()" - nameWithType: "ClientSettings.getCredentialsProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getStubSettings()" isExternal: true name: "ClientSettings.getStubSettings()" nameWithType: "ClientSettings.getStubSettings()" fullName: "com.google.api.gax.rpc.ClientSettings.getStubSettings()" -- uid: "com.google.api.gax.rpc.ClientSettings.toBuilder()" - isExternal: true - name: "ClientSettings.toBuilder()" - nameWithType: "ClientSettings.toBuilder()" - fullName: "com.google.api.gax.rpc.ClientSettings.toBuilder()" -- 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: "com.google.api.gax.rpc.ClientSettings.toString()" isExternal: true name: "ClientSettings.toString()" nameWithType: "ClientSettings.toString()" fullName: "com.google.api.gax.rpc.ClientSettings.toString()" -- uid: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - isExternal: true - name: "ClientSettings.getInternalHeaderProvider()" - nameWithType: "ClientSettings.getInternalHeaderProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" isExternal: true name: "ClientSettings.getWatchdogCheckInterval()" nameWithType: "ClientSettings.getWatchdogCheckInterval()" fullName: "com.google.api.gax.rpc.ClientSettings.getWatchdogCheckInterval()" -- uid: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" - isExternal: true - name: "ClientSettings.getTransportChannelProvider()" - nameWithType: "ClientSettings.getTransportChannelProvider()" - fullName: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" - uid: "com.google.api.gax.rpc.ClientSettings.getBackgroundExecutorProvider()" isExternal: true name: "ClientSettings.getBackgroundExecutorProvider()" @@ -682,21 +652,16 @@ references: name: "ClientSettings.getEndpoint()" nameWithType: "ClientSettings.getEndpoint()" fullName: "com.google.api.gax.rpc.ClientSettings.getEndpoint()" -- 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: "com.google.api.gax.rpc.ClientSettings.getClock()" - isExternal: true - name: "ClientSettings.getClock()" - nameWithType: "ClientSettings.getClock()" - fullName: "com.google.api.gax.rpc.ClientSettings.getClock()" - 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.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.hashCode()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" name: "Object.hashCode()" @@ -712,6 +677,66 @@ references: name: "Object.wait(long,int)" nameWithType: "Object.wait(long,int)" fullName: "java.lang.Object.wait(long,int)" +- uid: "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" + isExternal: true + name: "ClientSettings.getUniverseDomain()" + nameWithType: "ClientSettings.getUniverseDomain()" + fullName: "com.google.api.gax.rpc.ClientSettings.getUniverseDomain()" +- uid: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" + isExternal: true + name: "ClientSettings.getHeaderProvider()" + nameWithType: "ClientSettings.getHeaderProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getHeaderProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" + isExternal: true + name: "ClientSettings.getQuotaProjectId()" + nameWithType: "ClientSettings.getQuotaProjectId()" + fullName: "com.google.api.gax.rpc.ClientSettings.getQuotaProjectId()" +- 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: "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" + isExternal: true + name: "ClientSettings.getGdchApiAudience()" + nameWithType: "ClientSettings.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.ClientSettings.getGdchApiAudience()" +- 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: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" + isExternal: true + name: "ClientSettings.getCredentialsProvider()" + nameWithType: "ClientSettings.getCredentialsProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getCredentialsProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.toBuilder()" + isExternal: true + name: "ClientSettings.toBuilder()" + nameWithType: "ClientSettings.toBuilder()" + fullName: "com.google.api.gax.rpc.ClientSettings.toBuilder()" +- 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: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" + isExternal: true + name: "ClientSettings.getInternalHeaderProvider()" + nameWithType: "ClientSettings.getInternalHeaderProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getInternalHeaderProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" + isExternal: true + name: "ClientSettings.getTransportChannelProvider()" + nameWithType: "ClientSettings.getTransportChannelProvider()" + fullName: "com.google.api.gax.rpc.ClientSettings.getTransportChannelProvider()" +- uid: "com.google.api.gax.rpc.ClientSettings.getClock()" + isExternal: true + name: "ClientSettings.getClock()" + nameWithType: "ClientSettings.getClock()" + fullName: "com.google.api.gax.rpc.ClientSettings.getClock()" - uid: "com.google.api.gax.rpc.UnaryCallSettings" isExternal: true name: "UnaryCallSettings" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ValidationException.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ValidationException.yml index 988e632b..d45df9d5 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ValidationException.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.ValidationException.yml @@ -16,7 +16,7 @@ items: fullName: "com.microsoft.samples.google.ValidationException" type: "Class" package: "com.microsoft.samples.google" - summary: "Exception thrown if there is a validation problem with a path template, http config, or related\n framework methods. Comes as an illegal argument exception subclass. Allows to globally set a\n thread-local validation context description which each exception inherits." + summary: "Exception thrown if there is a validation problem with a path template, http config, or related\n framework methods. Comes as an illegal argument exception subclass. Allows to globally set a\n thread-local validation context description which each exception inherits.\nSee Also: Google Cloud Storage error codes\n" syntax: content: "public class ValidationException extends IllegalArgumentException" inheritance: @@ -49,6 +49,7 @@ items: - "java.lang.Throwable.printStackTrace(java.io.PrintWriter)" - "java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[])" - "java.lang.Throwable.toString()" + javaType: "exception" - uid: "com.microsoft.samples.google.ValidationException.ValidationException(java.lang.String,java.lang.Object...)" id: "ValidationException(java.lang.String,java.lang.Object...)" parent: "com.microsoft.samples.google.ValidationException" @@ -82,6 +83,7 @@ items: summary: "Clears the validation context." syntax: content: "public static void popCurrentThreadValidationContext()" + javaType: "static method" - uid: "com.microsoft.samples.google.ValidationException.pushCurrentThreadValidationContext(com.microsoft.samples.google.ValidationException.Supplier)" id: "pushCurrentThreadValidationContext(com.microsoft.samples.google.ValidationException.Supplier)" parent: "com.microsoft.samples.google.ValidationException" @@ -99,6 +101,7 @@ items: parameters: - id: "supplier" type: "com.microsoft.samples.google.ValidationException.Supplier" + javaType: "static method" - uid: "com.microsoft.samples.google.ValidationException.pushCurrentThreadValidationContext(java.lang.String)" id: "pushCurrentThreadValidationContext(java.lang.String)" parent: "com.microsoft.samples.google.ValidationException" @@ -115,6 +118,7 @@ items: parameters: - id: "context" type: "java.lang.String" + javaType: "static method" references: - uid: "java.lang.String" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md new file mode 100644 index 00000000..8f10b407 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.md @@ -0,0 +1,139 @@ +# Package com.microsoft.samples.google (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Client Classes +Client classes are the main entry point to using a package. +They contain several variations of Java methods for each of the API's methods. + + + + + + + + +
+Client +Description
com.microsoft.samples.google.SpeechClient +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:

+ +## Settings Classes +Settings classes can be used to configure credentials, endpoints, and retry settings for a Client. + + + + + + + + + + + + +
+Settings +Description
com.microsoft.samples.google.ProductSearchSettings +Settings class to configure an instance of ProductSearchClient. + +

The default instance has everything set to sensible defaults: +

com.microsoft.samples.google.SpeechSettings +Settings class to configure an instance of SpeechClient. + +

The default instance has everything set to sensible defaults: +

+ +## Classes + + + + + + + + + + + + + + + + +
+Class +Description
com.microsoft.samples.google.ProductSearchSettings.Builder +Builder for ProductSearchSettings.
com.microsoft.samples.google.RecognitionAudio + + Contains audio data in the encoding specified in the RecognitionConfig. + Either content or uri must be supplied. Supplying both or neither + returns google.rpc.Code.INVALID_ARGUMENT. See
com.microsoft.samples.google.SpeechSettings.Builder +Builder for SpeechSettings.
+ +## Interfaces + + + + + + + + + + + + +
+Interface +Description
com.microsoft.samples.google.BetaApi +Indicates a public API that can change at any time, and has no guarantee of API stability and + backward-compatibility. + +

Usage guidelines:

com.microsoft.samples.google.ValidationException.Supplier +
+ +## Enums + + + + + + + + +
+Enum +Description
com.microsoft.samples.google.RecognitionAudio.AudioSourceCase +
+ +## Exceptions + + + + + + + + +
+Exception +Description
com.microsoft.samples.google.ValidationException +Exception thrown if there is a validation problem with a path template, http config, or related + framework methods. Comes as an illegal argument exception subclass. Allows to globally set a + thread-local validation context description which each exception inherits. +See Also: Google Cloud Storage error codes +
+ 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..7868c0db --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.SpeechClient.yml @@ -0,0 +1,824 @@ +### 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: "
GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation
\n\nService 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: {} + inheritance: + - "java.lang.Object" + status: "beta" +- 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" + summary: "

\n" + syntax: + content: "protected SpeechClient(SpeechStub stub)" + parameters: + - id: "stub" + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" +- 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: "\n\n\nConstructs 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" + status: "beta" + 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" + summary: "\n" + syntax: + content: "public SpeechStub getStub()" + return: + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" +- 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.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md new file mode 100644 index 00000000..8f3b533b --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.md @@ -0,0 +1,28 @@ +# Package com.microsoft.samples.google.v1 (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## Client Classes +Client classes are the main entry point to using a package. +They contain several variations of Java methods for each of the API's methods. + + + + + + + + +
+Client +Description
com.microsoft.samples.google.v1.SpeechClient +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:

+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.GrpcSpeechStub.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.GrpcSpeechStub.yml new file mode 100644 index 00000000..651f3d28 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.GrpcSpeechStub.yml @@ -0,0 +1,682 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + id: "GrpcSpeechStub" + parent: "com.microsoft.samples.google.v1.stub" + children: + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.awaitTermination(long,java.util.concurrent.TimeUnit)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.close()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isShutdown()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.recognizeCallable()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow()" + - "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.streamingRecognizeCallable()" + langs: + - "java" + name: "GrpcSpeechStub" + nameWithType: "GrpcSpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + type: "Class" + package: "com.microsoft.samples.google.v1.stub" + summary: "gRPC stub implementation for the Speech service API.\n\n

This class is for advanced usage and reflects the underlying API directly." + syntax: + content: "public class GrpcSpeechStub extends SpeechStub" + inheritance: + - "java.lang.Object" + - "com.microsoft.samples.google.v1.stub.SpeechStub" + inheritedMembers: + - "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + - "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)" + status: "beta" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + id: "GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + nameWithType: "GrpcSpeechStub.GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + summary: "Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that\n it is easy to make a subclass, but otherwise, the static factory methods should be preferred." + syntax: + content: "protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + id: "GrpcSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + nameWithType: "GrpcSpeechStub.GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + summary: "Constructs an instance of GrpcSpeechStub, using the given settings. This is protected so that\n it is easy to make a subclass, but otherwise, the static factory methods should be preferred." + syntax: + content: "protected GrpcSpeechStub(SpeechStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + - id: "callableFactory" + type: "com.google.api.gax.grpc.GrpcStubCallableFactory" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.awaitTermination(long,java.util.concurrent.TimeUnit)" + id: "awaitTermination(long,java.util.concurrent.TimeUnit)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "awaitTermination(long duration, TimeUnit unit)" + nameWithType: "GrpcSpeechStub.awaitTermination(long duration, TimeUnit unit)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.awaitTermination(long duration, TimeUnit unit)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.awaitTermination*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + 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.stub.GrpcSpeechStub.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "close()" + nameWithType: "GrpcSpeechStub.close()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.close()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.close*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public final void close()" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.google.api.gax.rpc.ClientContext)" + id: "create(com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "create(ClientContext clientContext)" + nameWithType: "GrpcSpeechStub.create(ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final GrpcSpeechStub create(ClientContext clientContext)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + return: + type: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + id: "create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.grpc.GrpcStubCallableFactory)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + nameWithType: "GrpcSpeechStub.create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final GrpcSpeechStub create(ClientContext clientContext, GrpcStubCallableFactory callableFactory)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + - id: "callableFactory" + type: "com.google.api.gax.grpc.GrpcStubCallableFactory" + return: + type: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + id: "create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "create(SpeechStubSettings settings)" + nameWithType: "GrpcSpeechStub.create(SpeechStubSettings settings)" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create(SpeechStubSettings settings)" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final GrpcSpeechStub create(SpeechStubSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + return: + type: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub()" + id: "getOperationsStub()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "getOperationsStub()" + nameWithType: "GrpcSpeechStub.getOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public GrpcOperationsStub getOperationsStub()" + return: + type: "com.google.longrunning.stub.GrpcOperationsStub" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isShutdown()" + id: "isShutdown()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "isShutdown()" + nameWithType: "GrpcSpeechStub.isShutdown()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isShutdown()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isShutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public boolean isShutdown()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated()" + id: "isTerminated()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "isTerminated()" + nameWithType: "GrpcSpeechStub.isTerminated()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public boolean isTerminated()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "GrpcSpeechStub.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "GrpcSpeechStub.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "GrpcSpeechStub.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.recognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.recognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown()" + id: "shutdown()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "shutdown()" + nameWithType: "GrpcSpeechStub.shutdown()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public void shutdown()" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow()" + id: "shutdownNow()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "shutdownNow()" + nameWithType: "GrpcSpeechStub.shutdownNow()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public void shutdownNow()" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "GrpcSpeechStub.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.streamingRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.streamingRecognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public BidiStreamingCallable streamingRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.BidiStreamingCallable" +references: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + name: "SpeechStubSettings" + nameWithType: "SpeechStubSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" +- uid: "com.google.api.gax.rpc.ClientContext" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.ClientContext" + name: "ClientContext" + fullName: "com.google.api.gax.rpc.ClientContext" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub*" + name: "GrpcSpeechStub" + nameWithType: "GrpcSpeechStub.GrpcSpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.GrpcSpeechStub" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.grpc.GrpcStubCallableFactory" + isExternal: true + spec.java: + - uid: "com.google.api.gax.grpc.GrpcStubCallableFactory" + name: "GrpcStubCallableFactory" + fullName: "com.google.api.gax.grpc.GrpcStubCallableFactory" + isExternal: true +- 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.stub.GrpcSpeechStub.create*" + name: "create" + nameWithType: "GrpcSpeechStub.create" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.create" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.longrunning.stub.GrpcOperationsStub" + isExternal: true + spec.java: + - uid: "com.google.longrunning.stub.GrpcOperationsStub" + name: "GrpcOperationsStub" + fullName: "com.google.longrunning.stub.GrpcOperationsStub" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub*" + name: "getOperationsStub" + nameWithType: "GrpcSpeechStub.getOperationsStub" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.getOperationsStub" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "GrpcSpeechStub.recognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.recognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "GrpcSpeechStub.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "GrpcSpeechStub.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "GrpcSpeechStub.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.close*" + name: "close" + nameWithType: "GrpcSpeechStub.close" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.close" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown*" + name: "shutdown" + nameWithType: "GrpcSpeechStub.shutdown" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdown" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.isShutdown*" + name: "isShutdown" + nameWithType: "GrpcSpeechStub.isShutdown" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isShutdown" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated*" + name: "isTerminated" + nameWithType: "GrpcSpeechStub.isTerminated" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.isTerminated" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow*" + name: "shutdownNow" + nameWithType: "GrpcSpeechStub.shutdownNow" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.shutdownNow" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.GrpcSpeechStub.awaitTermination*" + name: "awaitTermination" + nameWithType: "GrpcSpeechStub.awaitTermination" + fullName: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub.awaitTermination" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub" + name: "SpeechStub" + nameWithType: "SpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub" +- 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.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.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: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + name: "SpeechStub.getOperationsStub()" + nameWithType: "SpeechStub.getOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + name: "SpeechStub.close()" + nameWithType: "SpeechStub.close()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" +- 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.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + name: "SpeechStub.streamingRecognizeCallable()" + nameWithType: "SpeechStub.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + name: "SpeechStub.longRunningRecognizeOperationCallable()" + nameWithType: "SpeechStub.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + name: "SpeechStub.getHttpJsonOperationsStub()" + nameWithType: "SpeechStub.getHttpJsonOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + name: "SpeechStub.recognizeCallable()" + nameWithType: "SpeechStub.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + name: "SpeechStub.longRunningRecognizeCallable()" + nameWithType: "SpeechStub.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" +- 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.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.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.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.stub.HttpJsonSpeechStub.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.yml new file mode 100644 index 00000000..9e71d37c --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.yml @@ -0,0 +1,733 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + id: "HttpJsonSpeechStub" + parent: "com.microsoft.samples.google.v1.stub" + children: + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.awaitTermination(long,java.util.concurrent.TimeUnit)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.close()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isShutdown()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.recognizeCallable()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow()" + - "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.streamingRecognizeCallable()" + langs: + - "java" + name: "HttpJsonSpeechStub" + nameWithType: "HttpJsonSpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + type: "Class" + package: "com.microsoft.samples.google.v1.stub" + summary: "REST stub implementation for the Speech service API.\n\n

This class is for advanced usage and reflects the underlying API directly." + syntax: + content: "public class HttpJsonSpeechStub extends SpeechStub" + inheritance: + - "java.lang.Object" + - "com.microsoft.samples.google.v1.stub.SpeechStub" + inheritedMembers: + - "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + - "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)" + status: "beta" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + id: "HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + nameWithType: "HttpJsonSpeechStub.HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + summary: "Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so\n that it is easy to make a subclass, but otherwise, the static factory methods should be\n preferred." + syntax: + content: "protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + id: "HttpJsonSpeechStub(com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + nameWithType: "HttpJsonSpeechStub.HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + summary: "Constructs an instance of HttpJsonSpeechStub, using the given settings. This is protected so\n that it is easy to make a subclass, but otherwise, the static factory methods should be\n preferred." + syntax: + content: "protected HttpJsonSpeechStub(SpeechStubSettings settings, ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + - id: "callableFactory" + type: "com.google.api.gax.httpjson.HttpJsonStubCallableFactory" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.awaitTermination(long,java.util.concurrent.TimeUnit)" + id: "awaitTermination(long,java.util.concurrent.TimeUnit)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "awaitTermination(long duration, TimeUnit unit)" + nameWithType: "HttpJsonSpeechStub.awaitTermination(long duration, TimeUnit unit)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.awaitTermination(long duration, TimeUnit unit)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.awaitTermination*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + 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.stub.HttpJsonSpeechStub.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "close()" + nameWithType: "HttpJsonSpeechStub.close()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.close()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.close*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public final void close()" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.google.api.gax.rpc.ClientContext)" + id: "create(com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "create(ClientContext clientContext)" + nameWithType: "HttpJsonSpeechStub.create(ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final HttpJsonSpeechStub create(ClientContext clientContext)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + return: + type: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + id: "create(com.google.api.gax.rpc.ClientContext,com.google.api.gax.httpjson.HttpJsonStubCallableFactory)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + nameWithType: "HttpJsonSpeechStub.create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final HttpJsonSpeechStub create(ClientContext clientContext, HttpJsonStubCallableFactory callableFactory)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + - id: "callableFactory" + type: "com.google.api.gax.httpjson.HttpJsonStubCallableFactory" + return: + type: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + id: "create(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "create(SpeechStubSettings settings)" + nameWithType: "HttpJsonSpeechStub.create(SpeechStubSettings settings)" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create(SpeechStubSettings settings)" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static final HttpJsonSpeechStub create(SpeechStubSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + return: + type: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + exceptions: + - type: "java.io.IOException" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub()" + id: "getHttpJsonOperationsStub()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "getHttpJsonOperationsStub()" + nameWithType: "HttpJsonSpeechStub.getHttpJsonOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public HttpJsonOperationsStub getHttpJsonOperationsStub()" + return: + type: "com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors()" + id: "getMethodDescriptors()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "getMethodDescriptors()" + nameWithType: "HttpJsonSpeechStub.getMethodDescriptors()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "

\n" + syntax: + content: "public static List getMethodDescriptors()" + return: + type: "java.util.List" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isShutdown()" + id: "isShutdown()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "isShutdown()" + nameWithType: "HttpJsonSpeechStub.isShutdown()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isShutdown()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isShutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public boolean isShutdown()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated()" + id: "isTerminated()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "isTerminated()" + nameWithType: "HttpJsonSpeechStub.isTerminated()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public boolean isTerminated()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "HttpJsonSpeechStub.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "HttpJsonSpeechStub.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "HttpJsonSpeechStub.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.recognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.recognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown()" + id: "shutdown()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "shutdown()" + nameWithType: "HttpJsonSpeechStub.shutdown()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public void shutdown()" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow()" + id: "shutdownNow()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "shutdownNow()" + nameWithType: "HttpJsonSpeechStub.shutdownNow()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public void shutdownNow()" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "HttpJsonSpeechStub.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.streamingRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.streamingRecognizeCallable*" + overridden: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public BidiStreamingCallable streamingRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.BidiStreamingCallable" +references: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + name: "SpeechStubSettings" + nameWithType: "SpeechStubSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" +- uid: "com.google.api.gax.rpc.ClientContext" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.ClientContext" + name: "ClientContext" + fullName: "com.google.api.gax.rpc.ClientContext" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub*" + name: "HttpJsonSpeechStub" + nameWithType: "HttpJsonSpeechStub.HttpJsonSpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.HttpJsonSpeechStub" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.httpjson.HttpJsonStubCallableFactory" + isExternal: true + spec.java: + - uid: "com.google.api.gax.httpjson.HttpJsonStubCallableFactory" + name: "HttpJsonStubCallableFactory" + fullName: "com.google.api.gax.httpjson.HttpJsonStubCallableFactory" + isExternal: true +- 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.stub.HttpJsonSpeechStub.create*" + name: "create" + nameWithType: "HttpJsonSpeechStub.create" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.create" + package: "com.microsoft.samples.google.v1.stub" +- uid: "java.util.List" + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + spec.java: + - uid: "java.util.List" + name: "List" + fullName: "java.util.List" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.api.gax.httpjson.ApiMethodDescriptor" + name: "ApiMethodDescriptor" + fullName: "com.google.api.gax.httpjson.ApiMethodDescriptor" + isExternal: true + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors*" + name: "getMethodDescriptors" + nameWithType: "HttpJsonSpeechStub.getMethodDescriptors" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getMethodDescriptors" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub" + isExternal: true + spec.java: + - uid: "com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub" + name: "HttpJsonOperationsStub" + fullName: "com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub*" + name: "getHttpJsonOperationsStub" + nameWithType: "HttpJsonSpeechStub.getHttpJsonOperationsStub" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.getHttpJsonOperationsStub" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "HttpJsonSpeechStub.recognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.recognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "HttpJsonSpeechStub.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "HttpJsonSpeechStub.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "HttpJsonSpeechStub.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.close*" + name: "close" + nameWithType: "HttpJsonSpeechStub.close" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.close" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown*" + name: "shutdown" + nameWithType: "HttpJsonSpeechStub.shutdown" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdown" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.isShutdown*" + name: "isShutdown" + nameWithType: "HttpJsonSpeechStub.isShutdown" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isShutdown" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated*" + name: "isTerminated" + nameWithType: "HttpJsonSpeechStub.isTerminated" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.isTerminated" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow*" + name: "shutdownNow" + nameWithType: "HttpJsonSpeechStub.shutdownNow" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.shutdownNow" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.HttpJsonSpeechStub.awaitTermination*" + name: "awaitTermination" + nameWithType: "HttpJsonSpeechStub.awaitTermination" + fullName: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub.awaitTermination" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub" + name: "SpeechStub" + nameWithType: "SpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub" +- 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.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.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: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + name: "SpeechStub.getOperationsStub()" + nameWithType: "SpeechStub.getOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + name: "SpeechStub.close()" + nameWithType: "SpeechStub.close()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" +- 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.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + name: "SpeechStub.streamingRecognizeCallable()" + nameWithType: "SpeechStub.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + name: "SpeechStub.longRunningRecognizeOperationCallable()" + nameWithType: "SpeechStub.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + name: "SpeechStub.getHttpJsonOperationsStub()" + nameWithType: "SpeechStub.getHttpJsonOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" +- 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: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + name: "SpeechStub.recognizeCallable()" + nameWithType: "SpeechStub.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + name: "SpeechStub.longRunningRecognizeCallable()" + nameWithType: "SpeechStub.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" +- uid: "java.util.List" + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + name: "List" + nameWithType: "List" + fullName: "java.util.List" +- uid: "com.google.api.gax.httpjson.ApiMethodDescriptor" + isExternal: true + name: "ApiMethodDescriptor" + nameWithType: "ApiMethodDescriptor" + fullName: "com.google.api.gax.httpjson.ApiMethodDescriptor" +- 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.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.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.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.stub.SpeechStub.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStub.yml new file mode 100644 index 00000000..12e98fd2 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStub.yml @@ -0,0 +1,406 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub" + id: "SpeechStub" + parent: "com.microsoft.samples.google.v1.stub" + children: + - "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + - "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + langs: + - "java" + name: "SpeechStub" + nameWithType: "SpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub" + type: "Class" + package: "com.microsoft.samples.google.v1.stub" + summary: "Base stub class for the Speech service API.\n\n

This class is for advanced usage and reflects the underlying API directly." + syntax: + content: "public abstract class SpeechStub 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)" + status: "beta" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub()" + id: "SpeechStub()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "SpeechStub()" + nameWithType: "SpeechStub.SpeechStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public SpeechStub()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "close()" + nameWithType: "SpeechStub.close()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.close()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.close*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public abstract void close()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + id: "getHttpJsonOperationsStub()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "getHttpJsonOperationsStub()" + nameWithType: "SpeechStub.getHttpJsonOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public OperationsStub getHttpJsonOperationsStub()" + return: + type: "com.google.api.gax.httpjson.longrunning.stub.OperationsStub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + id: "getOperationsStub()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "getOperationsStub()" + nameWithType: "SpeechStub.getOperationsStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public OperationsStub getOperationsStub()" + return: + type: "com.google.longrunning.stub.OperationsStub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "SpeechStub.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "SpeechStub.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "SpeechStub.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStub" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "SpeechStub.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public BidiStreamingCallable streamingRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.BidiStreamingCallable" +references: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub*" + name: "SpeechStub" + nameWithType: "SpeechStub.SpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.SpeechStub" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.longrunning.stub.OperationsStub" + isExternal: true + spec.java: + - uid: "com.google.longrunning.stub.OperationsStub" + name: "OperationsStub" + fullName: "com.google.longrunning.stub.OperationsStub" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub*" + name: "getOperationsStub" + nameWithType: "SpeechStub.getOperationsStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getOperationsStub" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.httpjson.longrunning.stub.OperationsStub" + isExternal: true + spec.java: + - uid: "com.google.api.gax.httpjson.longrunning.stub.OperationsStub" + name: "OperationsStub" + fullName: "com.google.api.gax.httpjson.longrunning.stub.OperationsStub" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub*" + name: "getHttpJsonOperationsStub" + nameWithType: "SpeechStub.getHttpJsonOperationsStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.getHttpJsonOperationsStub" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStub.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "SpeechStub.recognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.recognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStub.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "SpeechStub.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStub.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "SpeechStub.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStub.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "SpeechStub.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStub.close*" + name: "close" + nameWithType: "SpeechStub.close" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub.close" + package: "com.microsoft.samples.google.v1.stub" +- 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.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.stub.SpeechStubSettings.Builder.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.yml new file mode 100644 index 00000000..9945f7a7 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.yml @@ -0,0 +1,778 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + id: "Builder" + parent: "com.microsoft.samples.google.v1.stub" + children: + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods(com.google.api.core.ApiFunction,java.lang.Void>)" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.build()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.recognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.streamingRecognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders()" + langs: + - "java" + name: "SpeechStubSettings.Builder" + nameWithType: "SpeechStubSettings.Builder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + type: "Class" + package: "com.microsoft.samples.google.v1.stub" + summary: "Builder for SpeechStubSettings." + syntax: + content: "public static class SpeechStubSettings.Builder extends StubSettings.Builder" + inheritance: + - "java.lang.Object" + - "com.google.api.gax.rpc.StubSettings.Builder" + inheritedMembers: + - "com.google.api.gax.rpc.StubSettings.Builder.build()" + - "com.google.api.gax.rpc.StubSettings.Builder.applyToAllUnaryMethods(java.lang.Iterable>,com.google.api.core.ApiFunction,java.lang.Void>)" + - "com.google.api.gax.rpc.StubSettings.Builder.getBackgroundExecutorProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getClock()" + - "com.google.api.gax.rpc.StubSettings.Builder.getCredentialsProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getEndpoint()" + - "com.google.api.gax.rpc.StubSettings.Builder.getExecutorProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getGdchApiAudience()" + - "com.google.api.gax.rpc.StubSettings.Builder.getHeaderProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getInternalHeaderProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getMtlsEndpoint()" + - "com.google.api.gax.rpc.StubSettings.Builder.getQuotaProjectId()" + - "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogCheckInterval()" + - "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.getTracerFactory()" + - "com.google.api.gax.rpc.StubSettings.Builder.getTransportChannelProvider()" + - "com.google.api.gax.rpc.StubSettings.Builder.self()" + - "com.google.api.gax.rpc.StubSettings.Builder.setBackgroundExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setClock(com.google.api.core.ApiClock)" + - "com.google.api.gax.rpc.StubSettings.Builder.setCredentialsProvider(com.google.api.gax.core.CredentialsProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setEndpoint(java.lang.String)" + - "com.google.api.gax.rpc.StubSettings.Builder.setExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setGdchApiAudience(java.lang.String)" + - "com.google.api.gax.rpc.StubSettings.Builder.setHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setInternalHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setMtlsEndpoint(java.lang.String)" + - "com.google.api.gax.rpc.StubSettings.Builder.setQuotaProjectId(java.lang.String)" + - "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogCheckInterval(org.threeten.bp.Duration)" + - "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogProvider(com.google.api.gax.rpc.WatchdogProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setSwitchToMtlsEndpointAllowed(boolean)" + - "com.google.api.gax.rpc.StubSettings.Builder.setTracerFactory(com.google.api.gax.tracing.ApiTracerFactory)" + - "com.google.api.gax.rpc.StubSettings.Builder.setTransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider)" + - "com.google.api.gax.rpc.StubSettings.Builder.setUniverseDomain(java.lang.String)" + - "com.google.api.gax.rpc.StubSettings.Builder.toString()" + - "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.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder()" + id: "Builder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "Builder()" + nameWithType: "SpeechStubSettings.Builder.Builder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "protected Builder()" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(com.google.api.gax.rpc.ClientContext)" + id: "Builder(com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "Builder(ClientContext clientContext)" + nameWithType: "SpeechStubSettings.Builder.Builder(ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "protected Builder(ClientContext clientContext)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + id: "Builder(com.microsoft.samples.google.v1.stub.SpeechStubSettings)" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "Builder(SpeechStubSettings settings)" + nameWithType: "SpeechStubSettings.Builder.Builder(SpeechStubSettings settings)" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder(SpeechStubSettings settings)" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "protected Builder(SpeechStubSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods(com.google.api.core.ApiFunction,java.lang.Void>)" + id: "applyToAllUnaryMethods(com.google.api.core.ApiFunction,java.lang.Void>)" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "applyToAllUnaryMethods(ApiFunction,Void> settingsUpdater)" + nameWithType: "SpeechStubSettings.Builder.applyToAllUnaryMethods(ApiFunction,Void> settingsUpdater)" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods(ApiFunction,Void> settingsUpdater)" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Applies the given settings updater function to all of the unary API methods in this service.\n\n

Note: This method does not support applying settings to streaming methods." + syntax: + content: "public SpeechStubSettings.Builder applyToAllUnaryMethods(ApiFunction,Void> settingsUpdater)" + parameters: + - id: "settingsUpdater" + type: "com.google.api.core.ApiFunction,java.lang.Void>" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.build()" + id: "build()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "build()" + nameWithType: "SpeechStubSettings.Builder.build()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.build()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.build*" + overridden: "com.google.api.gax.rpc.StubSettings.Builder.build()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public SpeechStubSettings build()" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + exceptions: + - type: "java.io.IOException" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings()" + id: "longRunningRecognizeOperationSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "longRunningRecognizeOperationSettings()" + nameWithType: "SpeechStubSettings.Builder.longRunningRecognizeOperationSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "

\n\n\nReturns the builder for the settings used for calls to longRunningRecognize." + syntax: + content: "public OperationCallSettings.Builder longRunningRecognizeOperationSettings()" + return: + type: "com.google.api.gax.rpc.OperationCallSettings.Builder" + status: "beta" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings()" + id: "longRunningRecognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "longRunningRecognizeSettings()" + nameWithType: "SpeechStubSettings.Builder.longRunningRecognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the builder for the settings used for calls to longRunningRecognize." + syntax: + content: "public UnaryCallSettings.Builder longRunningRecognizeSettings()" + return: + type: "com.google.api.gax.rpc.UnaryCallSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.recognizeSettings()" + id: "recognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "recognizeSettings()" + nameWithType: "SpeechStubSettings.Builder.recognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.recognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.recognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the builder for the settings used for calls to recognize." + syntax: + content: "public UnaryCallSettings.Builder recognizeSettings()" + return: + type: "com.google.api.gax.rpc.UnaryCallSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.streamingRecognizeSettings()" + id: "streamingRecognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "streamingRecognizeSettings()" + nameWithType: "SpeechStubSettings.Builder.streamingRecognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.streamingRecognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.streamingRecognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the builder for the settings used for calls to streamingRecognize." + syntax: + content: "public StreamingCallSettings.Builder streamingRecognizeSettings()" + return: + type: "com.google.api.gax.rpc.StreamingCallSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders()" + id: "unaryMethodSettingsBuilders()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + langs: + - "java" + name: "unaryMethodSettingsBuilders()" + nameWithType: "SpeechStubSettings.Builder.unaryMethodSettingsBuilders()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public ImmutableList> unaryMethodSettingsBuilders()" + return: + type: "com.google.common.collect.ImmutableList>" +references: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder*" + name: "Builder" + nameWithType: "SpeechStubSettings.Builder.Builder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.Builder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.ClientContext" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.ClientContext" + name: "ClientContext" + fullName: "com.google.api.gax.rpc.ClientContext" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + name: "SpeechStubSettings" + nameWithType: "SpeechStubSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" +- uid: "com.google.api.core.ApiFunction,java.lang.Void>" + isExternal: true + spec.java: + - uid: "com.google.api.core.ApiFunction" + name: "ApiFunction" + fullName: "com.google.api.core.ApiFunction" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "?" + name: "?" + fullName: "?" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "?" + name: "?" + fullName: "?" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "java.lang.Void" + name: "Void" + fullName: "java.lang.Void" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html" + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods*" + name: "applyToAllUnaryMethods" + nameWithType: "SpeechStubSettings.Builder.applyToAllUnaryMethods" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.applyToAllUnaryMethods" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.common.collect.ImmutableList>" + spec.java: + - uid: "com.google.common.collect.ImmutableList" + name: "ImmutableList" + fullName: "com.google.common.collect.ImmutableList" + isExternal: false + - name: "<" + fullName: "<" + isExternal: false + - uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + isExternal: true + - name: "<" + fullName: "<" + isExternal: false + - uid: "?" + name: "?" + fullName: "?" + isExternal: false + - name: "," + fullName: "," + isExternal: false + - uid: "?" + name: "?" + fullName: "?" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders*" + name: "unaryMethodSettingsBuilders" + nameWithType: "SpeechStubSettings.Builder.unaryMethodSettingsBuilders" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.unaryMethodSettingsBuilders" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + 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.stub.SpeechStubSettings.Builder.recognizeSettings*" + name: "recognizeSettings" + nameWithType: "SpeechStubSettings.Builder.recognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.recognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + 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.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings*" + name: "longRunningRecognizeSettings" + nameWithType: "SpeechStubSettings.Builder.longRunningRecognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.OperationCallSettings.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.OperationCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.OperationCallSettings.Builder" + 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.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings*" + name: "longRunningRecognizeOperationSettings" + nameWithType: "SpeechStubSettings.Builder.longRunningRecognizeOperationSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.longRunningRecognizeOperationSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.StreamingCallSettings.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.StreamingCallSettings.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.StreamingCallSettings.Builder" + 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.stub.SpeechStubSettings.Builder.streamingRecognizeSettings*" + name: "streamingRecognizeSettings" + nameWithType: "SpeechStubSettings.Builder.streamingRecognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.streamingRecognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStubSettings.Builder.build*" + name: "build" + nameWithType: "SpeechStubSettings.Builder.build" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder.build" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.StubSettings.Builder" + isExternal: true + name: "StubSettings.Builder" + nameWithType: "StubSettings.Builder" + fullName: "com.google.api.gax.rpc.StubSettings.Builder" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getCredentialsProvider()" + isExternal: true + name: "StubSettings.Builder.getCredentialsProvider()" + nameWithType: "StubSettings.Builder.getCredentialsProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getCredentialsProvider()" +- 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: "com.google.api.gax.rpc.StubSettings.Builder.setEndpoint(java.lang.String)" + isExternal: true + name: "StubSettings.Builder.setEndpoint(String)" + nameWithType: "StubSettings.Builder.setEndpoint(String)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setEndpoint(java.lang.String)" +- 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: "com.google.api.gax.rpc.StubSettings.Builder.getClock()" + isExternal: true + name: "StubSettings.Builder.getClock()" + nameWithType: "StubSettings.Builder.getClock()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getClock()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getBackgroundExecutorProvider()" + isExternal: true + name: "StubSettings.Builder.getBackgroundExecutorProvider()" + nameWithType: "StubSettings.Builder.getBackgroundExecutorProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getBackgroundExecutorProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getGdchApiAudience()" + isExternal: true + name: "StubSettings.Builder.getGdchApiAudience()" + nameWithType: "StubSettings.Builder.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getGdchApiAudience()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setClock(com.google.api.core.ApiClock)" + isExternal: true + name: "StubSettings.Builder.setClock(ApiClock)" + nameWithType: "StubSettings.Builder.setClock(ApiClock)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setClock(com.google.api.core.ApiClock)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setGdchApiAudience(java.lang.String)" + isExternal: true + name: "StubSettings.Builder.setGdchApiAudience(String)" + nameWithType: "StubSettings.Builder.setGdchApiAudience(String)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setGdchApiAudience(java.lang.String)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setTransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider)" + isExternal: true + name: "StubSettings.Builder.setTransportChannelProvider(TransportChannelProvider)" + nameWithType: "StubSettings.Builder.setTransportChannelProvider(TransportChannelProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setTransportChannelProvider(com.google.api.gax.rpc.TransportChannelProvider)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogCheckInterval(org.threeten.bp.Duration)" + isExternal: true + name: "StubSettings.Builder.setStreamWatchdogCheckInterval(Duration)" + nameWithType: "StubSettings.Builder.setStreamWatchdogCheckInterval(Duration)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogCheckInterval(org.threeten.bp.Duration)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setTracerFactory(com.google.api.gax.tracing.ApiTracerFactory)" + isExternal: true + name: "StubSettings.Builder.setTracerFactory(ApiTracerFactory)" + nameWithType: "StubSettings.Builder.setTracerFactory(ApiTracerFactory)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setTracerFactory(com.google.api.gax.tracing.ApiTracerFactory)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setUniverseDomain(java.lang.String)" + isExternal: true + name: "StubSettings.Builder.setUniverseDomain(String)" + nameWithType: "StubSettings.Builder.setUniverseDomain(String)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setUniverseDomain(java.lang.String)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setSwitchToMtlsEndpointAllowed(boolean)" + isExternal: true + name: "StubSettings.Builder.setSwitchToMtlsEndpointAllowed(boolean)" + nameWithType: "StubSettings.Builder.setSwitchToMtlsEndpointAllowed(boolean)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setSwitchToMtlsEndpointAllowed(boolean)" +- 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.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.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: "com.google.api.gax.rpc.StubSettings.Builder.toString()" + isExternal: true + name: "StubSettings.Builder.toString()" + nameWithType: "StubSettings.Builder.toString()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.toString()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.self()" + isExternal: true + name: "StubSettings.Builder.self()" + nameWithType: "StubSettings.Builder.self()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.self()" +- 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: "com.google.api.gax.rpc.StubSettings.Builder.setInternalHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" + isExternal: true + name: "StubSettings.Builder.setInternalHeaderProvider(HeaderProvider)" + nameWithType: "StubSettings.Builder.setInternalHeaderProvider(HeaderProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setInternalHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" +- 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.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: "com.google.api.gax.rpc.StubSettings.Builder.setBackgroundExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + isExternal: true + name: "StubSettings.Builder.setBackgroundExecutorProvider(ExecutorProvider)" + nameWithType: "StubSettings.Builder.setBackgroundExecutorProvider(ExecutorProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setBackgroundExecutorProvider(com.google.api.gax.core.ExecutorProvider)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" + isExternal: true + name: "StubSettings.Builder.setHeaderProvider(HeaderProvider)" + nameWithType: "StubSettings.Builder.setHeaderProvider(HeaderProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setHeaderProvider(com.google.api.gax.rpc.HeaderProvider)" +- 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: "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogProvider()" + isExternal: true + name: "StubSettings.Builder.getStreamWatchdogProvider()" + nameWithType: "StubSettings.Builder.getStreamWatchdogProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogCheckInterval()" + isExternal: true + name: "StubSettings.Builder.getStreamWatchdogCheckInterval()" + nameWithType: "StubSettings.Builder.getStreamWatchdogCheckInterval()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getStreamWatchdogCheckInterval()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setMtlsEndpoint(java.lang.String)" + isExternal: true + name: "StubSettings.Builder.setMtlsEndpoint(String)" + nameWithType: "StubSettings.Builder.setMtlsEndpoint(String)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setMtlsEndpoint(java.lang.String)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogProvider(com.google.api.gax.rpc.WatchdogProvider)" + isExternal: true + name: "StubSettings.Builder.setStreamWatchdogProvider(WatchdogProvider)" + nameWithType: "StubSettings.Builder.setStreamWatchdogProvider(WatchdogProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setStreamWatchdogProvider(com.google.api.gax.rpc.WatchdogProvider)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getHeaderProvider()" + isExternal: true + name: "StubSettings.Builder.getHeaderProvider()" + nameWithType: "StubSettings.Builder.getHeaderProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getHeaderProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setQuotaProjectId(java.lang.String)" + isExternal: true + name: "StubSettings.Builder.setQuotaProjectId(String)" + nameWithType: "StubSettings.Builder.setQuotaProjectId(String)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setQuotaProjectId(java.lang.String)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getTracerFactory()" + isExternal: true + name: "StubSettings.Builder.getTracerFactory()" + nameWithType: "StubSettings.Builder.getTracerFactory()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getTracerFactory()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setExecutorProvider(com.google.api.gax.core.ExecutorProvider)" + isExternal: true + name: "StubSettings.Builder.setExecutorProvider(ExecutorProvider)" + nameWithType: "StubSettings.Builder.setExecutorProvider(ExecutorProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setExecutorProvider(com.google.api.gax.core.ExecutorProvider)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.applyToAllUnaryMethods(java.lang.Iterable>,com.google.api.core.ApiFunction,java.lang.Void>)" + isExternal: true + name: "StubSettings.Builder.applyToAllUnaryMethods(Iterable>,ApiFunction,Void>)" + nameWithType: "StubSettings.Builder.applyToAllUnaryMethods(Iterable>,ApiFunction,Void>)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.applyToAllUnaryMethods(java.lang.Iterable>,com.google.api.core.ApiFunction,java.lang.Void>)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getEndpoint()" + isExternal: true + name: "StubSettings.Builder.getEndpoint()" + nameWithType: "StubSettings.Builder.getEndpoint()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getEndpoint()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getExecutorProvider()" + isExternal: true + name: "StubSettings.Builder.getExecutorProvider()" + nameWithType: "StubSettings.Builder.getExecutorProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getExecutorProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.setCredentialsProvider(com.google.api.gax.core.CredentialsProvider)" + isExternal: true + name: "StubSettings.Builder.setCredentialsProvider(CredentialsProvider)" + nameWithType: "StubSettings.Builder.setCredentialsProvider(CredentialsProvider)" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.setCredentialsProvider(com.google.api.gax.core.CredentialsProvider)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getMtlsEndpoint()" + isExternal: true + name: "StubSettings.Builder.getMtlsEndpoint()" + nameWithType: "StubSettings.Builder.getMtlsEndpoint()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getMtlsEndpoint()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getTransportChannelProvider()" + isExternal: true + name: "StubSettings.Builder.getTransportChannelProvider()" + nameWithType: "StubSettings.Builder.getTransportChannelProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getTransportChannelProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.build()" + isExternal: true + name: "StubSettings.Builder.build()" + nameWithType: "StubSettings.Builder.build()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.build()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getQuotaProjectId()" + isExternal: true + name: "StubSettings.Builder.getQuotaProjectId()" + nameWithType: "StubSettings.Builder.getQuotaProjectId()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getQuotaProjectId()" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.getInternalHeaderProvider()" + isExternal: true + name: "StubSettings.Builder.getInternalHeaderProvider()" + nameWithType: "StubSettings.Builder.getInternalHeaderProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.getInternalHeaderProvider()" +- uid: "com.google.api.gax.rpc.UnaryCallSettings.Builder" + isExternal: true + name: "UnaryCallSettings.Builder" + nameWithType: "UnaryCallSettings.Builder" + fullName: "com.google.api.gax.rpc.UnaryCallSettings.Builder" +- uid: "?,?>,java.lang.Void" + name: "?,?>,Void" + nameWithType: "?,?>,Void" + fullName: "?,?>,java.lang.Void" +- uid: "com.google.api.core.ApiFunction" + isExternal: true + name: "ApiFunction" + nameWithType: "ApiFunction" + fullName: "com.google.api.core.ApiFunction" +- uid: "?,?" + name: "?,?" + nameWithType: "?,?" + fullName: "?,?" +- uid: "com.google.common.collect.ImmutableList" + name: "ImmutableList" + nameWithType: "ImmutableList" + fullName: "com.google.common.collect.ImmutableList" +- 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.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.OperationCallSettings.Builder" + isExternal: true + name: "OperationCallSettings.Builder" + nameWithType: "OperationCallSettings.Builder" + fullName: "com.google.api.gax.rpc.OperationCallSettings.Builder" +- 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.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" +- uid: "com.google.api.gax.rpc.StreamingCallSettings.Builder" + isExternal: true + name: "StreamingCallSettings.Builder" + nameWithType: "StreamingCallSettings.Builder" + fullName: "com.google.api.gax.rpc.StreamingCallSettings.Builder" +- uid: "com.google.api.gax.rpc.StubSettings.Builder" + isExternal: true + name: "StubSettings.Builder" + nameWithType: "StubSettings.Builder" + fullName: "com.google.api.gax.rpc.StubSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + name: "SpeechStubSettings,SpeechStubSettings.Builder" + nameWithType: "SpeechStubSettings,SpeechStubSettings.Builder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings,com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" +- uid: "com.google.api.gax.rpc.StubSettings.Builder.applyToAllUnaryMethods(java.lang.Iterable" + isExternal: true + name: "StubSettings.Builder.applyToAllUnaryMethods(Iterable" + nameWithType: "StubSettings.Builder.applyToAllUnaryMethods(Iterable" + fullName: "com.google.api.gax.rpc.StubSettings.Builder.applyToAllUnaryMethods(java.lang.Iterable" +- uid: "?,?>>,com.google.api.core.ApiFunction" + name: "?,?>>,ApiFunction" + nameWithType: "?,?>>,ApiFunction" + fullName: "?,?>>,com.google.api.core.ApiFunction" +- uid: "?,?>,java.lang.Void>)" + name: "?,?>,Void>)" + nameWithType: "?,?>,Void>)" + fullName: "?,?>,java.lang.Void>)" +- uid: "com.google.api.gax.rpc.StubSettings.Builder." + isExternal: true + name: "StubSettings.Builder." + nameWithType: "StubSettings.Builder." + fullName: "com.google.api.gax.rpc.StubSettings.Builder." +- uid: "B>build()" + name: "B>build()" + nameWithType: "B>build()" + fullName: "B>build()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStubSettings.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStubSettings.yml new file mode 100644 index 00000000..7cf8bb9a --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.SpeechStubSettings.yml @@ -0,0 +1,909 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + id: "SpeechStubSettings" + parent: "com.microsoft.samples.google.v1.stub" + children: + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings(com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder)" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeOperationSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder(com.google.api.gax.rpc.ClientContext)" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.recognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.streamingRecognizeSettings()" + - "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder()" + langs: + - "java" + name: "SpeechStubSettings" + nameWithType: "SpeechStubSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + type: "Class" + package: "com.microsoft.samples.google.v1.stub" + summary: "Settings class to configure an instance of com.google.cloud.speech.v1p1beta1.stub.SpeechStub.\n\n

The default instance has everything set to sensible defaults:\n\n

    \n
  • The default service address (speech.googleapis.com) and default port (443) are used.\n
  • Credentials are acquired automatically through Application Default Credentials.\n
  • Retries are configured for idempotent methods but not for non-idempotent methods.\n
\n\n

The builder of this class is recursive, so contained classes are themselves builders. When\n build() is called, the tree of builders is called to create the complete settings object.\n\n

For example, to set the total timeout of recognize to 30 seconds:\n\n

\n // This snippet has been automatically generated and should be regarded as a code template only.\n // It will require modifications to work:\n // - It may require correct/in-range values for request initialization.\n // - It may require specifying regional endpoints when creating the service client as shown in\n // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library\n SpeechStubSettings.Builder speechSettingsBuilder = SpeechStubSettings.newBuilder();\n speechSettingsBuilder\n     .recognizeSettings()\n     .setRetrySettings(\n         speechSettingsBuilder\n             .recognizeSettings()\n             .getRetrySettings()\n             .toBuilder()\n             .setTotalTimeout(Duration.ofSeconds(30))\n             .build());\n SpeechStubSettings speechSettings = speechSettingsBuilder.build();\n 
" + syntax: + content: "public class SpeechStubSettings extends StubSettings" + inheritance: + - "java.lang.Object" + - "com.google.api.gax.rpc.StubSettings" + inheritedMembers: + - "com.google.api.gax.rpc.StubSettings.getBackgroundExecutorProvider()" + - "com.google.api.gax.rpc.StubSettings.getClock()" + - "com.google.api.gax.rpc.StubSettings.getCredentialsProvider()" + - "com.google.api.gax.rpc.StubSettings.getEndpoint()" + - "com.google.api.gax.rpc.StubSettings.getExecutorProvider()" + - "com.google.api.gax.rpc.StubSettings.getGdchApiAudience()" + - "com.google.api.gax.rpc.StubSettings.getHeaderProvider()" + - "com.google.api.gax.rpc.StubSettings.getInternalHeaderProvider()" + - "com.google.api.gax.rpc.StubSettings.getMtlsEndpoint()" + - "com.google.api.gax.rpc.StubSettings.getQuotaProjectId()" + - "com.google.api.gax.rpc.StubSettings.getServiceName()" + - "com.google.api.gax.rpc.StubSettings.getStreamWatchdogCheckInterval()" + - "com.google.api.gax.rpc.StubSettings.getStreamWatchdogProvider()" + - "com.google.api.gax.rpc.StubSettings.getTracerFactory()" + - "com.google.api.gax.rpc.StubSettings.getTransportChannelProvider()" + - "com.google.api.gax.rpc.StubSettings.getUniverseDomain()" + - "com.google.api.gax.rpc.StubSettings.toBuilder()" + - "com.google.api.gax.rpc.StubSettings.toString()" + - "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.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" + status: "beta" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings(com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder)" + id: "SpeechStubSettings(com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder)" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "SpeechStubSettings(SpeechStubSettings.Builder settingsBuilder)" + nameWithType: "SpeechStubSettings.SpeechStubSettings(SpeechStubSettings.Builder settingsBuilder)" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings(SpeechStubSettings.Builder settingsBuilder)" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings*" + type: "Constructor" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "protected SpeechStubSettings(SpeechStubSettings.Builder settingsBuilder)" + parameters: + - id: "settingsBuilder" + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub()" + id: "createStub()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "createStub()" + nameWithType: "SpeechStubSettings.createStub()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public SpeechStub createStub()" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStub" + exceptions: + - type: "java.io.IOException" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder()" + id: "defaultApiClientHeaderProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultApiClientHeaderProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultApiClientHeaderProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()" + return: + type: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder()" + id: "defaultCredentialsProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultCredentialsProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultCredentialsProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a builder for the default credentials for this service." + syntax: + content: "public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()" + return: + type: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder()" + id: "defaultExecutorProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultExecutorProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultExecutorProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a builder for the default ExecutorProvider for this service." + syntax: + content: "public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()" + return: + type: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder()" + id: "defaultGrpcApiClientHeaderProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultGrpcApiClientHeaderProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "\n" + syntax: + content: "public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder()" + return: + type: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + status: "beta" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder()" + id: "defaultGrpcTransportProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultGrpcTransportProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultGrpcTransportProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a builder for the default gRPC ChannelProvider for this service." + syntax: + content: "public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()" + return: + type: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder()" + id: "defaultHttpJsonApiClientHeaderProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultHttpJsonApiClientHeaderProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "\n" + syntax: + content: "public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder()" + return: + type: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + status: "beta" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder()" + id: "defaultHttpJsonTransportProviderBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultHttpJsonTransportProviderBuilder()" + nameWithType: "SpeechStubSettings.defaultHttpJsonTransportProviderBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "\n\n\nReturns a builder for the default REST ChannelProvider for this service." + syntax: + content: "public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()" + return: + type: "com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder" + status: "beta" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider()" + id: "defaultTransportChannelProvider()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "defaultTransportChannelProvider()" + nameWithType: "SpeechStubSettings.defaultTransportChannelProvider()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + syntax: + content: "public static TransportChannelProvider defaultTransportChannelProvider()" + return: + type: "com.google.api.gax.rpc.TransportChannelProvider" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint()" + id: "getDefaultEndpoint()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "getDefaultEndpoint()" + nameWithType: "SpeechStubSettings.getDefaultEndpoint()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the default service endpoint." + syntax: + content: "public static String getDefaultEndpoint()" + return: + type: "java.lang.String" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint()" + id: "getDefaultMtlsEndpoint()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "getDefaultMtlsEndpoint()" + nameWithType: "SpeechStubSettings.getDefaultMtlsEndpoint()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the default mTLS service endpoint." + syntax: + content: "public static String getDefaultMtlsEndpoint()" + return: + type: "java.lang.String" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes()" + id: "getDefaultServiceScopes()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "getDefaultServiceScopes()" + nameWithType: "SpeechStubSettings.getDefaultServiceScopes()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the default service scopes." + syntax: + content: "public static List getDefaultServiceScopes()" + return: + type: "java.util.List" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeOperationSettings()" + id: "longRunningRecognizeOperationSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "longRunningRecognizeOperationSettings()" + nameWithType: "SpeechStubSettings.longRunningRecognizeOperationSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeOperationSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeOperationSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the object with the settings used for calls to longRunningRecognize." + syntax: + content: "public OperationCallSettings longRunningRecognizeOperationSettings()" + return: + type: "com.google.api.gax.rpc.OperationCallSettings" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeSettings()" + id: "longRunningRecognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "longRunningRecognizeSettings()" + nameWithType: "SpeechStubSettings.longRunningRecognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the object with the settings used for calls to longRunningRecognize." + syntax: + content: "public UnaryCallSettings longRunningRecognizeSettings()" + return: + type: "com.google.api.gax.rpc.UnaryCallSettings" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder()" + id: "newBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "newBuilder()" + nameWithType: "SpeechStubSettings.newBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a new gRPC builder for this class." + syntax: + content: "public static SpeechStubSettings.Builder newBuilder()" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder(com.google.api.gax.rpc.ClientContext)" + id: "newBuilder(com.google.api.gax.rpc.ClientContext)" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "newBuilder(ClientContext clientContext)" + nameWithType: "SpeechStubSettings.newBuilder(ClientContext clientContext)" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder(ClientContext clientContext)" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a new builder for this class." + syntax: + content: "public static SpeechStubSettings.Builder newBuilder(ClientContext clientContext)" + parameters: + - id: "clientContext" + type: "com.google.api.gax.rpc.ClientContext" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder()" + id: "newHttpJsonBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "newHttpJsonBuilder()" + nameWithType: "SpeechStubSettings.newHttpJsonBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a new REST builder for this class." + syntax: + content: "public static SpeechStubSettings.Builder newHttpJsonBuilder()" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + javaType: "static method" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.recognizeSettings()" + id: "recognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "recognizeSettings()" + nameWithType: "SpeechStubSettings.recognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.recognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.recognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the object with the settings used for calls to recognize." + syntax: + content: "public UnaryCallSettings recognizeSettings()" + return: + type: "com.google.api.gax.rpc.UnaryCallSettings" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.streamingRecognizeSettings()" + id: "streamingRecognizeSettings()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "streamingRecognizeSettings()" + nameWithType: "SpeechStubSettings.streamingRecognizeSettings()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.streamingRecognizeSettings()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.streamingRecognizeSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns the object with the settings used for calls to streamingRecognize." + syntax: + content: "public StreamingCallSettings streamingRecognizeSettings()" + return: + type: "com.google.api.gax.rpc.StreamingCallSettings" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder()" + id: "toBuilder()" + parent: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + langs: + - "java" + name: "toBuilder()" + nameWithType: "SpeechStubSettings.toBuilder()" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder()" + overload: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder*" + overridden: "com.google.api.gax.rpc.StubSettings.toBuilder()" + type: "Method" + package: "com.microsoft.samples.google.v1.stub" + summary: "Returns a builder containing all the values of this settings class." + syntax: + content: "public SpeechStubSettings.Builder toBuilder()" + return: + type: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" +references: +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + name: "SpeechStubSettings.Builder" + nameWithType: "SpeechStubSettings.Builder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings*" + name: "SpeechStubSettings" + nameWithType: "SpeechStubSettings.SpeechStubSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.SpeechStubSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.UnaryCallSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallSettings" + name: "UnaryCallSettings" + fullName: "com.google.api.gax.rpc.UnaryCallSettings" + 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.stub.SpeechStubSettings.recognizeSettings*" + name: "recognizeSettings" + nameWithType: "SpeechStubSettings.recognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.recognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.UnaryCallSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.UnaryCallSettings" + name: "UnaryCallSettings" + fullName: "com.google.api.gax.rpc.UnaryCallSettings" + 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.stub.SpeechStubSettings.longRunningRecognizeSettings*" + name: "longRunningRecognizeSettings" + nameWithType: "SpeechStubSettings.longRunningRecognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.OperationCallSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.OperationCallSettings" + name: "OperationCallSettings" + fullName: "com.google.api.gax.rpc.OperationCallSettings" + 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.stub.SpeechStubSettings.longRunningRecognizeOperationSettings*" + name: "longRunningRecognizeOperationSettings" + nameWithType: "SpeechStubSettings.longRunningRecognizeOperationSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.longRunningRecognizeOperationSettings" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.StreamingCallSettings" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.StreamingCallSettings" + name: "StreamingCallSettings" + fullName: "com.google.api.gax.rpc.StreamingCallSettings" + 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.stub.SpeechStubSettings.streamingRecognizeSettings*" + name: "streamingRecognizeSettings" + nameWithType: "SpeechStubSettings.streamingRecognizeSettings" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.streamingRecognizeSettings" + package: "com.microsoft.samples.google.v1.stub" +- 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.stub.SpeechStub" + name: "SpeechStub" + nameWithType: "SpeechStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub*" + name: "createStub" + nameWithType: "SpeechStubSettings.createStub" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.createStub" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + name: "Builder" + fullName: "com.google.api.gax.core.InstantiatingExecutorProvider.Builder" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder*" + name: "defaultExecutorProviderBuilder" + nameWithType: "SpeechStubSettings.defaultExecutorProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultExecutorProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "java.lang.String" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" + spec.java: + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint*" + name: "getDefaultEndpoint" + nameWithType: "SpeechStubSettings.getDefaultEndpoint" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultEndpoint" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint*" + name: "getDefaultMtlsEndpoint" + nameWithType: "SpeechStubSettings.getDefaultMtlsEndpoint" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultMtlsEndpoint" + package: "com.microsoft.samples.google.v1.stub" +- uid: "java.util.List" + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + spec.java: + - uid: "java.util.List" + name: "List" + fullName: "java.util.List" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + - name: "<" + fullName: "<" + isExternal: false + - uid: "java.lang.String" + name: "String" + fullName: "java.lang.String" + isExternal: false + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/String.html" + - name: ">" + fullName: ">" + isExternal: false +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes*" + name: "getDefaultServiceScopes" + nameWithType: "SpeechStubSettings.getDefaultServiceScopes" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.getDefaultServiceScopes" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + name: "Builder" + fullName: "com.google.api.gax.core.GoogleCredentialsProvider.Builder" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder*" + name: "defaultCredentialsProviderBuilder" + nameWithType: "SpeechStubSettings.defaultCredentialsProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultCredentialsProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + name: "Builder" + fullName: "com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.Builder" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder*" + name: "defaultGrpcTransportProviderBuilder" + nameWithType: "SpeechStubSettings.defaultGrpcTransportProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcTransportProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder" + name: "Builder" + fullName: "com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider.Builder" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder*" + name: "defaultHttpJsonTransportProviderBuilder" + nameWithType: "SpeechStubSettings.defaultHttpJsonTransportProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonTransportProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.TransportChannelProvider" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.TransportChannelProvider" + name: "TransportChannelProvider" + fullName: "com.google.api.gax.rpc.TransportChannelProvider" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider*" + name: "defaultTransportChannelProvider" + nameWithType: "SpeechStubSettings.defaultTransportChannelProvider" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultTransportChannelProvider" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + name: "Builder" + fullName: "com.google.api.gax.rpc.ApiClientHeaderProvider.Builder" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder*" + name: "defaultGrpcApiClientHeaderProviderBuilder" + nameWithType: "SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultGrpcApiClientHeaderProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder*" + name: "defaultHttpJsonApiClientHeaderProviderBuilder" + nameWithType: "SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultHttpJsonApiClientHeaderProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder*" + name: "defaultApiClientHeaderProviderBuilder" + nameWithType: "SpeechStubSettings.defaultApiClientHeaderProviderBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.defaultApiClientHeaderProviderBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder*" + name: "newBuilder" + nameWithType: "SpeechStubSettings.newBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder*" + name: "newHttpJsonBuilder" + nameWithType: "SpeechStubSettings.newHttpJsonBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.newHttpJsonBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.ClientContext" + isExternal: true + spec.java: + - uid: "com.google.api.gax.rpc.ClientContext" + name: "ClientContext" + fullName: "com.google.api.gax.rpc.ClientContext" + isExternal: true +- uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder*" + name: "toBuilder" + nameWithType: "SpeechStubSettings.toBuilder" + fullName: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.toBuilder" + package: "com.microsoft.samples.google.v1.stub" +- uid: "com.google.api.gax.rpc.StubSettings" + isExternal: true + name: "StubSettings" + nameWithType: "StubSettings" + fullName: "com.google.api.gax.rpc.StubSettings" +- uid: "com.google.api.gax.rpc.StubSettings.toString()" + isExternal: true + name: "StubSettings.toString()" + nameWithType: "StubSettings.toString()" + fullName: "com.google.api.gax.rpc.StubSettings.toString()" +- 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: "com.google.api.gax.rpc.StubSettings.getEndpoint()" + isExternal: true + name: "StubSettings.getEndpoint()" + nameWithType: "StubSettings.getEndpoint()" + fullName: "com.google.api.gax.rpc.StubSettings.getEndpoint()" +- 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: "com.google.api.gax.rpc.StubSettings.getGdchApiAudience()" + isExternal: true + name: "StubSettings.getGdchApiAudience()" + nameWithType: "StubSettings.getGdchApiAudience()" + fullName: "com.google.api.gax.rpc.StubSettings.getGdchApiAudience()" +- uid: "com.google.api.gax.rpc.StubSettings.getTransportChannelProvider()" + isExternal: true + name: "StubSettings.getTransportChannelProvider()" + nameWithType: "StubSettings.getTransportChannelProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getTransportChannelProvider()" +- 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: "com.google.api.gax.rpc.StubSettings.getStreamWatchdogCheckInterval()" + isExternal: true + name: "StubSettings.getStreamWatchdogCheckInterval()" + nameWithType: "StubSettings.getStreamWatchdogCheckInterval()" + fullName: "com.google.api.gax.rpc.StubSettings.getStreamWatchdogCheckInterval()" +- uid: "com.google.api.gax.rpc.StubSettings.getInternalHeaderProvider()" + isExternal: true + name: "StubSettings.getInternalHeaderProvider()" + nameWithType: "StubSettings.getInternalHeaderProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getInternalHeaderProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.getHeaderProvider()" + isExternal: true + name: "StubSettings.getHeaderProvider()" + nameWithType: "StubSettings.getHeaderProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getHeaderProvider()" +- 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.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.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: "com.google.api.gax.rpc.StubSettings.getTracerFactory()" + isExternal: true + name: "StubSettings.getTracerFactory()" + nameWithType: "StubSettings.getTracerFactory()" + fullName: "com.google.api.gax.rpc.StubSettings.getTracerFactory()" +- 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: "com.google.api.gax.rpc.StubSettings.getQuotaProjectId()" + isExternal: true + name: "StubSettings.getQuotaProjectId()" + nameWithType: "StubSettings.getQuotaProjectId()" + fullName: "com.google.api.gax.rpc.StubSettings.getQuotaProjectId()" +- uid: "com.google.api.gax.rpc.StubSettings.getServiceName()" + isExternal: true + name: "StubSettings.getServiceName()" + nameWithType: "StubSettings.getServiceName()" + fullName: "com.google.api.gax.rpc.StubSettings.getServiceName()" +- 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: "com.google.api.gax.rpc.StubSettings.toBuilder()" + isExternal: true + name: "StubSettings.toBuilder()" + nameWithType: "StubSettings.toBuilder()" + fullName: "com.google.api.gax.rpc.StubSettings.toBuilder()" +- uid: "com.google.api.gax.rpc.StubSettings.getUniverseDomain()" + isExternal: true + name: "StubSettings.getUniverseDomain()" + nameWithType: "StubSettings.getUniverseDomain()" + fullName: "com.google.api.gax.rpc.StubSettings.getUniverseDomain()" +- 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: "com.google.api.gax.rpc.StubSettings.getStreamWatchdogProvider()" + isExternal: true + name: "StubSettings.getStreamWatchdogProvider()" + nameWithType: "StubSettings.getStreamWatchdogProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getStreamWatchdogProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.getBackgroundExecutorProvider()" + isExternal: true + name: "StubSettings.getBackgroundExecutorProvider()" + nameWithType: "StubSettings.getBackgroundExecutorProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getBackgroundExecutorProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.getExecutorProvider()" + isExternal: true + name: "StubSettings.getExecutorProvider()" + nameWithType: "StubSettings.getExecutorProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getExecutorProvider()" +- uid: "com.google.api.gax.rpc.StubSettings.getClock()" + isExternal: true + name: "StubSettings.getClock()" + nameWithType: "StubSettings.getClock()" + fullName: "com.google.api.gax.rpc.StubSettings.getClock()" +- uid: "com.google.api.gax.rpc.StubSettings.getMtlsEndpoint()" + isExternal: true + name: "StubSettings.getMtlsEndpoint()" + nameWithType: "StubSettings.getMtlsEndpoint()" + fullName: "com.google.api.gax.rpc.StubSettings.getMtlsEndpoint()" +- uid: "com.google.api.gax.rpc.StubSettings.getCredentialsProvider()" + isExternal: true + name: "StubSettings.getCredentialsProvider()" + nameWithType: "StubSettings.getCredentialsProvider()" + fullName: "com.google.api.gax.rpc.StubSettings.getCredentialsProvider()" +- uid: "com.google.api.gax.rpc.UnaryCallSettings" + isExternal: true + name: "UnaryCallSettings" + nameWithType: "UnaryCallSettings" + fullName: "com.google.api.gax.rpc.UnaryCallSettings" +- 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.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.OperationCallSettings" + isExternal: true + name: "OperationCallSettings" + nameWithType: "OperationCallSettings" + fullName: "com.google.api.gax.rpc.OperationCallSettings" +- 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.api.gax.rpc.StreamingCallSettings" + isExternal: true + name: "StreamingCallSettings" + nameWithType: "StreamingCallSettings" + fullName: "com.google.api.gax.rpc.StreamingCallSettings" +- 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" +- uid: "java.util.List" + href: "https://docs.oracle.com/javase/8/docs/api/java/util/List.html" + name: "List" + nameWithType: "List" + fullName: "java.util.List" +- uid: "com.google.api.gax.rpc.StubSettings" + isExternal: true + name: "StubSettings" + nameWithType: "StubSettings" + fullName: "com.google.api.gax.rpc.StubSettings" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md new file mode 100644 index 00000000..6bb92abb --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1.stub.md @@ -0,0 +1,79 @@ +# Package com.microsoft.samples.google.v1.stub (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Stub Package Implications + +This package is a a base stub class. It is for advanced usage and reflects the underlying API directly. +We generally recommend using the non-stub, latest GA package, such as [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1). Use with caution. +## Stub Classes + + + + + + + + + + + + + + + + +
+Stub +Description
com.microsoft.samples.google.v1.stub.GrpcSpeechStub +gRPC stub implementation for the Speech service API. + +

This class is for advanced usage and reflects the underlying API directly.

com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub +REST stub implementation for the Speech service API. + +

This class is for advanced usage and reflects the underlying API directly.

com.microsoft.samples.google.v1.stub.SpeechStub +Base stub class for the Speech service API. + +

This class is for advanced usage and reflects the underlying API directly.

+ +## Settings Classes +Settings classes can be used to configure credentials, endpoints, and retry settings for a Stub. + + + + + + + + +
+Settings +Description
com.microsoft.samples.google.v1.stub.SpeechStubSettings +Settings class to configure an instance of com.google.cloud.speech.v1p1beta1.stub.SpeechStub. + +

The default instance has everything set to sensible defaults: +

+ +## Classes + + + + + + + + +
+Class +Description
com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder +Builder for SpeechStubSettings.
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml index 38c3a709..5626cb39 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml @@ -33,25 +33,11 @@ items: fullName: "com.microsoft.samples.google.v1beta.SpeechClient" type: "Class" package: "com.microsoft.samples.google.v1beta" - 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" + summary: "
GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation
\n\nService 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: {} 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)" + status: "beta" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -63,11 +49,13 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient*" type: "Constructor" package: "com.microsoft.samples.google.v1beta" + summary: "

\n" syntax: content: "protected SpeechClient(SpeechStub stub)" parameters: - id: "stub" type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" id: "SpeechClient(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -138,6 +126,7 @@ items: type: "com.microsoft.samples.google.v1beta.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -149,7 +138,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.create*" type: "Method" package: "com.microsoft.samples.google.v1beta" - summary: "Constructs an instance of SpeechClient, using the given stub for making calls. This is for\n advanced usage - prefer using create(SpeechSettings)." + summary: "\n\n\nConstructs 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: @@ -157,6 +146,8 @@ items: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" return: type: "com.microsoft.samples.google.v1beta.SpeechClient" + status: "beta" + javaType: "static method" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" id: "create(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -178,6 +169,7 @@ items: type: "com.microsoft.samples.google.v1beta.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient()" id: "getOperationsClient()" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -220,10 +212,12 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.getStub*" type: "Method" package: "com.microsoft.samples.google.v1beta" + summary: "\n" syntax: content: "public SpeechStub getStub()" return: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown()" id: "isShutdown()" parent: "com.microsoft.samples.google.v1beta.SpeechClient" @@ -265,7 +259,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 
" + 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: @@ -285,7 +279,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 
" + 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: @@ -308,7 +302,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + 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: @@ -324,7 +318,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeOperationCallable*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 future =\n       speechClient.longRunningRecognizeOperationCallable().futureCall(request);\n   // Do something.\n   LongRunningRecognizeResponse response = future.get();\n }\n 
" + 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: @@ -340,7 +334,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 
" + 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: @@ -363,7 +357,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 
" + 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: @@ -383,7 +377,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.recognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 future = speechClient.recognizeCallable().futureCall(request);\n   // Do something.\n   RecognizeResponse response = future.get();\n }\n 
" + 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: @@ -425,7 +419,7 @@ items: overload: "com.microsoft.samples.google.v1beta.SpeechClient.streamingRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1beta" - 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 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 
" + 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: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md new file mode 100644 index 00000000..95af627b --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.md @@ -0,0 +1,39 @@ +# Package com.microsoft.samples.google.v1beta (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Prerelease Implications + +This package is a prerelease version! Use with caution. + +Prerelease versions are considered unstable as they may be shut down and/or subject to breaking changes when upgrading. +Use them only for testing or if you specifically need their experimental features. + +## Client Classes +Client classes are the main entry point to using a package. +They contain several variations of Java methods for each of the API's methods. + + + + + + + + +
+Client +Description
com.microsoft.samples.google.v1beta.SpeechClient +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:

+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml deleted file mode 100644 index c5c77b4d..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml +++ /dev/null @@ -1,19 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.google.v1beta" - id: "v1beta" - children: - - "com.microsoft.samples.google.v1beta.SpeechClient" - langs: - - "java" - name: "com.microsoft.samples.google.v1beta" - nameWithType: "com.microsoft.samples.google.v1beta" - fullName: "com.microsoft.samples.google.v1beta" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.google.v1beta" -references: -- uid: "com.microsoft.samples.google.v1beta.SpeechClient" - name: "SpeechClient" - nameWithType: "SpeechClient" - fullName: "com.microsoft.samples.google.v1beta.SpeechClient" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml index 0a5497ec..e0c278c4 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml @@ -33,25 +33,11 @@ items: fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient" type: "Class" package: "com.microsoft.samples.google.v1p1alpha" - 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" + summary: "
GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation
\n\nService 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: {} 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)" + status: "beta" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -63,11 +49,13 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient*" type: "Constructor" package: "com.microsoft.samples.google.v1p1alpha" + summary: "

\n" syntax: content: "protected SpeechClient(SpeechStub stub)" parameters: - id: "stub" type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" id: "SpeechClient(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -138,6 +126,7 @@ items: type: "com.microsoft.samples.google.v1p1alpha.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" id: "create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -149,7 +138,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - summary: "Constructs an instance of SpeechClient, using the given stub for making calls. This is for\n advanced usage - prefer using create(SpeechSettings)." + summary: "\n\n\nConstructs 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: @@ -157,6 +146,8 @@ items: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" return: type: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + status: "beta" + javaType: "static method" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" id: "create(com.microsoft.samples.google.SpeechSettings)" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -168,7 +159,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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." + 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. Example broken\n links: http://tools.ietf.org/html/rfc2616#section-3.7 \n ApiFutures#immediateFuture(null)." syntax: content: "public static final SpeechClient create(SpeechSettings settings)" parameters: @@ -178,6 +169,7 @@ items: type: "com.microsoft.samples.google.v1p1alpha.SpeechClient" exceptions: - type: "java.io.IOException" + javaType: "static method" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient()" id: "getOperationsClient()" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -220,10 +212,12 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" + summary: "\n" syntax: content: "public SpeechStub getStub()" return: type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" + status: "beta" - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown()" id: "isShutdown()" parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" @@ -265,7 +259,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 
" + 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: @@ -285,7 +279,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 
" + 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: @@ -308,7 +302,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 future = speechClient.longRunningRecognizeCallable().futureCall(request);\n   // Do something.\n   Operation response = future.get();\n }\n 
" + 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: @@ -324,7 +318,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 future =\n       speechClient.longRunningRecognizeOperationCallable().futureCall(request);\n   // Do something.\n   LongRunningRecognizeResponse response = future.get();\n }\n 
" + 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: @@ -340,7 +334,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 
" + 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: @@ -363,7 +357,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 
" + 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: @@ -383,7 +377,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 future = speechClient.recognizeCallable().futureCall(request);\n   // Do something.\n   RecognizeResponse response = future.get();\n }\n 
" + 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: @@ -425,7 +419,7 @@ items: overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.streamingRecognizeCallable*" type: "Method" package: "com.microsoft.samples.google.v1p1alpha" - 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 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 
" + 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: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md new file mode 100644 index 00000000..1c81a5b4 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.md @@ -0,0 +1,39 @@ +# Package com.microsoft.samples.google.v1p1alpha (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Prerelease Implications + +This package is a prerelease version! Use with caution. + +Prerelease versions are considered unstable as they may be shut down and/or subject to breaking changes when upgrading. +Use them only for testing or if you specifically need their experimental features. + +## Client Classes +Client classes are the main entry point to using a package. +They contain several variations of Java methods for each of the API's methods. + + + + + + + + +
+Client +Description
com.microsoft.samples.google.v1p1alpha.SpeechClient +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:

+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml deleted file mode 100644 index 08ba1571..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml +++ /dev/null @@ -1,19 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.google.v1p1alpha" - id: "v1p1alpha" - children: - - "com.microsoft.samples.google.v1p1alpha.SpeechClient" - langs: - - "java" - name: "com.microsoft.samples.google.v1p1alpha" - nameWithType: "com.microsoft.samples.google.v1p1alpha" - fullName: "com.microsoft.samples.google.v1p1alpha" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.google.v1p1alpha" -references: -- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" - name: "SpeechClient" - nameWithType: "SpeechClient" - fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.yml deleted file mode 100644 index 88353eca..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.yml +++ /dev/null @@ -1,64 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.google" - id: "google" - children: - - "com.microsoft.samples.google.BetaApi" - - "com.microsoft.samples.google.ProductSearchSettings" - - "com.microsoft.samples.google.ProductSearchSettings.Builder" - - "com.microsoft.samples.google.RecognitionAudio" - - "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" - - "com.microsoft.samples.google.SpeechClient" - - "com.microsoft.samples.google.SpeechSettings" - - "com.microsoft.samples.google.SpeechSettings.Builder" - - "com.microsoft.samples.google.ValidationException" - - "com.microsoft.samples.google.ValidationException.Supplier" - langs: - - "java" - name: "com.microsoft.samples.google" - nameWithType: "com.microsoft.samples.google" - fullName: "com.microsoft.samples.google" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.google" -references: -- uid: "com.microsoft.samples.google.BetaApi" - name: "BetaApi" - nameWithType: "BetaApi" - fullName: "com.microsoft.samples.google.BetaApi" -- uid: "com.microsoft.samples.google.ProductSearchSettings" - name: "ProductSearchSettings" - nameWithType: "ProductSearchSettings" - fullName: "com.microsoft.samples.google.ProductSearchSettings" -- uid: "com.microsoft.samples.google.ProductSearchSettings.Builder" - name: "ProductSearchSettings.Builder" - nameWithType: "ProductSearchSettings.Builder" - fullName: "com.microsoft.samples.google.ProductSearchSettings.Builder" -- uid: "com.microsoft.samples.google.RecognitionAudio" - name: "RecognitionAudio" - nameWithType: "RecognitionAudio" - fullName: "com.microsoft.samples.google.RecognitionAudio" -- uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" - name: "RecognitionAudio.AudioSourceCase" - nameWithType: "RecognitionAudio.AudioSourceCase" - fullName: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" -- uid: "com.microsoft.samples.google.SpeechClient" - name: "SpeechClient" - nameWithType: "SpeechClient" - fullName: "com.microsoft.samples.google.SpeechClient" -- uid: "com.microsoft.samples.google.SpeechSettings" - name: "SpeechSettings" - nameWithType: "SpeechSettings" - fullName: "com.microsoft.samples.google.SpeechSettings" -- uid: "com.microsoft.samples.google.SpeechSettings.Builder" - name: "SpeechSettings.Builder" - nameWithType: "SpeechSettings.Builder" - fullName: "com.microsoft.samples.google.SpeechSettings.Builder" -- uid: "com.microsoft.samples.google.ValidationException" - name: "ValidationException" - nameWithType: "ValidationException" - fullName: "com.microsoft.samples.google.ValidationException" -- uid: "com.microsoft.samples.google.ValidationException.Supplier" - name: "ValidationException.Supplier" - nameWithType: "ValidationException.Supplier" - fullName: "com.microsoft.samples.google.ValidationException.Supplier" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md new file mode 100644 index 00000000..90f0188b --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.md @@ -0,0 +1,98 @@ +# Package com.microsoft.samples (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Classes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Class +Description
com.microsoft.samples.BasePartnerComponent +Holds common partner component properties and behavior. All components should inherit from this + class. The context object type.
com.microsoft.samples.BasePartnerComponentString +Holds common partner component properties and behavior. The context is string type by default.
com.microsoft.samples.ExceptionHandler +Exception retry algorithm implementation used by RetryHelper.
com.microsoft.samples.ExceptionHandler.Builder +ExceptionHandler builder.
com.microsoft.samples.KeyValuePair +
com.microsoft.samples.Link +
com.microsoft.samples.Subpackage +
com.microsoft.samples.SuperHero +Hero is the main entity we will be using to something
+ +## Interfaces + + + + + + + + + + + + +
+Interface +Description
com.microsoft.samples.ExceptionHandler.Interceptor +
com.microsoft.samples.IPartner +The main entry point into using the partner SDK functionality. Represents a partner and + encapsulates all the behavior attached to partners. Use this interface to get to the partner's + customers, profiles, and customer orders, profiles and subscriptions and more.
+ +## Enums + + + + + + + + +
+Enum +Description
com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult +
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md new file mode 100644 index 00000000..da7068c9 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.md @@ -0,0 +1,27 @@ +# Package com.microsoft.samples.offers (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Classes + + + + + + + + +
+Class +Description
com.microsoft.samples.offers.Offer +Represents a form of product availability to customer
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.yml deleted file mode 100644 index d046aa55..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.offers.yml +++ /dev/null @@ -1,19 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.offers" - id: "offers" - children: - - "com.microsoft.samples.offers.Offer" - langs: - - "java" - name: "com.microsoft.samples.offers" - nameWithType: "com.microsoft.samples.offers" - fullName: "com.microsoft.samples.offers" - type: "Namespace" - syntax: - content: "package com.microsoft.samples.offers" -references: -- uid: "com.microsoft.samples.offers.Offer" - name: "Offer" - nameWithType: "Offer" - fullName: "com.microsoft.samples.offers.Offer" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage(package).yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage(package).yml deleted file mode 100644 index 89d9b4ce..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage(package).yml +++ /dev/null @@ -1,45 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples.subpackage" - id: "subpackage" - children: - - "com.microsoft.samples.subpackage.CustomException" - - "com.microsoft.samples.subpackage.Display" - - "com.microsoft.samples.subpackage.Person" - - "com.microsoft.samples.subpackage.Person.IdentificationInfo" - - "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" - - "com.microsoft.samples.subpackage.Tuple" - langs: - - "java" - name: "com.microsoft.samples.subpackage" - nameWithType: "com.microsoft.samples.subpackage" - fullName: "com.microsoft.samples.subpackage" - type: "Namespace" - summary: "This subpackage contains the sample set of classes for testing DocFx doclet." - syntax: - content: "package com.microsoft.samples.subpackage" -references: -- uid: "com.microsoft.samples.subpackage.CustomException" - name: "CustomException" - nameWithType: "CustomException" - fullName: "com.microsoft.samples.subpackage.CustomException" -- uid: "com.microsoft.samples.subpackage.Display" - name: "Display" - nameWithType: "Display" - fullName: "com.microsoft.samples.subpackage.Display" -- uid: "com.microsoft.samples.subpackage.Person" - name: "Person" - nameWithType: "Person" - fullName: "com.microsoft.samples.subpackage.Person" -- uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo" - name: "Person.IdentificationInfo" - nameWithType: "Person.IdentificationInfo" - fullName: "com.microsoft.samples.subpackage.Person.IdentificationInfo" -- uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" - name: "Person.IdentificationInfo.Gender" - nameWithType: "Person.IdentificationInfo.Gender" - fullName: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" -- uid: "com.microsoft.samples.subpackage.Tuple" - name: "Tuple" - nameWithType: "Tuple" - fullName: "com.microsoft.samples.subpackage.Tuple" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.CustomException.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.CustomException.yml index 9ecf8bd3..0ff94f3c 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.CustomException.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.CustomException.yml @@ -43,6 +43,7 @@ items: - "java.lang.Throwable.printStackTrace(java.io.PrintWriter)" - "java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[])" - "java.lang.Throwable.toString()" + javaType: "exception" - uid: "com.microsoft.samples.subpackage.CustomException.CustomException(java.lang.String)" id: "CustomException(java.lang.String)" parent: "com.microsoft.samples.subpackage.CustomException" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Display.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Display.yml index 116528a9..a67b1121 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Display.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Display.yml @@ -13,7 +13,7 @@ items: fullName: "com.microsoft.samples.subpackage.Display" type: "Interface" package: "com.microsoft.samples.subpackage" - summary: "Do you see some First code block?\n

\n Or this Second code block?" + summary: "Do you see some First code block?\n\n

Or this Second code block?" syntax: content: "public interface Display extends Serializable, List>" typeParameters: diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml index d20b6979..1fb375dd 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.yml @@ -25,6 +25,7 @@ items: - "java.lang.Enum.valueOf(java.lang.Class,java.lang.String)" - "java.lang.Enum.clone()" - "java.lang.Enum.compareTo(E)" + - "java.lang.Enum.describeConstable()" - "java.lang.Enum.equals(java.lang.Object)" - "java.lang.Enum.finalize()" - "java.lang.Enum.getDeclaringClass()" @@ -52,6 +53,7 @@ items: content: "public static final Person.IdentificationInfo.Gender FEMALE" return: type: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" + javaType: "static field" - uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.Gender()" id: "Gender()" parent: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" @@ -79,6 +81,7 @@ items: content: "public static final Person.IdentificationInfo.Gender MALE" return: type: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" + javaType: "static field" - uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.valueOf(java.lang.String)" id: "valueOf(java.lang.String)" parent: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" @@ -97,6 +100,7 @@ items: type: "java.lang.String" return: type: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" + javaType: "static method" - uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.values()" id: "values()" parent: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender" @@ -112,6 +116,7 @@ items: content: "public static Person.IdentificationInfo.Gender[] values()" return: type: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender[]" + javaType: "static method" references: - uid: "com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender.Gender*" name: "Gender" @@ -175,6 +180,11 @@ references: name: "Enum.finalize()" nameWithType: "Enum.finalize()" fullName: "java.lang.Enum.finalize()" +- uid: "java.lang.Enum.describeConstable()" + href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Enum.html#describeConstable--" + name: "Enum.describeConstable()" + nameWithType: "Enum.describeConstable()" + fullName: "java.lang.Enum.describeConstable()" - uid: "java.lang.Object.notifyAll()" href: "https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" name: "Object.notifyAll()" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml index 53fcb271..129b95ca 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.Person.yml @@ -21,7 +21,7 @@ items: fullName: "com.microsoft.samples.subpackage.Person" type: "Class" package: "com.microsoft.samples.subpackage" - summary: "Class that describes some person\n\n This comment has links to:\n

    \n
  • Owner class Person
  • \n
  • Its inner class Person.IdentificationInfo
  • \n
  • Its method Person#setLastName(String lastName)
  • \n
  • Its method without params Person#setLastName()
  • \n
  • Its public field Person#age
  • \n
  • Another class which used here Set
  • \n
  • Another class which not used here List
  • \n
  • Broken link sdfdsagdsfghfgh
  • \n
  • Plain link someContent
  • \n
  • Link that starts from '#' #setLastName()
  • \n
  • Link with label WordOne
  • \n
\n\n This is an \"at\" symbol: @" + summary: "Class that describes some person\n\n

This comment has links to:\n\n

    \n
  • Owner class Person\n
  • Its inner class Person.IdentificationInfo\n
  • Its method Person#setLastName(String lastName)\n
  • Its method without params Person#setLastName()\n
  • Its public field Person#age\n
  • Another class which used here Set\n
  • Another class which not used here List\n
  • Broken link sdfdsagdsfghfgh\n
  • Plain link someContent\n
  • Link that starts from '#' #setLastName()\n
  • Link with label WordOne\n
\n\n This is an \"at\" symbol: @\nSee Also: Display\n" syntax: content: "public class Person" typeParameters: @@ -86,6 +86,7 @@ items: type: "com.microsoft.samples.subpackage.Person" return: type: "com.microsoft.samples.subpackage.Person" + javaType: "static method" - uid: "com.microsoft.samples.subpackage.Person.getFirstName()" id: "getFirstName()" parent: "com.microsoft.samples.subpackage.Person" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md new file mode 100644 index 00000000..6c0e02f5 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.subpackage.md @@ -0,0 +1,84 @@ +# Package com.microsoft.samples.subpackage (0.18.0) + + + + + + +
GitHub RepositoryRPC DocumentationREST Documentation
+ +## This package is not the recommended entry point to using this client library! + + For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/latest/com.microsoft.samples.google.v1) for new applications. + +## Classes + + + + + + + + + + + + + + + + +
+Class +Description
com.microsoft.samples.subpackage.Person +Class that describes some person + +

This comment has links to: +

com.microsoft.samples.subpackage.Person.IdentificationInfo +Class that describes person's identification
com.microsoft.samples.subpackage.Tuple +
+ +## Interfaces + + + + + + + + +
+Interface +Description
com.microsoft.samples.subpackage.Display +Do you see some First code block? + +

Or this Second code block?

+ +## Enums + + + + + + + + +
+Enum +Description
com.microsoft.samples.subpackage.Person.IdentificationInfo.Gender +Enum describes person's gender
+ +## Exceptions + + + + + + + + +
+Exception +Description
com.microsoft.samples.subpackage.CustomException +
+ diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml deleted file mode 100644 index cf863b10..00000000 --- a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.yml +++ /dev/null @@ -1,50 +0,0 @@ -### YamlMime:ManagedReference -items: -- uid: "com.microsoft.samples" - id: "samples" - children: - - "com.microsoft.samples.BasePartnerComponent" - - "com.microsoft.samples.BasePartnerComponentString" - - "com.microsoft.samples.IPartner" - - "com.microsoft.samples.KeyValuePair" - - "com.microsoft.samples.Link" - - "com.microsoft.samples.Subpackage" - - "com.microsoft.samples.SuperHero" - langs: - - "java" - name: "com.microsoft.samples" - nameWithType: "com.microsoft.samples" - fullName: "com.microsoft.samples" - type: "Namespace" - summary: "The interfaces provided are listed below, along with usage samples.\n\n

SpeechClient

\n\n

Service Description: Service that implements Google Cloud Speech API.\n\n

Sample for SpeechClient:\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

AdaptationClient

\n\n

Service Description: Service that implements Google Cloud Speech Adaptation API.\n\n

Sample for AdaptationClient:\n\n

\n try (AdaptationClient adaptationClient = AdaptationClient.create()) {\n   LocationName parent = LocationName.of(\"[PROJECT]\", \"[LOCATION]\");\n   PhraseSet phraseSet = PhraseSet.newBuilder().build();\n   String phraseSetId = \"phraseSetId959902180\";\n   PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);\n }\n 
" - syntax: - content: "package com.microsoft.samples" -references: -- uid: "com.microsoft.samples.BasePartnerComponent" - name: "BasePartnerComponent" - nameWithType: "BasePartnerComponent" - fullName: "com.microsoft.samples.BasePartnerComponent" -- uid: "com.microsoft.samples.BasePartnerComponentString" - name: "BasePartnerComponentString" - nameWithType: "BasePartnerComponentString" - fullName: "com.microsoft.samples.BasePartnerComponentString" -- uid: "com.microsoft.samples.IPartner" - name: "IPartner" - nameWithType: "IPartner" - fullName: "com.microsoft.samples.IPartner" -- uid: "com.microsoft.samples.KeyValuePair" - name: "KeyValuePair" - nameWithType: "KeyValuePair" - fullName: "com.microsoft.samples.KeyValuePair" -- uid: "com.microsoft.samples.Link" - name: "Link" - nameWithType: "Link" - fullName: "com.microsoft.samples.Link" -- uid: "com.microsoft.samples.Subpackage" - name: "Subpackage" - nameWithType: "Subpackage" - fullName: "com.microsoft.samples.Subpackage" -- uid: "com.microsoft.samples.SuperHero" - name: "SuperHero" - nameWithType: "SuperHero" - fullName: "com.microsoft.samples.SuperHero" diff --git a/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.md b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.md new file mode 100644 index 00000000..1304190a --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/overview.md @@ -0,0 +1,112 @@ +# google-cloud-apikeys overview (0.18.0) + +## Key Reference Links +**API Keys API Description:** API Keys lets you create and manage your API keys for your projects. + + + + + + + +
API Keys API Product ReferenceGitHub RepositoryMaven artifact
+ +## Getting Started +In order to use this library, you first need to go through the following steps: + +- [Install a JDK (Java Development Kit)](https://cloud.google.com/java/docs/setup#install_a_jdk_java_development_kit) +- [Select or create a Cloud Platform project](https://console.cloud.google.com/project) +- [Enable billing for your project](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +- [Enable the API](https://console.cloud.google.com/apis/library/apikeys.googleapis.com) +- [Set up authentication](https://cloud.google.com/docs/authentication/client-libraries) + +## Use the API Keys API for Java +To ensure that your project uses compatible versions of the libraries +and their component artifacts, import `com.google.cloud:libraries-bom` and use +the BOM to specify dependency versions. Be sure to remove any versions that you +set previously. For more information about +BOMs, see [Google Cloud Platform Libraries BOM](https://cloud.google.com/java/docs/bom). + +### Maven +Import the BOM in the dependencyManagement section of your pom.xml file. +Include specific artifacts you depend on in the dependencies section, but don't +specify the artifacts' versions in the dependencies section. + +The example below demonstrates how you would import the BOM and include the google-cloud-apikeys artifact. +
+<dependencyManagement>
+ <dependencies>
+   <dependency>
+      <groupId>com.google.cloud</groupId>
+      <artifactId>libraries-bom</artifactId>
+      <version>26.19.0</version>
+      <type>pom</type>
+      <scope>import</scope>
+   </dependency>
+ </dependencies>
+</dependencyManagement>
+
+<dependencies>
+ <dependency>
+   <groupId>com.google.cloud</groupId>
+   <artifactId>google-cloud-apikeys</artifactId>
+ </dependency>
+</dependencies>
+
+ +### Gradle +BOMs are supported by default in Gradle 5.x or later. Add a platform +dependency on com.google.cloud:libraries-bom and remove the version from the +dependency declarations in the artifact's build.gradle file. + +The example below demonstrates how you would import the BOM and include the google-cloud-apikeys artifact. +
+implementation(platform("com.google.cloud:libraries-bom:26.19.0"))
+implementation("com.google.cloud:google-cloud-apikeys")
+
+ +The platform and enforcedPlatform keywords supply dependency versions +declared in a BOM. The enforcedPlatform keyword enforces the dependency +versions declared in the BOM and thus overrides what you specified. + +For more details of the platform and enforcedPlatform keywords Gradle 5.x or higher, see +[Gradle: Importing Maven BOMs](https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import). + +If you're using Gradle 4.6 or later, add +enableFeaturePreview('IMPROVED_POM_SUPPORT') to your settings.gradle file. For details, see +[Gradle 4.6 Release Notes: BOM import](https://docs.gradle.org/4.6/release-notes.html#bom-import). +Versions of Gradle earlier than 4.6 don't support BOMs.

+ +### SBT +SBT [doesn't support BOMs](https://github.com/sbt/sbt/issues/4531). You can find +recommended versions of libraries from a particular BOM version on the +[dashboard](https://storage.googleapis.com/cloud-opensource-java-dashboard/com.google.cloud/libraries-bom/index.html) +and set the versions manually. +To use the latest version of this library, add this to your dependencies: +
+libraryDependencies += "com.google.cloud" % "google-cloud-apikeys" % "0.18.0"
+
+ +## Which version ID should I get started with? +For this library, we recommend using [com.microsoft.samples.google.v1](https://cloud.google.com/java/docs/reference/google-cloud-apikeys/0.18.0/com.microsoft.samples.google.v1) for new applications. + +### Understanding Version ID and Library Versions +When using a Cloud client library, it's important to distinguish between two types of versions: +- **Library Version**: The version of the software package (the client library) that helps you interact with the Cloud service. These libraries are +released and updated frequently with bug fixes, improvements, and support for new service features and versions. The version selector at +the top of this page represents the client library version. +- **Version ID**: The version of the Cloud service itself (e.g. API Keys API). New Version IDs are introduced infrequently, and often involve +changes to the core functionality and structure of the Cloud service itself. The packages in the lefthand navigation represent packages tied +to a specific Version ID of the Cloud service. + +### Managing Library Versions +We recommend using the com.google.cloud:libraries-bom installation method detailed above to streamline dependency management +across multiple Cloud Java client libraries. This ensures compatibility and simplifies updates. + +### Choosing the Right Version ID +Each Cloud Java client library may contain packages tied to specific Version IDs (e.g., v1, v2alpha). For new production applications, use +the latest stable Version ID. This is identified by the highest version number **without** a suffix (like "alpha" or "beta"). You can read more about +[Cloud API versioning strategy here](https://cloud.google.com/apis/design/versioning). + +**Important**: Unstable Version ID releases (those _with_ suffixes) are subject to breaking changes when upgrading. Use them only for testing or if you specifically need their experimental features. + 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 c460a0f6..7c9c4ac6 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 @@ -1,6 +1,8 @@ ### YamlMime:TableOfContent - name: "google-cloud-project" items: + - name: "Overview" + href: "overview.md" - name: "Version history" href: "history.md" - uid: "com.microsoft.samples" @@ -8,7 +10,10 @@ items: - uid: "com.microsoft.samples" name: "Package summary" + href: "com.microsoft.samples.md" - heading: "Interfaces" + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor" + name: "ExceptionHandler.Interceptor" - uid: "com.microsoft.samples.IPartner" name: "IPartner" - heading: "Classes" @@ -24,11 +29,21 @@ name: "Subpackage" - uid: "com.microsoft.samples.SuperHero" name: "SuperHero" + - heading: "Enums" + - uid: "com.microsoft.samples.ExceptionHandler.Interceptor.RetryResult" + name: "ExceptionHandler.Interceptor.RetryResult" + - heading: "Exceptions" + - uid: "com.microsoft.samples.ExceptionHandler" + name: "ExceptionHandler" + status: "beta" + - uid: "com.microsoft.samples.ExceptionHandler.Builder" + name: "ExceptionHandler.Builder" - uid: "com.microsoft.samples.agreements" name: "com.microsoft.samples.agreements" items: - uid: "com.microsoft.samples.agreements" name: "Package summary" + href: "com.microsoft.samples.agreements.md" - heading: "Interfaces" - uid: "com.microsoft.samples.agreements.IAgreementDetailsCollection" name: "IAgreementDetailsCollection" @@ -46,6 +61,7 @@ items: - uid: "com.microsoft.samples.commentinheritance" name: "Package summary" + href: "com.microsoft.samples.commentinheritance.md" - heading: "Interfaces" - uid: "com.microsoft.samples.commentinheritance.Carnivorous" name: "Carnivorous" @@ -71,6 +87,7 @@ items: - uid: "com.microsoft.samples.google" name: "Package summary" + href: "com.microsoft.samples.google.md" - heading: "Interfaces" - uid: "com.microsoft.samples.google.ValidationException.Supplier" name: "ValidationException.Supplier" @@ -83,8 +100,10 @@ name: "RecognitionAudio" - uid: "com.microsoft.samples.google.SpeechClient" name: "SpeechClient" + status: "beta" - uid: "com.microsoft.samples.google.SpeechSettings" name: "SpeechSettings" + status: "beta" - uid: "com.microsoft.samples.google.SpeechSettings.Builder" name: "SpeechSettings.Builder" - heading: "Enums" @@ -93,32 +112,57 @@ - heading: "Annotation Types" - uid: "com.microsoft.samples.google.BetaApi" name: "BetaApi" + status: "beta" - 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" - name: "SpeechClient" + href: "com.microsoft.samples.google.v1.md" + - uid: "Clients" + name: "Clients" + items: + - uid: "com.microsoft.samples.google.v1.SpeechClient" + name: "SpeechClient" + status: "beta" + - uid: "Stub packages" + name: "Stub packages" + items: + - uid: "com.microsoft.samples.google.v1.stub" + name: "com.microsoft.samples.google.v1.stub" + items: + - uid: "com.microsoft.samples.google.v1.stub" + name: "Package summary" + href: "com.microsoft.samples.google.v1.stub.md" + - uid: "Stubs" + name: "Stubs" + items: + - uid: "com.microsoft.samples.google.v1.stub.GrpcSpeechStub" + name: "GrpcSpeechStub" + status: "beta" + - uid: "com.microsoft.samples.google.v1.stub.HttpJsonSpeechStub" + name: "HttpJsonSpeechStub" + status: "beta" + - uid: "com.microsoft.samples.google.v1.stub.SpeechStub" + name: "SpeechStub" + status: "beta" + - uid: "Settings" + name: "Settings" + items: + - uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings" + name: "SpeechStubSettings" + status: "beta" + - uid: "com.microsoft.samples.google.v1.stub.SpeechStubSettings.Builder" + name: "SpeechStubSettings.Builder" - uid: "com.microsoft.samples.offers" name: "com.microsoft.samples.offers" items: - uid: "com.microsoft.samples.offers" name: "Package summary" + href: "com.microsoft.samples.offers.md" - heading: "Classes" - uid: "com.microsoft.samples.offers.Offer" name: "Offer" @@ -127,6 +171,7 @@ items: - uid: "com.microsoft.samples.subpackage" name: "Package summary" + href: "com.microsoft.samples.subpackage.md" - heading: "Interfaces" - uid: "com.microsoft.samples.subpackage.Display" name: "Display" @@ -143,3 +188,32 @@ - 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" + href: "com.microsoft.samples.google.v1beta.md" + - uid: "Clients" + name: "Clients" + items: + - uid: "com.microsoft.samples.google.v1beta.SpeechClient" + name: "SpeechClient" + status: "beta" + - uid: "com.microsoft.samples.google.v1p1alpha" + name: "com.microsoft.samples.google.v1p1alpha" + status: "alpha" + items: + - uid: "com.microsoft.samples.google.v1p1alpha" + name: "Package summary" + href: "com.microsoft.samples.google.v1p1alpha.md" + - uid: "Clients" + name: "Clients" + items: + - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + name: "SpeechClient" + status: "beta" diff --git a/third_party/docfx-doclet-143274/src/test/resources/test-doclet-params.txt b/third_party/docfx-doclet-143274/src/test/resources/test-doclet-params.txt index 903cb863..7c5e71d3 100644 --- a/third_party/docfx-doclet-143274/src/test/resources/test-doclet-params.txt +++ b/third_party/docfx-doclet-143274/src/test/resources/test-doclet-params.txt @@ -1,4 +1,5 @@ --doclet com.microsoft.doclet.DocFxDoclet +-doclet +'com.microsoft.doclet.DocFxDoclet' -sourcepath ./src/test/java -outputpath ./target/test-out -encoding UTF-8