Skip to content

Commit

Permalink
feat(language translator): update based on api definitions
Browse files Browse the repository at this point in the history
mostly javadoc updates
  • Loading branch information
jeff-arn authored and apaparazzi0329 committed Mar 15, 2023
1 parent 1e2682f commit d45607b
Show file tree
Hide file tree
Showing 27 changed files with 150 additions and 38 deletions.
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 All @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.53.0-9710cac3-20220713-193508
* IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647
*/

package com.ibm.watson.language_translator.v3;
Expand Down Expand Up @@ -65,8 +65,10 @@
*/
public class LanguageTranslator extends BaseService {

/** Default service name used when configuring the `LanguageTranslator` client. */
public static final String DEFAULT_SERVICE_NAME = "language_translator";

/** Default service endpoint URL. */
public static final String DEFAULT_SERVICE_URL =
"https://api.us-south.language-translator.watson.cloud.ibm.com";

Expand Down Expand Up @@ -490,8 +492,8 @@ public ServiceCall<DeleteModelResult> deleteModel(DeleteModelOptions deleteModel
* Get model details.
*
* <p>Gets information about a translation model, including training status for custom models. Use
* this API call to poll the status of your customization request. A successfully completed
* training has a status of `available`.
* this method to poll the status of your customization request. A successfully completed training
* request has a status of `available`.
*
* @param getModelOptions the {@link GetModelOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link TranslationModel}
Expand Down Expand Up @@ -558,9 +560,20 @@ public ServiceCall<DocumentList> listDocuments() {
* Translate document.
*
* <p>Submit a document for translation. You can submit the document contents in the `file`
* parameter, or you can reference a previously submitted document by document ID. The maximum
* file size for document translation is * 20 MB for service instances on the Standard, Advanced,
* and Premium plans * 2 MB for service instances on the Lite plan
* parameter, or you can specify a previously submitted document by document ID. The maximum file
* size for document translation is * **2 MB** for service instances on the Lite plan * **20 MB**
* for service instances on the Standard plan * **50 MB** for service instances on the Advanced
* plan * **150 MB** for service instances on the Premium plan
*
* <p>You can specify the format of the file to be translated in one of two ways: * By specifying
* the appropriate file extension for the format. * By specifying the content type (MIME type) of
* the format as the `type` of the `file` parameter.
*
* <p>In some cases, especially for subtitle file formats, you must use either the file extension
* or the content type. For more information about all supported file formats, their file
* extensions and content types, and how and when to specify the file extension or content type,
* see [Supported file
* formats](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats).
*
* <p>**Note:** When translating a previously submitted document, the target language must be
* different from the target language of the original request when the document was initially
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 @@ -37,6 +37,11 @@ public static class Builder {
private String parallelCorpusContentType;
private String name;

/**
* Instantiates a new Builder from an existing CreateModelOptions instance.
*
* @param createModelOptions the instance to initialize the Builder with
*/
private Builder(CreateModelOptions createModelOptions) {
this.baseModelId = createModelOptions.baseModelId;
this.forcedGlossary = createModelOptions.forcedGlossary;
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 All @@ -23,6 +23,11 @@ public class DeleteDocumentOptions extends GenericModel {
public static class Builder {
private String documentId;

/**
* Instantiates a new Builder from an existing DeleteDocumentOptions instance.
*
* @param deleteDocumentOptions the instance to initialize the Builder with
*/
private Builder(DeleteDocumentOptions deleteDocumentOptions) {
this.documentId = deleteDocumentOptions.documentId;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 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 DeleteModelOptions extends GenericModel {
public static class Builder {
private String modelId;

/**
* Instantiates a new Builder from an existing DeleteModelOptions instance.
*
* @param deleteModelOptions the instance to initialize the Builder with
*/
private Builder(DeleteModelOptions deleteModelOptions) {
this.modelId = deleteModelOptions.modelId;
}
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 @@ -19,6 +19,8 @@ public class DeleteModelResult extends GenericModel {

protected String status;

protected DeleteModelResult() {}

/**
* Gets the status.
*
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 @@ -20,6 +20,8 @@ public class DocumentList extends GenericModel {

protected List<DocumentStatus> documents;

protected DocumentList() {}

/**
* Gets the documents.
*
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 @@ -56,6 +56,8 @@ public interface Status {
@SerializedName("character_count")
protected Long characterCount;

protected DocumentStatus() {}

/**
* Gets the documentId.
*
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 All @@ -23,6 +23,11 @@ public class GetDocumentStatusOptions extends GenericModel {
public static class Builder {
private String documentId;

/**
* Instantiates a new Builder from an existing GetDocumentStatusOptions instance.
*
* @param getDocumentStatusOptions the instance to initialize the Builder with
*/
private Builder(GetDocumentStatusOptions getDocumentStatusOptions) {
this.documentId = getDocumentStatusOptions.documentId;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 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 GetModelOptions extends GenericModel {
public static class Builder {
private String modelId;

/**
* Instantiates a new Builder from an existing GetModelOptions instance.
*
* @param getModelOptions the instance to initialize the Builder with
*/
private Builder(GetModelOptions getModelOptions) {
this.modelId = getModelOptions.modelId;
}
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 All @@ -25,6 +25,11 @@ public static class Builder {
private String documentId;
private String accept;

/**
* Instantiates a new Builder from an existing GetTranslatedDocumentOptions instance.
*
* @param getTranslatedDocumentOptions the instance to initialize the Builder with
*/
private Builder(GetTranslatedDocumentOptions getTranslatedDocumentOptions) {
this.documentId = getTranslatedDocumentOptions.documentId;
this.accept = getTranslatedDocumentOptions.accept;
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 @@ -20,6 +20,8 @@ public class IdentifiableLanguage extends GenericModel {
protected String language;
protected String name;

protected IdentifiableLanguage() {}

/**
* Gets the language.
*
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 @@ -20,6 +20,8 @@ public class IdentifiableLanguages extends GenericModel {

protected List<IdentifiableLanguage> languages;

protected IdentifiableLanguages() {}

/**
* Gets the languages.
*
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 @@ -20,6 +20,8 @@ public class IdentifiedLanguage extends GenericModel {
protected String language;
protected Double confidence;

protected IdentifiedLanguage() {}

/**
* Gets the language.
*
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 @@ -20,6 +20,8 @@ public class IdentifiedLanguages extends GenericModel {

protected List<IdentifiedLanguage> languages;

protected IdentifiedLanguages() {}

/**
* Gets the languages.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 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 IdentifyOptions extends GenericModel {
public static class Builder {
private String text;

/**
* Instantiates a new Builder from an existing IdentifyOptions instance.
*
* @param identifyOptions the instance to initialize the Builder with
*/
private Builder(IdentifyOptions identifyOptions) {
this.text = identifyOptions.text;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 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 @@ -42,6 +42,8 @@ public class Language extends GenericModel {

protected Boolean identifiable;

protected Language() {}

/**
* Gets the language.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 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 Languages extends GenericModel {

protected List<Language> languages;

protected Languages() {}

/**
* Gets the languages.
*
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 @@ -15,4 +15,8 @@
import com.ibm.cloud.sdk.core.service.model.GenericModel;

/** The listDocuments options. */
public class ListDocumentsOptions extends GenericModel {}
public class ListDocumentsOptions extends GenericModel {

/** Construct a new instance of ListDocumentsOptions. */
public ListDocumentsOptions() {}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2017, 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 listIdentifiableLanguages options. */
public class ListIdentifiableLanguagesOptions extends GenericModel {}
public class ListIdentifiableLanguagesOptions extends GenericModel {

/** Construct a new instance of ListIdentifiableLanguagesOptions. */
public ListIdentifiableLanguagesOptions() {}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 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 listLanguages options. */
public class ListLanguagesOptions extends GenericModel {}
public class ListLanguagesOptions extends GenericModel {

/** Construct a new instance of ListLanguagesOptions. */
public ListLanguagesOptions() {}
}
Loading

0 comments on commit d45607b

Please sign in to comment.