From 040498300dc966200011426c3176691e1e4752f9 Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 9 Sep 2021 11:38:05 -0700 Subject: [PATCH 1/3] feat: include status field includes 'deprecated' status + 'alpha'/'beta' package status --- .../com/microsoft/build/YmlFilesBuilder.java | 40 +- .../microsoft/lookup/ClassItemsLookup.java | 22 +- .../com/microsoft/lookup/ClassLookup.java | 31 +- .../com/microsoft/lookup/PackageLookup.java | 14 +- .../com/microsoft/model/MetadataFileItem.java | 27 +- .../main/java/com/microsoft/model/Status.java | 26 + .../java/com/microsoft/model/TocItem.java | 9 + .../lookup/ClassItemsLookupTest.java | 27 + .../com/microsoft/lookup/ClassLookupTest.java | 91 ++ .../microsoft/lookup/PackageLookupTest.java | 14 + .../java/com/microsoft/model/StatusTest.java | 30 + .../AgreementDetailsCollectionOperations.java | 2 + .../samples/agreements/AgreementMetaData.java | 1 + .../IAgreementDetailsCollection.java | 1 + .../samples/google/v1beta/SpeechClient.java | 404 +++++++++ .../google/v1p1alpha/SpeechClient.java | 404 +++++++++ .../com.microsoft.samples.SuperHero.yml | 2 + ...s.AgreementDetailsCollectionOperations.yml | 4 + ...agreements.IAgreementDetailsCollection.yml | 2 + ...oogle.RecognitionAudio.AudioSourceCase.yml | 2 + ...icrosoft.samples.google.SpeechSettings.yml | 2 +- ...oft.samples.google.v1beta.SpeechClient.yml | 830 ++++++++++++++++++ .../com.microsoft.samples.google.v1beta.yml | 19 + ....samples.google.v1p1alpha.SpeechClient.yml | 830 ++++++++++++++++++ ...com.microsoft.samples.google.v1p1alpha.yml | 19 + .../expected-generated-files/toc.yml | 18 + 26 files changed, 2847 insertions(+), 24 deletions(-) create mode 100644 third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java create mode 100644 third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java create mode 100644 third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/SpeechClient.java create mode 100644 third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml create mode 100644 third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml 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 adecbdb9..2e34e72d 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 @@ -68,9 +68,9 @@ public boolean build() { 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)); - - TocItem packageTocItem = new TocItem(uid, uid); packageTocItem.getItems().add(new TocItem(uid, "Package summary")); buildFilesForInnerClasses(packageElement, packageTocItem.getItems(), classMetadataFiles); tocFile.addTocItem(packageTocItem); @@ -102,8 +102,9 @@ void buildFilesForInnerClasses(Element element, List listToAddItems, Li for (TypeElement classElement : elementUtil.extractSortedElements(element)) { String uid = classLookup.extractUid(classElement); String name = classLookup.extractTocName(classElement); + String status = classLookup.extractStatus(classElement); - listToAddItems.add(new TocItem(uid, name)); + listToAddItems.add(new TocItem(uid, name, status)); container.add(buildClassYmlFile(classElement)); buildFilesForInnerClasses(classElement, listToAddItems, container); @@ -171,6 +172,11 @@ void addClassInfo(TypeElement classElement, MetadataFile classMetadataFile) { classItem.setInheritance(classLookup.extractSuperclass(classElement)); classItem.setInterfaces(classLookup.extractInterfaces(classElement)); classItem.setInheritedMethods(classLookup.extractInheritedMethods(classElement)); + String depMsg = classLookup.extractDeprecatedDescription(classElement); + if (depMsg != null) { + classItem.setDeprecated(classLookup.extractDeprecatedDescription(classElement)); + classItem.setStatus(Status.DEPRECATED.toString()); + } classMetadataFile.getItems().add(classItem); } @@ -201,8 +207,12 @@ void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFil constructorItem.setOverload(classItemsLookup.extractOverload(constructorElement)); constructorItem.setContent(classItemsLookup.extractConstructorContent(constructorElement)); constructorItem.setParameters(classItemsLookup.extractParameters(constructorElement)); + String depMsg = classItemsLookup.extractDeprecatedDescription(constructorElement); + if (depMsg != null) { + constructorItem.setDeprecated(depMsg); + constructorItem.setStatus(Status.DEPRECATED.toString()); + } classMetadataFile.getItems().add(constructorItem); - addParameterReferences(constructorItem, classMetadataFile); addOverloadReferences(constructorItem, classMetadataFile); } @@ -219,6 +229,11 @@ void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { methodItem.setParameters(classItemsLookup.extractParameters(methodElement)); methodItem.setReturn(classItemsLookup.extractReturn(methodElement)); methodItem.setOverridden(classItemsLookup.extractOverridden(methodElement)); + String depMsg = classItemsLookup.extractDeprecatedDescription(methodElement); + if (depMsg != null) { + methodItem.setDeprecated(depMsg); + methodItem.setStatus(Status.DEPRECATED.toString()); + } classMetadataFile.getItems().add(methodItem); addExceptionReferences(methodItem, classMetadataFile); @@ -235,6 +250,12 @@ void addFieldsInfo(TypeElement classElement, MetadataFile classMetadataFile) { MetadataFileItem fieldItem = buildMetadataFileItem(fieldElement); fieldItem.setContent(classItemsLookup.extractFieldContent(fieldElement)); fieldItem.setReturn(classItemsLookup.extractReturn(fieldElement)); + String depMsg = classItemsLookup.extractDeprecatedDescription(fieldElement); + if (depMsg != null) { + fieldItem.setDeprecated(depMsg); + fieldItem.setStatus(Status.DEPRECATED.toString()); + } + classMetadataFile.getItems().add(fieldItem); addReturnReferences(fieldItem, classMetadataFile); }); @@ -261,6 +282,11 @@ MetadataFileItem buildMetadataFileItem(Element element) { setType(classItemsLookup.extractType(element)); setPackageName(classItemsLookup.extractPackageName(element)); setSummary(classItemsLookup.extractSummary(element)); + String depMsg = classItemsLookup.extractDeprecatedDescription(element); + if (depMsg != null) { + setDeprecated(depMsg); + setStatus(Status.DEPRECATED.toString()); + } }}; } @@ -335,9 +361,9 @@ private void updateExternalReference(MetadataFileItem reference) { } } - private String updateReferenceUid(String uid){ + private String updateReferenceUid(String uid) { if (ENDING_PATTERN.matcher(uid).find()) { - uid = uid.replace("",""); + uid = uid.replace("", ""); } return uid; } @@ -346,7 +372,7 @@ 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) { + 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")); } 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 f7fae5d1..64e70f33 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 @@ -4,13 +4,11 @@ import com.microsoft.model.ExceptionItem; import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; +import com.microsoft.model.Status; import com.microsoft.util.CommentHelper; import com.microsoft.util.Utils; -import com.sun.source.doctree.DocTree; +import com.sun.source.doctree.*; import com.sun.source.doctree.DocTree.Kind; -import com.sun.source.doctree.ParamTree; -import com.sun.source.doctree.ReturnTree; -import com.sun.source.doctree.ThrowsTree; import jdk.javadoc.doclet.DocletEnvironment; import javax.lang.model.element.*; @@ -78,9 +76,25 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { result.setFieldContent(String.format("%s %s %s", modifiers, type, elementQName)); result.setReturn(extractReturn((VariableElement) element)); } + + String depMsg = extractDeprecatedDescription(element); + if (depMsg != null) { + result.setDeprecated(depMsg); + result.setStatus(Status.DEPRECATED.toString()); + } + 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); + } + List extractParameters(ExecutableElement element) { return element.getParameters().stream().map(o -> { String paramName = String.valueOf(o.getSimpleName()); 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 f5c67cbb..d7ac36bc 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,8 +2,11 @@ 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.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; @@ -49,10 +52,36 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(TypeElement classElemen result.setInheritedMethods(determineInheritedMembers(inheritedMethods)); populateContent(classElement, classSNameWithGenericsSupport, result); result.setTocName(classQName.replace(packageName.concat("."), "")); - + String depMsg = extractDeprecatedDescription(classElement); + if (depMsg != null) { + result.setDeprecated(depMsg); + result.setStatus(Status.DEPRECATED.toString()); + } return result; } + 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; + } + + 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); + } + void populateContent(TypeElement classElement, String shortNameWithGenericsSupport, ExtendedMetadataFileItem container) { String type = elementKindLookup.get(classElement.getKind()); 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 3ec9c5c5..ca9738fd 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,6 +1,9 @@ package com.microsoft.lookup; 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 javax.lang.model.element.PackageElement; @@ -25,10 +28,19 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(PackageElement packageE result.setType(determineType(packageElement)); result.setSummary(determineComment(packageElement)); result.setContent(determinePackageContent(packageElement)); - return result; } + 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; + } + String determinePackageContent(PackageElement packageElement) { return "package " + packageElement.getQualifiedName(); } 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 da380796..5a2c89f4 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 @@ -10,7 +10,7 @@ @JsonPropertyOrder({"uid", "id", "parent", "children", "href", "langs", "isExternal", "name", "nameWithType", "fullName", "overload", "overridden", "type", "package", "summary", "syntax", "inheritance", "implements", "exceptions", - "spec.java", "inheritedMembers"}) + "spec.java", "inheritedMembers", "status", "deprecated"}) public class MetadataFileItem implements Comparable { private final String uid; @@ -38,6 +38,8 @@ public class MetadataFileItem implements Comparable { private List specForJava = new ArrayList<>(); @JsonProperty("inheritedMembers") private List inheritedMethods = new ArrayList<>(); + private String status; + private String deprecated; @Override public int compareTo(MetadataFileItem item) { @@ -241,12 +243,9 @@ public String getOverridden() { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } + if (this == o) { return true; } + + if (o == null || getClass() != o.getClass()) { return false; } MetadataFileItem that = (MetadataFileItem) o; @@ -262,11 +261,19 @@ public Boolean getIsExternal() { return isExternal ? true : null; } + public void setIsExternal(boolean external) { + isExternal = external; + } + public String handleGenericForOverLoad(String value) { return RegExUtils.removeAll(value, "<\\w+(,\\s*\\w+)*>"); } - public void setIsExternal(boolean external) { - isExternal = external; - } + public String getStatus() { return status; } + + public void setStatus(String status) { this.status = status; } + + public String getDeprecated() { return deprecated; } + + public void setDeprecated(String deprecated) { this.deprecated = deprecated; } } 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 new file mode 100644 index 00000000..c70600dd --- /dev/null +++ b/third_party/docfx-doclet-143274/src/main/java/com/microsoft/model/Status.java @@ -0,0 +1,26 @@ +/* + * 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.model; + +public enum Status { + DEPRECATED, ALPHA, BETA; + + @Override + public String toString() { + return name().toLowerCase(); + } +} 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 66e55306..0137d796 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 @@ -7,6 +7,7 @@ public class TocItem { private final String uid; private final String name; + private String status; private List items = new ArrayList<>(); public TocItem(String uid, String name) { @@ -14,6 +15,12 @@ public TocItem(String uid, String name) { this.name = name; } + public TocItem(String uid, String name, String status) { + this.uid = uid; + this.name = name; + this.status = status; + } + public String getUid() { return uid; } @@ -25,4 +32,6 @@ public String getName() { public List getItems() { return items; } + + public String getStatus() { return status; } } 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 e6578725..cecc9784 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 @@ -39,6 +39,7 @@ public class ClassItemsLookupTest { private ParamTree paramTree; private ThrowsTree throwsTree; private ReturnTree returnTree; + private DeprecatedTree deprecatedTree; private TextTree textTree; private IdentifierTree identifierTree; private ClassItemsLookup classItemsLookup; @@ -52,9 +53,11 @@ public void setup() { 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 @@ -262,4 +265,28 @@ public void determineTypeForEnumConstant() { 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); + } } 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 475e5093..d8cf88e3 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 @@ -2,7 +2,13 @@ import com.google.testing.compile.CompilationRule; import com.microsoft.lookup.model.ExtendedMetadataFileItem; +import com.microsoft.model.Status; import com.microsoft.model.TypeParameter; +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 jdk.javadoc.doclet.DocletEnvironment; import org.junit.Before; import org.junit.Rule; @@ -13,10 +19,12 @@ 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 { @@ -26,12 +34,22 @@ public class ClassLookupTest { 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 @@ -146,4 +164,77 @@ public void determineTypeForClass() { 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"); + + when(environment.getDocTrees()).thenReturn(docTrees); + when(docTrees.getDocCommentTree(element)).thenReturn(docCommentTree); + doReturn(Arrays.asList()).when(docCommentTree).getBlockTags(); + + String result = classLookup.extractStatus(element); + + verify(environment).getDocTrees(); + verify(docTrees).getDocCommentTree(element); + verify(docCommentTree).getBlockTags(); + assertEquals("Wrong description", result, null); + } } 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 2e5eaafc..4a381022 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,6 +1,7 @@ package com.microsoft.lookup; import com.google.testing.compile.CompilationRule; +import com.microsoft.model.Status; import jdk.javadoc.doclet.DocletEnvironment; import org.junit.Before; import org.junit.Rule; @@ -38,4 +39,17 @@ public void extractPackageContent() { assertEquals("Wrong result", result, "package com.microsoft.samples"); } + + @Test + public void extractPackageStatus() { + PackageElement elementBeta = elements.getPackageElement("com.microsoft.samples.google.v1beta"); + PackageElement elementAlpha = elements.getPackageElement("com.microsoft.samples.google.v1p1alpha"); + + String resultA = packageLookup.extractStatus(elementAlpha.getQualifiedName().toString()); + String resultB = packageLookup.extractStatus(elementBeta.getQualifiedName().toString()); + + assertEquals("Wrong result", resultA, Status.ALPHA.toString()); + assertEquals("Wrong result", resultB, Status.BETA.toString()); + } + } 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 new file mode 100644 index 00000000..cff62ebb --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/model/StatusTest.java @@ -0,0 +1,30 @@ +/* + * 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.model; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +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 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 22f1d823..55a9b2b1 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 @@ -6,6 +6,7 @@ /** * Agreement details collection operations implementation class. + * @deprecated Use {@link AgreementMetaData} instead. */ public class AgreementDetailsCollectionOperations extends BasePartnerComponentString @@ -23,6 +24,7 @@ public AgreementDetailsCollectionOperations(IPartner rootPartnerOperations) { * Retrieves the agreement details. * * @return A list of agreement details. + * @deprecated Some text */ 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 eea95b9d..277c5b7d 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 @@ -28,6 +28,7 @@ public void setTemplateId(String value) { /** * Gets or sets URL to the agreement template. + * @deprecated */ @JsonProperty("agreementLink") private String agreementLink; 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 a970ba17..5d8a5944 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 @@ -3,6 +3,7 @@ /** * Encapsulates the operations on the agreement metadata collection. + * @deprecated This one is deprecated :( */ public interface IAgreementDetailsCollection { /** 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 new file mode 100644 index 00000000..e145e0c3 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1beta/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.v1beta; + +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 javax.annotation.Generated; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +// 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/v1p1alpha/SpeechClient.java b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/SpeechClient.java new file mode 100644 index 00000000..f98b9ce4 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/java/com/microsoft/samples/google/v1p1alpha/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.v1p1alpha; + +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 javax.annotation.Generated; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +// 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/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 5427fcb0..34886fa2 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 @@ -270,6 +270,8 @@ items: exceptions: - type: "java.lang.IllegalArgumentException" description: "when incomingDamage is negative and thanks for Exception" + status: "deprecated" + deprecated: "As of version 1.1, use . . . instead" references: - uid: "com.microsoft.samples.SuperHero.SuperHero*" name: "SuperHero" 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 4ee34533..2d1f453a 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 @@ -36,6 +36,8 @@ items: - "java.lang.Object.wait()" - "java.lang.Object.wait(long)" - "java.lang.Object.wait(long,int)" + status: "deprecated" + deprecated: "Use AgreementMetaData instead." - uid: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.AgreementDetailsCollectionOperations(com.microsoft.samples.IPartner)" id: "AgreementDetailsCollectionOperations(com.microsoft.samples.IPartner)" parent: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" @@ -71,6 +73,8 @@ items: return: type: "com.microsoft.samples.agreements.ResourceCollection" description: "A list of agreement details." + status: "deprecated" + deprecated: "Some text" references: - uid: "com.microsoft.samples.IPartner" name: "IPartner" 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 9f337b3e..aabc5e0d 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 @@ -15,6 +15,8 @@ items: summary: "Encapsulates the operations on the agreement metadata collection." syntax: content: "public interface IAgreementDetailsCollection" + status: "deprecated" + deprecated: "This one is deprecated :(" - uid: "com.microsoft.samples.agreements.IAgreementDetailsCollection.get()" id: "get()" parent: "com.microsoft.samples.agreements.IAgreementDetailsCollection" 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 e94bf04b..b2d1ba1b 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 @@ -155,6 +155,8 @@ items: return: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" description: "The enum associated with the given number." + status: "deprecated" + deprecated: "Use #forNumber(int) instead." - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.valueOf(java.lang.String)" id: "valueOf(java.lang.String)" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" 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 01126bde..88b9cdd1 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\nThe default instance has everything set to sensible defaults:\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\nThe 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.\n\nFor example, to set the total timeout of recognize to 30 seconds:\n\n```java\nSpeechSettings.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\nThe default instance has everything set to sensible defaults:\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\nThe 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.\n\nFor example, to set the total timeout of recognize to 30 seconds:\n\n```java\nSpeechSettings.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: 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 new file mode 100644 index 00000000..7bc06397 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.SpeechClient.yml @@ -0,0 +1,830 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1beta.SpeechClient" + id: "SpeechClient" + parent: "com.microsoft.samples.google.v1beta" + children: + - "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1beta.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + - "com.microsoft.samples.google.v1beta.SpeechClient.close()" + - "com.microsoft.samples.google.v1beta.SpeechClient.create()" + - "com.microsoft.samples.google.v1beta.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1beta.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient()" + - "com.microsoft.samples.google.v1beta.SpeechClient.getSettings()" + - "com.microsoft.samples.google.v1beta.SpeechClient.getStub()" + - "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown()" + - "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated()" + - "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + - "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1beta.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1beta.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + - "com.microsoft.samples.google.v1beta.SpeechClient.recognizeCallable()" + - "com.microsoft.samples.google.v1beta.SpeechClient.shutdown()" + - "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow()" + - "com.microsoft.samples.google.v1beta.SpeechClient.streamingRecognizeCallable()" + langs: + - "java" + name: "SpeechClient" + nameWithType: "SpeechClient" + 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\nThis 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:\n\n```java\ntry (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\nNote: 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().\n\nThe surface of this class includes several types of Java methods for each of the API's methods:\n\n1. 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.\n2. 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.\n3. 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.\n\nSee the individual methods for example code.\n\nMany 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.\n\nThis class can be customized by passing in a custom instance of SpeechSettings to create(). For example:\n\nTo customize credentials:\n\n```java\nSpeechSettings speechSettings =\n SpeechSettings.newBuilder()\n .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))\n .build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n```\n\nTo customize the endpoint:\n\n```java\nSpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n```\n\nPlease refer to the GitHub repository's samples for more quickstart code snippets." + syntax: + content: "public class SpeechClient implements BackgroundResource" + inheritance: + - "java.lang.Object" + implements: + - "com.google.api.gax.core.BackgroundResource" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.google.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" + langs: + - "java" + name: "SpeechClient(SpeechStub stub)" + nameWithType: "SpeechClient.SpeechClient(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(SpeechStub stub)" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "protected SpeechClient(SpeechStub stub)" + parameters: + - id: "stub" + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- 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" + langs: + - "java" + name: "SpeechClient(SpeechSettings settings)" + nameWithType: "SpeechClient.SpeechClient(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient(SpeechSettings settings)" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1beta" + summary: "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." + syntax: + content: "protected SpeechClient(SpeechSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + id: "awaitTermination(long,java.util.concurrent.TimeUnit)" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "awaitTermination(long duration, TimeUnit unit)" + nameWithType: "SpeechClient.awaitTermination(long duration, TimeUnit unit)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.awaitTermination(long duration, TimeUnit unit)" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.awaitTermination*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + 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.v1beta.SpeechClient.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "close()" + nameWithType: "SpeechClient.close()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.close()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.close*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public final void close()" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.create()" + id: "create()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "create()" + nameWithType: "SpeechClient.create()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.create()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.create*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + summary: "Constructs an instance of SpeechClient with default settings." + syntax: + content: "public static final SpeechClient create()" + return: + type: "com.microsoft.samples.google.v1beta.SpeechClient" + exceptions: + - type: "java.io.IOException" +- 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" + langs: + - "java" + name: "create(SpeechStub stub)" + nameWithType: "SpeechClient.create(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.create(SpeechStub stub)" + 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 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.v1beta.SpeechClient" +- 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" + langs: + - "java" + name: "create(SpeechSettings settings)" + nameWithType: "SpeechClient.create(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.create(SpeechSettings settings)" + 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 settings. The channels are created 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.v1beta.SpeechClient" + exceptions: + - type: "java.io.IOException" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient()" + id: "getOperationsClient()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "getOperationsClient()" + nameWithType: "SpeechClient.getOperationsClient()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + summary: "Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call." + syntax: + content: "public final OperationsClient getOperationsClient()" + return: + type: "com.google.longrunning.OperationsClient" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.getSettings()" + id: "getSettings()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "getSettings()" + nameWithType: "SpeechClient.getSettings()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getSettings()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.getSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public final SpeechSettings getSettings()" + return: + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.getStub()" + id: "getStub()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "getStub()" + nameWithType: "SpeechClient.getStub()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getStub()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.getStub*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public SpeechStub getStub()" + return: + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown()" + id: "isShutdown()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "isShutdown()" + nameWithType: "SpeechClient.isShutdown()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public boolean isShutdown()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated()" + id: "isTerminated()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "isTerminated()" + nameWithType: "SpeechClient.isTerminated()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public boolean isTerminated()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + id: "longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + 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 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).\n\nSample code:\n\n```java\ntry (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.v1beta.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.v1beta.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + 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 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).\n\nSample code:\n\n```java\ntry (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.v1beta.SpeechClient.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "SpeechClient.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeCallable()" + 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 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).\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeOperationCallable()" + 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 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).\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1beta.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.v1beta.SpeechClient" + langs: + - "java" + name: "recognize(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + 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 processed.\n\nSample code:\n\n```java\ntry (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.v1beta.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + id: "recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "recognize(RecognizeRequest request)" + nameWithType: "SpeechClient.recognize(RecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.recognize(RecognizeRequest request)" + 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 processed.\n\nSample code:\n\n```java\ntry (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.v1beta.SpeechClient.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "SpeechClient.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.recognizeCallable()" + 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 processed.\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.shutdown()" + id: "shutdown()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "shutdown()" + nameWithType: "SpeechClient.shutdown()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.shutdown()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.shutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public void shutdown()" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow()" + id: "shutdownNow()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "shutdownNow()" + nameWithType: "SpeechClient.shutdownNow()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow()" + overload: "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow*" + type: "Method" + package: "com.microsoft.samples.google.v1beta" + syntax: + content: "public void shutdownNow()" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1beta.SpeechClient" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "SpeechClient.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.streamingRecognizeCallable()" + 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 method is only available via the gRPC API (not REST).\n\nSample code:\n\n```java\ntry (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```" + 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.v1beta.SpeechClient.SpeechClient*" + name: "SpeechClient" + nameWithType: "SpeechClient.SpeechClient" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.SpeechClient" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.create*" + name: "create" + nameWithType: "SpeechClient.create" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.create" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.getSettings*" + name: "getSettings" + nameWithType: "SpeechClient.getSettings" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getSettings" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.getStub*" + name: "getStub" + nameWithType: "SpeechClient.getStub" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getStub" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.getOperationsClient*" + name: "getOperationsClient" + nameWithType: "SpeechClient.getOperationsClient" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.getOperationsClient" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.recognize*" + name: "recognize" + nameWithType: "SpeechClient.recognize" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.recognize" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "SpeechClient.recognizeCallable" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.recognizeCallable" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.longRunningRecognizeAsync*" + name: "longRunningRecognizeAsync" + nameWithType: "SpeechClient.longRunningRecognizeAsync" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeAsync" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "SpeechClient.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "SpeechClient.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.close*" + name: "close" + nameWithType: "SpeechClient.close" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.close" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.shutdown*" + name: "shutdown" + nameWithType: "SpeechClient.shutdown" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.shutdown" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.isShutdown*" + name: "isShutdown" + nameWithType: "SpeechClient.isShutdown" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.isShutdown" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated*" + name: "isTerminated" + nameWithType: "SpeechClient.isTerminated" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.isTerminated" + package: "com.microsoft.samples.google.v1beta" +- uid: "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow*" + name: "shutdownNow" + nameWithType: "SpeechClient.shutdownNow" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.shutdownNow" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.SpeechClient.awaitTermination*" + name: "awaitTermination" + nameWithType: "SpeechClient.awaitTermination" + fullName: "com.microsoft.samples.google.v1beta.SpeechClient.awaitTermination" + package: "com.microsoft.samples.google.v1beta" +- 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.v1beta.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml new file mode 100644 index 00000000..c5c77b4d --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1beta.yml @@ -0,0 +1,19 @@ +### 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 new file mode 100644 index 00000000..b3737107 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.SpeechClient.yml @@ -0,0 +1,830 @@ +### YamlMime:ManagedReference +items: +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + id: "SpeechClient" + parent: "com.microsoft.samples.google.v1p1alpha" + children: + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.close()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.create()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(com.google.cloud.speech.v1p1beta1.stub.SpeechStub)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(com.microsoft.samples.google.SpeechSettings)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeCallable()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognitionConfig,com.google.cloud.speech.v1p1beta1.RecognitionAudio)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognizeCallable()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow()" + - "com.microsoft.samples.google.v1p1alpha.SpeechClient.streamingRecognizeCallable()" + langs: + - "java" + name: "SpeechClient" + nameWithType: "SpeechClient" + 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\nThis 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:\n\n```java\ntry (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\nNote: 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().\n\nThe surface of this class includes several types of Java methods for each of the API's methods:\n\n1. 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.\n2. 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.\n3. 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.\n\nSee the individual methods for example code.\n\nMany 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.\n\nThis class can be customized by passing in a custom instance of SpeechSettings to create(). For example:\n\nTo customize credentials:\n\n```java\nSpeechSettings speechSettings =\n SpeechSettings.newBuilder()\n .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))\n .build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n```\n\nTo customize the endpoint:\n\n```java\nSpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build();\n SpeechClient speechClient = SpeechClient.create(speechSettings);\n```\n\nPlease refer to the GitHub repository's samples for more quickstart code snippets." + syntax: + content: "public class SpeechClient implements BackgroundResource" + inheritance: + - "java.lang.Object" + implements: + - "com.google.api.gax.core.BackgroundResource" + inheritedMembers: + - "java.lang.Object.clone()" + - "java.lang.Object.equals(java.lang.Object)" + - "java.lang.Object.finalize()" + - "java.lang.Object.getClass()" + - "java.lang.Object.hashCode()" + - "java.lang.Object.notify()" + - "java.lang.Object.notifyAll()" + - "java.lang.Object.toString()" + - "java.lang.Object.wait()" + - "java.lang.Object.wait(long)" + - "java.lang.Object.wait(long,int)" +- uid: "com.microsoft.samples.google.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" + langs: + - "java" + name: "SpeechClient(SpeechStub stub)" + nameWithType: "SpeechClient.SpeechClient(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(SpeechStub stub)" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "protected SpeechClient(SpeechStub stub)" + parameters: + - id: "stub" + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- 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" + langs: + - "java" + name: "SpeechClient(SpeechSettings settings)" + nameWithType: "SpeechClient.SpeechClient(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient(SpeechSettings settings)" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient*" + type: "Constructor" + package: "com.microsoft.samples.google.v1p1alpha" + summary: "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." + syntax: + content: "protected SpeechClient(SpeechSettings settings)" + parameters: + - id: "settings" + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.awaitTermination(long,java.util.concurrent.TimeUnit)" + id: "awaitTermination(long,java.util.concurrent.TimeUnit)" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "awaitTermination(long duration, TimeUnit unit)" + nameWithType: "SpeechClient.awaitTermination(long duration, TimeUnit unit)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.awaitTermination(long duration, TimeUnit unit)" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.awaitTermination*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + 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.v1p1alpha.SpeechClient.close()" + id: "close()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "close()" + nameWithType: "SpeechClient.close()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.close()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.close*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public final void close()" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create()" + id: "create()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "create()" + nameWithType: "SpeechClient.create()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + summary: "Constructs an instance of SpeechClient with default settings." + syntax: + content: "public static final SpeechClient create()" + return: + type: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + exceptions: + - type: "java.io.IOException" +- 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" + langs: + - "java" + name: "create(SpeechStub stub)" + nameWithType: "SpeechClient.create(SpeechStub stub)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(SpeechStub stub)" + 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 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.v1p1alpha.SpeechClient" +- 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" + langs: + - "java" + name: "create(SpeechSettings settings)" + nameWithType: "SpeechClient.create(SpeechSettings settings)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create(SpeechSettings settings)" + 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 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.v1p1alpha.SpeechClient" + exceptions: + - type: "java.io.IOException" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient()" + id: "getOperationsClient()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "getOperationsClient()" + nameWithType: "SpeechClient.getOperationsClient()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + summary: "Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call." + syntax: + content: "public final OperationsClient getOperationsClient()" + return: + type: "com.google.longrunning.OperationsClient" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings()" + id: "getSettings()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "getSettings()" + nameWithType: "SpeechClient.getSettings()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public final SpeechSettings getSettings()" + return: + type: "com.microsoft.samples.google.SpeechSettings" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub()" + id: "getStub()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "getStub()" + nameWithType: "SpeechClient.getStub()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public SpeechStub getStub()" + return: + type: "com.google.cloud.speech.v1p1beta1.stub.SpeechStub" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown()" + id: "isShutdown()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "isShutdown()" + nameWithType: "SpeechClient.isShutdown()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public boolean isShutdown()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated()" + id: "isTerminated()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "isTerminated()" + nameWithType: "SpeechClient.isTerminated()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public boolean isTerminated()" + return: + type: "boolean" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + id: "longRunningRecognizeAsync(com.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest)" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync(LongRunningRecognizeRequest request)" + 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 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).\n\nSample code:\n\n```java\ntry (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.v1p1alpha.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.v1p1alpha.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync(RecognitionConfig config, RecognitionAudio audio)" + 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 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).\n\nSample code:\n\n```java\ntry (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.v1p1alpha.SpeechClient.longRunningRecognizeCallable()" + id: "longRunningRecognizeCallable()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeCallable()" + nameWithType: "SpeechClient.longRunningRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeCallable()" + 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 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).\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final UnaryCallable longRunningRecognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable()" + id: "longRunningRecognizeOperationCallable()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "longRunningRecognizeOperationCallable()" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable()" + 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 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).\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final OperationCallable longRunningRecognizeOperationCallable()" + return: + type: "com.google.api.gax.rpc.OperationCallable" +- uid: "com.microsoft.samples.google.v1p1alpha.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.v1p1alpha.SpeechClient" + langs: + - "java" + name: "recognize(RecognitionConfig config, RecognitionAudio audio)" + nameWithType: "SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize(RecognitionConfig config, RecognitionAudio audio)" + 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 processed.\n\nSample code:\n\n```java\ntry (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.v1p1alpha.SpeechClient.recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + id: "recognize(com.google.cloud.speech.v1p1beta1.RecognizeRequest)" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "recognize(RecognizeRequest request)" + nameWithType: "SpeechClient.recognize(RecognizeRequest request)" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize(RecognizeRequest request)" + 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 processed.\n\nSample code:\n\n```java\ntry (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.v1p1alpha.SpeechClient.recognizeCallable()" + id: "recognizeCallable()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "recognizeCallable()" + nameWithType: "SpeechClient.recognizeCallable()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognizeCallable()" + 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 processed.\n\nSample code:\n\n```java\ntry (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```" + syntax: + content: "public final UnaryCallable recognizeCallable()" + return: + type: "com.google.api.gax.rpc.UnaryCallable" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown()" + id: "shutdown()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "shutdown()" + nameWithType: "SpeechClient.shutdown()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public void shutdown()" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow()" + id: "shutdownNow()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "shutdownNow()" + nameWithType: "SpeechClient.shutdownNow()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow()" + overload: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow*" + type: "Method" + package: "com.microsoft.samples.google.v1p1alpha" + syntax: + content: "public void shutdownNow()" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.streamingRecognizeCallable()" + id: "streamingRecognizeCallable()" + parent: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + langs: + - "java" + name: "streamingRecognizeCallable()" + nameWithType: "SpeechClient.streamingRecognizeCallable()" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.streamingRecognizeCallable()" + 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 method is only available via the gRPC API (not REST).\n\nSample code:\n\n```java\ntry (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```" + 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.v1p1alpha.SpeechClient.SpeechClient*" + name: "SpeechClient" + nameWithType: "SpeechClient.SpeechClient" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.SpeechClient" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.create*" + name: "create" + nameWithType: "SpeechClient.create" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.create" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings*" + name: "getSettings" + nameWithType: "SpeechClient.getSettings" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getSettings" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub*" + name: "getStub" + nameWithType: "SpeechClient.getStub" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getStub" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.getOperationsClient*" + name: "getOperationsClient" + nameWithType: "SpeechClient.getOperationsClient" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.getOperationsClient" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.recognize*" + name: "recognize" + nameWithType: "SpeechClient.recognize" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognize" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.recognizeCallable*" + name: "recognizeCallable" + nameWithType: "SpeechClient.recognizeCallable" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.recognizeCallable" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.longRunningRecognizeAsync*" + name: "longRunningRecognizeAsync" + nameWithType: "SpeechClient.longRunningRecognizeAsync" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeAsync" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable*" + name: "longRunningRecognizeOperationCallable" + nameWithType: "SpeechClient.longRunningRecognizeOperationCallable" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeOperationCallable" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.longRunningRecognizeCallable*" + name: "longRunningRecognizeCallable" + nameWithType: "SpeechClient.longRunningRecognizeCallable" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.longRunningRecognizeCallable" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.streamingRecognizeCallable*" + name: "streamingRecognizeCallable" + nameWithType: "SpeechClient.streamingRecognizeCallable" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.streamingRecognizeCallable" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.close*" + name: "close" + nameWithType: "SpeechClient.close" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.close" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown*" + name: "shutdown" + nameWithType: "SpeechClient.shutdown" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdown" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.isShutdown*" + name: "isShutdown" + nameWithType: "SpeechClient.isShutdown" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isShutdown" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated*" + name: "isTerminated" + nameWithType: "SpeechClient.isTerminated" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.isTerminated" + package: "com.microsoft.samples.google.v1p1alpha" +- uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow*" + name: "shutdownNow" + nameWithType: "SpeechClient.shutdownNow" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.shutdownNow" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.SpeechClient.awaitTermination*" + name: "awaitTermination" + nameWithType: "SpeechClient.awaitTermination" + fullName: "com.microsoft.samples.google.v1p1alpha.SpeechClient.awaitTermination" + package: "com.microsoft.samples.google.v1p1alpha" +- 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.v1p1alpha.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml new file mode 100644 index 00000000..08ba1571 --- /dev/null +++ b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/com.microsoft.samples.google.v1p1alpha.yml @@ -0,0 +1,19 @@ +### 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/toc.yml b/third_party/docfx-doclet-143274/src/test/resources/expected-generated-files/toc.yml index bc5afcce..53e8ddf9 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 @@ -31,10 +31,12 @@ name: "Package summary" - uid: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" name: "AgreementDetailsCollectionOperations" + status: "deprecated" - uid: "com.microsoft.samples.agreements.AgreementMetaData" name: "AgreementMetaData" - uid: "com.microsoft.samples.agreements.IAgreementDetailsCollection" name: "IAgreementDetailsCollection" + status: "deprecated" - uid: "com.microsoft.samples.agreements.ResourceCollection" name: "ResourceCollection" - uid: "com.microsoft.samples.commentinheritance" @@ -79,6 +81,22 @@ name: "SpeechSettings" - uid: "com.microsoft.samples.google.SpeechSettings.Builder" name: "SpeechSettings.Builder" + - uid: "com.microsoft.samples.google.v1beta" + name: "com.microsoft.samples.google.v1beta" + status: "beta" + items: + - uid: "com.microsoft.samples.google.v1beta" + name: "Package summary" + - 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" + - uid: "com.microsoft.samples.google.v1p1alpha.SpeechClient" + name: "SpeechClient" - uid: "com.microsoft.samples.offers" name: "com.microsoft.samples.offers" items: From 97a32fe496f0448930caa6425c0ffc27f8b1c3de Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 9 Sep 2021 11:48:04 -0700 Subject: [PATCH 2/3] chore: minor fixes --- .../src/main/java/com/microsoft/build/YmlFilesBuilder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2e34e72d..ed55d27c 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 @@ -174,7 +174,7 @@ void addClassInfo(TypeElement classElement, MetadataFile classMetadataFile) { classItem.setInheritedMethods(classLookup.extractInheritedMethods(classElement)); String depMsg = classLookup.extractDeprecatedDescription(classElement); if (depMsg != null) { - classItem.setDeprecated(classLookup.extractDeprecatedDescription(classElement)); + classItem.setDeprecated(depMsg); classItem.setStatus(Status.DEPRECATED.toString()); } classMetadataFile.getItems().add(classItem); @@ -213,6 +213,7 @@ void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFil constructorItem.setStatus(Status.DEPRECATED.toString()); } classMetadataFile.getItems().add(constructorItem); + addParameterReferences(constructorItem, classMetadataFile); addOverloadReferences(constructorItem, classMetadataFile); } From f9e3e56c743f804c42adc30a79b5c5be22f9fc8c Mon Sep 17 00:00:00 2001 From: Emily Ball Date: Thu, 9 Sep 2021 17:11:36 -0700 Subject: [PATCH 3/3] chore: move deprecated message to summary + simplify --- .../com/microsoft/build/YmlFilesBuilder.java | 21 +++++++++++-------- .../microsoft/lookup/ClassItemsLookup.java | 7 ------- .../com/microsoft/lookup/ClassLookup.java | 5 ----- .../com/microsoft/model/MetadataFileItem.java | 7 +------ .../com.microsoft.samples.SuperHero.yml | 3 +-- ...s.AgreementDetailsCollectionOperations.yml | 6 ++---- ...agreements.IAgreementDetailsCollection.yml | 3 +-- ...oogle.RecognitionAudio.AudioSourceCase.yml | 2 +- 8 files changed, 18 insertions(+), 36 deletions(-) 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 ed55d27c..96de0ab7 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 @@ -174,12 +174,20 @@ void addClassInfo(TypeElement classElement, MetadataFile classMetadataFile) { classItem.setInheritedMethods(classLookup.extractInheritedMethods(classElement)); String depMsg = classLookup.extractDeprecatedDescription(classElement); if (depMsg != null) { - classItem.setDeprecated(depMsg); + 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 + " - " + summary; + } + return result; + } + void addChildren(TypeElement classElement, List children) { collect(classElement, children, ElementFilter::constructorsIn, classItemsLookup::extractUid); collect(classElement, children, ElementFilter::methodsIn, classItemsLookup::extractUid); @@ -209,7 +217,7 @@ void addConstructorsInfo(TypeElement classElement, MetadataFile classMetadataFil constructorItem.setParameters(classItemsLookup.extractParameters(constructorElement)); String depMsg = classItemsLookup.extractDeprecatedDescription(constructorElement); if (depMsg != null) { - constructorItem.setDeprecated(depMsg); + constructorItem.setSummary(getDeprecatedSummary(depMsg, constructorItem.getSummary())); constructorItem.setStatus(Status.DEPRECATED.toString()); } classMetadataFile.getItems().add(constructorItem); @@ -232,7 +240,7 @@ void addMethodsInfo(TypeElement classElement, MetadataFile classMetadataFile) { methodItem.setOverridden(classItemsLookup.extractOverridden(methodElement)); String depMsg = classItemsLookup.extractDeprecatedDescription(methodElement); if (depMsg != null) { - methodItem.setDeprecated(depMsg); + methodItem.setSummary(getDeprecatedSummary(depMsg, methodItem.getSummary())); methodItem.setStatus(Status.DEPRECATED.toString()); } @@ -253,7 +261,7 @@ void addFieldsInfo(TypeElement classElement, MetadataFile classMetadataFile) { fieldItem.setReturn(classItemsLookup.extractReturn(fieldElement)); String depMsg = classItemsLookup.extractDeprecatedDescription(fieldElement); if (depMsg != null) { - fieldItem.setDeprecated(depMsg); + fieldItem.setSummary(getDeprecatedSummary(depMsg, fieldItem.getSummary())); fieldItem.setStatus(Status.DEPRECATED.toString()); } @@ -283,11 +291,6 @@ MetadataFileItem buildMetadataFileItem(Element element) { setType(classItemsLookup.extractType(element)); setPackageName(classItemsLookup.extractPackageName(element)); setSummary(classItemsLookup.extractSummary(element)); - String depMsg = classItemsLookup.extractDeprecatedDescription(element); - if (depMsg != null) { - setDeprecated(depMsg); - setStatus(Status.DEPRECATED.toString()); - } }}; } 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 64e70f33..009b67dd 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 @@ -4,7 +4,6 @@ import com.microsoft.model.ExceptionItem; import com.microsoft.model.MethodParameter; import com.microsoft.model.Return; -import com.microsoft.model.Status; import com.microsoft.util.CommentHelper; import com.microsoft.util.Utils; import com.sun.source.doctree.*; @@ -77,12 +76,6 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(Element element) { result.setReturn(extractReturn((VariableElement) element)); } - String depMsg = extractDeprecatedDescription(element); - if (depMsg != null) { - result.setDeprecated(depMsg); - result.setStatus(Status.DEPRECATED.toString()); - } - return result; } 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 d7ac36bc..406a3d6f 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 @@ -52,11 +52,6 @@ protected ExtendedMetadataFileItem buildMetadataFileItem(TypeElement classElemen result.setInheritedMethods(determineInheritedMembers(inheritedMethods)); populateContent(classElement, classSNameWithGenericsSupport, result); result.setTocName(classQName.replace(packageName.concat("."), "")); - String depMsg = extractDeprecatedDescription(classElement); - if (depMsg != null) { - result.setDeprecated(depMsg); - result.setStatus(Status.DEPRECATED.toString()); - } return result; } 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 5a2c89f4..02e9be9c 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 @@ -10,7 +10,7 @@ @JsonPropertyOrder({"uid", "id", "parent", "children", "href", "langs", "isExternal", "name", "nameWithType", "fullName", "overload", "overridden", "type", "package", "summary", "syntax", "inheritance", "implements", "exceptions", - "spec.java", "inheritedMembers", "status", "deprecated"}) + "spec.java", "inheritedMembers", "status"}) public class MetadataFileItem implements Comparable { private final String uid; @@ -39,7 +39,6 @@ public class MetadataFileItem implements Comparable { @JsonProperty("inheritedMembers") private List inheritedMethods = new ArrayList<>(); private String status; - private String deprecated; @Override public int compareTo(MetadataFileItem item) { @@ -272,8 +271,4 @@ public String handleGenericForOverLoad(String value) { public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } - - public String getDeprecated() { return deprecated; } - - public void setDeprecated(String deprecated) { this.deprecated = deprecated; } } 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 34886fa2..0d15a994 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 @@ -254,7 +254,7 @@ items: overload: "com.microsoft.samples.SuperHero.successfullyAttacked*" type: "Method" package: "com.microsoft.samples" - summary: "This is a simple description of the method. . . [Superman!][Superman]\n\n\n[Superman]: http://www.supermanisthegreatest.com" + summary: "(deprecated) As of version 1.1, use . . . instead -\n\nThis is a simple description of the method. . . [Superman!][Superman]\n\n\n[Superman]: http://www.supermanisthegreatest.com" syntax: content: "public int successfullyAttacked(int incomingDamage, String damageType)" parameters: @@ -271,7 +271,6 @@ items: - type: "java.lang.IllegalArgumentException" description: "when incomingDamage is negative and thanks for Exception" status: "deprecated" - deprecated: "As of version 1.1, use . . . instead" references: - uid: "com.microsoft.samples.SuperHero.SuperHero*" name: "SuperHero" 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 2d1f453a..41a61229 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: "Agreement details collection operations implementation class." + summary: "(deprecated) Use AgreementMetaData instead. - Agreement details collection operations implementation class." syntax: content: "public class AgreementDetailsCollectionOperations extends BasePartnerComponentString implements IAgreementDetailsCollection" inheritance: @@ -37,7 +37,6 @@ items: - "java.lang.Object.wait(long)" - "java.lang.Object.wait(long,int)" status: "deprecated" - deprecated: "Use AgreementMetaData instead." - uid: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.AgreementDetailsCollectionOperations(com.microsoft.samples.IPartner)" id: "AgreementDetailsCollectionOperations(com.microsoft.samples.IPartner)" parent: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations" @@ -67,14 +66,13 @@ items: overload: "com.microsoft.samples.agreements.AgreementDetailsCollectionOperations.get*" type: "Method" package: "com.microsoft.samples.agreements" - summary: "Retrieves the agreement details." + summary: "(deprecated) Some text - Retrieves the agreement details." syntax: content: "public ResourceCollection get()" return: type: "com.microsoft.samples.agreements.ResourceCollection" description: "A list of agreement details." status: "deprecated" - deprecated: "Some text" references: - uid: "com.microsoft.samples.IPartner" name: "IPartner" 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 aabc5e0d..47d03163 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,11 +12,10 @@ items: fullName: "com.microsoft.samples.agreements.IAgreementDetailsCollection" type: "Interface" package: "com.microsoft.samples.agreements" - summary: "Encapsulates the operations on the agreement metadata collection." + summary: "(deprecated) This one is deprecated :( - Encapsulates the operations on the agreement metadata collection." syntax: content: "public interface IAgreementDetailsCollection" status: "deprecated" - deprecated: "This one is deprecated :(" - uid: "com.microsoft.samples.agreements.IAgreementDetailsCollection.get()" id: "get()" parent: "com.microsoft.samples.agreements.IAgreementDetailsCollection" 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 b2d1ba1b..b04846da 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 @@ -146,6 +146,7 @@ items: overload: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.valueOf*" type: "Method" package: "com.microsoft.samples.google" + summary: "(deprecated) Use #forNumber(int) instead." syntax: content: "public static RecognitionAudio.AudioSourceCase valueOf(int value)" parameters: @@ -156,7 +157,6 @@ items: type: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase" description: "The enum associated with the given number." status: "deprecated" - deprecated: "Use #forNumber(int) instead." - uid: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase.valueOf(java.lang.String)" id: "valueOf(java.lang.String)" parent: "com.microsoft.samples.google.RecognitionAudio.AudioSourceCase"