Skip to content

Commit

Permalink
feat(speech to text): update based on new api definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-arn authored and apaparazzi0329 committed Mar 15, 2023
1 parent 54fd47d commit 0a7058b
Show file tree
Hide file tree
Showing 78 changed files with 530 additions and 281 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -61,6 +61,8 @@ public interface Status {
protected Long progress;
protected String warnings;

protected AcousticModel() {}

/**
* Gets the customizationId.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -20,6 +20,8 @@ public class AcousticModels extends GenericModel {

protected List<AcousticModel> customizations;

protected AcousticModels() {}

/**
* Gets the customizations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -85,6 +85,11 @@ public static class Builder {
private String containedContentType;
private Boolean allowOverwrite;

/**
* Instantiates a new Builder from an existing AddAudioOptions instance.
*
* @param addAudioOptions the instance to initialize the Builder with
*/
private Builder(AddAudioOptions addAudioOptions) {
this.customizationId = addAudioOptions.customizationId;
this.audioName = addAudioOptions.audioName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -33,6 +33,11 @@ public static class Builder {
private InputStream corpusFile;
private Boolean allowOverwrite;

/**
* Instantiates a new Builder from an existing AddCorpusOptions instance.
*
* @param addCorpusOptions the instance to initialize the Builder with
*/
private Builder(AddCorpusOptions addCorpusOptions) {
this.customizationId = addCorpusOptions.customizationId;
this.corpusName = addCorpusOptions.corpusName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -35,6 +35,11 @@ public static class Builder {
private String contentType;
private Boolean allowOverwrite;

/**
* Instantiates a new Builder from an existing AddGrammarOptions instance.
*
* @param addGrammarOptions the instance to initialize the Builder with
*/
private Builder(AddGrammarOptions addGrammarOptions) {
this.customizationId = addGrammarOptions.customizationId;
this.grammarName = addGrammarOptions.grammarName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -33,6 +33,11 @@ public static class Builder {
private List<String> soundsLike;
private String displayAs;

/**
* Instantiates a new Builder from an existing AddWordOptions instance.
*
* @param addWordOptions the instance to initialize the Builder with
*/
private Builder(AddWordOptions addWordOptions) {
this.customizationId = addWordOptions.customizationId;
this.wordName = addWordOptions.wordName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -27,6 +27,11 @@ public static class Builder {
private String customizationId;
private List<CustomWord> words;

/**
* Instantiates a new Builder from an existing AddWordsOptions instance.
*
* @param addWordsOptions the instance to initialize the Builder with
*/
private Builder(AddWordsOptions addWordsOptions) {
this.customizationId = addWordsOptions.customizationId;
this.words = addWordsOptions.words;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -50,6 +50,8 @@ public interface Compression {
protected Long frequency;
protected String compression;

protected AudioDetails() {}

/**
* Gets the type.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -44,6 +44,8 @@ public interface Status {
protected AudioResource container;
protected List<AudioResource> audio;

protected AudioListing() {}

/**
* Gets the duration.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -25,6 +25,8 @@ public class AudioMetrics extends GenericModel {

protected AudioMetricsDetails accumulated;

protected AudioMetrics() {}

/**
* Gets the samplingInterval.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -46,6 +46,8 @@ public class AudioMetricsDetails extends GenericModel {
@SerializedName("non_speech_level")
protected List<AudioMetricsHistogramBin> nonSpeechLevel;

protected AudioMetricsDetails() {}

/**
* Gets the xFinal.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -26,6 +26,8 @@ public class AudioMetricsHistogramBin extends GenericModel {
protected Float end;
protected Long count;

protected AudioMetricsHistogramBin() {}

/**
* Gets the begin.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2021.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -40,6 +40,8 @@ public interface Status {
protected AudioDetails details;
protected String status;

protected AudioResource() {}

/**
* Gets the duration.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -24,6 +24,8 @@ public class AudioResources extends GenericModel {

protected List<AudioResource> audio;

protected AudioResources() {}

/**
* Gets the totalMinutesOfAudio.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -23,6 +23,11 @@ public class CheckJobOptions extends GenericModel {
public static class Builder {
private String id;

/**
* Instantiates a new Builder from an existing CheckJobOptions instance.
*
* @param checkJobOptions the instance to initialize the Builder with
*/
private Builder(CheckJobOptions checkJobOptions) {
this.id = checkJobOptions.id;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -15,4 +15,8 @@
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/** The checkJobs options. */
public class CheckJobsOptions extends GenericModel {}
public class CheckJobsOptions extends GenericModel {

/** Construct a new instance of CheckJobsOptions. */
public CheckJobsOptions() {}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2019, 2020.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -20,6 +20,8 @@ public class Corpora extends GenericModel {

protected List<Corpus> corpora;

protected Corpora() {}

/**
* Gets the corpora.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2016, 2021.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -45,6 +45,8 @@ public interface Status {
protected String status;
protected String error;

protected Corpus() {}

/**
* Gets the name.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2018, 2022.
* (C) Copyright IBM Corp. 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -19,16 +19,13 @@ public class CreateAcousticModelOptions extends GenericModel {

/**
* The name of the base language model that is to be customized by the new custom acoustic model.
* The new custom model can be used only with the base model that it customizes. (**Note:** The
* model `ar-AR_BroadbandModel` is deprecated; use `ar-MS_BroadbandModel` instead.)
* The new custom model can be used only with the base model that it customizes.
*
* <p>To determine whether a base model supports acoustic model customization, refer to [Language
* support for
* customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support).
*/
public interface BaseModelName {
/** ar-AR_BroadbandModel. */
String AR_AR_BROADBANDMODEL = "ar-AR_BroadbandModel";
/** ar-MS_BroadbandModel. */
String AR_MS_BROADBANDMODEL = "ar-MS_BroadbandModel";
/** de-DE_BroadbandModel. */
Expand Down Expand Up @@ -117,6 +114,11 @@ public static class Builder {
private String baseModelName;
private String description;

/**
* Instantiates a new Builder from an existing CreateAcousticModelOptions instance.
*
* @param createAcousticModelOptions the instance to initialize the Builder with
*/
private Builder(CreateAcousticModelOptions createAcousticModelOptions) {
this.name = createAcousticModelOptions.name;
this.baseModelName = createAcousticModelOptions.baseModelName;
Expand Down Expand Up @@ -203,10 +205,13 @@ public Builder newBuilder() {
/**
* Gets the name.
*
* <p>A user-defined name for the new custom acoustic model. Use a name that is unique among all
* custom acoustic models that you own. Use a localized name that matches the language of the
* custom model. Use a name that describes the acoustic environment of the custom model, such as
* `Mobile custom model` or `Noisy car custom model`.
* <p>A user-defined name for the new custom acoustic model. Use a localized name that matches the
* language of the custom model. Use a name that describes the acoustic environment of the custom
* model, such as `Mobile custom model` or `Noisy car custom model`. Use a name that is unique
* among all custom acoustic models that you own.
*
* <p>Include a maximum of 256 characters in the name. Do not use backslashes, slashes, colons,
* equal signs, ampersands, or question marks in the name.
*
* @return the name
*/
Expand All @@ -218,8 +223,7 @@ public String name() {
* Gets the baseModelName.
*
* <p>The name of the base language model that is to be customized by the new custom acoustic
* model. The new custom model can be used only with the base model that it customizes. (**Note:**
* The model `ar-AR_BroadbandModel` is deprecated; use `ar-MS_BroadbandModel` instead.)
* model. The new custom model can be used only with the base model that it customizes.
*
* <p>To determine whether a base model supports acoustic model customization, refer to [Language
* support for
Expand All @@ -234,8 +238,9 @@ public String baseModelName() {
/**
* Gets the description.
*
* <p>A description of the new custom acoustic model. Use a localized description that matches the
* language of the custom model.
* <p>A recommended description of the new custom acoustic model. Use a localized description that
* matches the language of the custom model. Include a maximum of 128 characters in the
* description.
*
* @return the description
*/
Expand Down
Loading

0 comments on commit 0a7058b

Please sign in to comment.